My question might appear the same as the question Taking advantage of one-time pad key reuse?, but actually I did read all the answers and none of them helped me with the details I need.
I am new to cryptography and my problem is with two time pad attacks on OTP. The problem I had in my course was that I have 10 ciphertexts encrypted with the same key $K$. I am then given another ciphertext that I should decrypt.
I know that XOR-ing two ciphers gives me the XOR of their original messages.
My question is what is the correct thing to do after that?
I tried to take 3 ciphertexts $C_1, C_2$ and $C_3$.
Then get $S_1 = C_1 \oplus C_2 \oplus $' '
, also get $S_2 = C_1 \oplus C_3 \oplus$ ' '
.
After that I compared all corresponding characters in $S_1$ and $S_2$, and if $S_1[i] = S_2[i]$ then I calculate $S_1[i] \oplus C_2[i]$ to get $K[i]$.
I tried this on paper before coding and it worked, but I might be missing something.
Is this the right approach? Why does it work?
[a-z]
) and spaces. When a space (0x20
) is xor'd with a lower case letter it becomes upper case. Pick any $C$ and xor it with every other $C$. For any position $i$ where most of the results are capital letters you can guess that $M[i]$ is a space. After doing this for a few more $C$'s you can guess the rest like on "Wheel of Fortune". $\endgroup$