I am brand new to the world of cryptogrophy. I am trying to decrypt a many-time-pad. I understand the methodology of using the XOR to get the messages.

C1 XOR C2 = M1 XOR M2

Now my question lies in a specific case. I have about 11 cipher texts with a number down the same index. All of them either have a '2', '3', or '4'. I am completely lost on how to decrypt this key index. If the cipher texts are the same, then it means if I XOR them together I get a ASCII 0 value, I don't know how that helps me. Anything XOR 0, is that anything. So is the message itself contain a integer at that location? Is my key a 0? I doubt that 11 cipher texts would have a number at the exact same spot, seems odd.

How would I go on about getting the key at this specific spot?

  • $\begingroup$ Hint: what if the ciphertexts don't have the same digits; what happens if you xor a text with a '2' with a text with a '3'; how does that differ if instead you xor a '2' with a '4'? $\endgroup$ – poncho Feb 4 '17 at 16:41
  • $\begingroup$ 2^3=1, 2^4=6. Not sure where it is going. $\endgroup$ – Maty Feb 4 '17 at 16:53
  • $\begingroup$ So, if you xor two texts, and get a 1 in that position, what can you deduce from that? What if you get a 6? $\endgroup$ – poncho Feb 4 '17 at 18:34
  • $\begingroup$ The two messages XORed together is a 1 or a 6. $\endgroup$ – Maty Feb 4 '17 at 19:49

You can have a look at each and every key bits for that specific location (presuming there are eight, to encrypt a single ASCII character represented by one byte). Now simply XOR this value with the bits of the ciphertext at the same location. If all plaintexts are digits then you have a (candidate) part of the key stream. This is probably the easiest way for this case.

You can of course also compare any of the pairs of ciphertext bytes. If the last bit of the XOR'ed value is one then you know that one of the two digits is even, and one is odd. You can make similar comparisons for any of the other bits. If a bit higher than the fourth bit is set then you know that one of the two is not a digit (digits go from 0011_0000 to 0011_1001 after all). This is what Poncho was trying to explain to you in the comments.

Note that if you guess one digit to be, say 0011_0110 (6) and the other digit turns out to be 0011_1111 (15) then you guessed wrong, as there is no digit with value 15.


Not the answer you're looking for? Browse other questions tagged or ask your own question.