I can't understand a question I came across in a course.

You observe three ciphertexts all resulting from encryption of ASCII plaintexts containing English letters and spaces only, using the one-time pad and the same key. The 10th byte of the first ciphertext is 0xA8, the 10th byte of the second ciphertext is 0xED, and the 10th byte of the third ciphertext is 0xBD. What is the 10th ASCII character of the third plaintext?

I XORed 0xA8 and 0xBD and got 00010101 I XORed 0xED and OxBD and got 01010000 so clearly 0xED is a space and 0xBD is a character.

What I don't understand is why it is the letter 'p'.

Thank you in advance.

  • 2
    $\begingroup$ Hint: from the (correct) observation that (restricting to the 10th byte) the value 0xED is the ciphertext for space (value 0x20), find the value of the key byte, then the plaintext byte for ciphertext value 0xBD, then the character that is represents. Nitpick: the statement would be better with "using the one-time pad but the same key". $\endgroup$
    – fgrieu
    Commented Sep 12, 2018 at 6:33
  • $\begingroup$ ah OxED XOR 0x20 is the key. Gotcha. Thank you so much!! :) $\endgroup$
    – Lilz
    Commented Sep 13, 2018 at 7:36

1 Answer 1


So you were really close. You are right that the 3rd ciphertext's 10th byte(0xED) in the 3rd message is a space. So we know 0x20 in hex is a space in ASCII. So now to find the 10th byte of the key you need to xor 0xED and 0x20 to get 0xCD(which is the 10th byte of the key). Well now that you know the key, you can xor the 10th byte of the 3rd ciphertext 0xBD with 0xCD. So you get 0x70 in hex and 'p' in ASCII.


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