Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It is my understanding that one-time pad encryption is the only unbreakable encryption, but suffers from the management of huge keys, and the secure distribution of those keys.

Could one-time pads be used without key distribution to create secure communication?

Example Scenario:

  1. Adam encrypts his message to Bob with a one-time pad (OTP) Adam generated and then sends the ciphertext to Bob.

  2. Bob encrypts Adams ciphertext using a second OTP Bob generated and then sends it back to Adam.

  3. Adam attempts to decrypt the message using the original OTP he generated, then sends the results back to Bob.

  4. Bob decrypts the message using his OTP.

share|cite|improve this question
If this worked, couldn't an eavesdropper do the same thing to the message? That is, generate her own private key, intercept the message in step 2, and replace it with Adam's ciphertext encrypted with her key? (In any case, you might be interested in .) – Qiaochu Yuan Jan 17 '11 at 19:43
Thank you for the answer. – Phil Jan 17 '11 at 19:49
@Qiaochu Yuan: In cryptographic jargon, an eavesdropper just sees the traffic. If you have to actively change the traffic to implement your attack, it's called (for better or worse) a 'man-in-the-middle' attack (see e.g. – TonyK Jan 17 '11 at 19:58
Though this idea is useless with OTPs, it is very useful with regards to other commutative encryptions. See, for example, my comments to this answer (use to read comments) – BlueRaja - Danny Pflughoeft Jan 17 '11 at 21:35
up vote 7 down vote accepted

Let $M$ be the plain text, and let Adam's and Bob's one-time pads be $A$ and $B$. If I have understood you correctly, what you suggest is:

Adam sends Bob $M \oplus A$
Bob sends Adam $M \oplus A \oplus B$
Adam sends Bob $M \oplus B$

This doesn't work, because an eavesdropper can recover the plain text by

$M = (M \oplus A) \oplus (M \oplus A \oplus B) \oplus (M \oplus B)$

share|cite|improve this answer
Perfect. Easy to understand why my idea is no good. – Phil Jan 17 '11 at 19:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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