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++


ghost's Avatar
0 0

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; }


tkearn5000's Avatar
Member
0 0

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.


ghost's Avatar
0 0

I'm not sure if your code is a spoiler but I think a reply will be. maybe pmage?


ghost's Avatar
0 0

I did it.