Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.
encrypt 11, c/c++
i'm using OnePad alg to find Key and Plain by testing all words, but for each Packet i found various Key-Plain !?
this is my c/c++ code(not all):
struct Cipher { int part[4]; };
Cipher OnePad(char *key, char *plain) { Cipher cipher; for (int i=0; i<4; i++) { cipher.part[i] = toupper(key[i]) ^ toupper(plain[i]); // is this right ???? } return cipher; }
I'm not exactly sure what your code is doing as I don't know C. Keep this in mind though. There might be a number of keys that turn each individual word into plaintext, but there should only be one word that works as a key for all three.
Also, the key and each of the three packets are four letter english words.