If a message is sent using one-time pad scheme, which generates random bits in order to, for example, XOR them with the message's bits - how does the receiving side generate the exact series of bits ?

If the receiving side is able to generate the same series then how is it still random ?

  • 3
    $\begingroup$ The receiving side needs to receive an explicit copy of the random bits. $\endgroup$
    – SEJPM
    Commented Feb 9, 2019 at 14:45
  • 2
    $\begingroup$ And said random bits have to remain secret. In the rare practical cases when the OTP is used, the random bits are generated in advance of transmission, and sent by secure means such as trusted couriers. $\endgroup$
    – fgrieu
    Commented Feb 9, 2019 at 15:18

2 Answers 2


The one-time pad requires pre-shared key. Usually, one of the two parties generates the keystream, writes it into a paper or CD/DVD, or USB, etc.. and sends the keystream to the other party in a secure way. The secure way is not encryption rather it is using some person to carry it to the target. After the transmission, they can use the key to decipher.

Wikipedia lists historical uses of the one-time pad. One case is very important; the Venona Project. At some point, the Russians had reused some part of the key. So, the question is how one notices this? The USA and British Code-breakers always tried the crib-dragging and one day was successful!

Some of The Crib Draggin answers in CryptoSO;

  1. Taking advantage of one-time pad key reuse?
  2. How does one attack a two-time pad (i.e. one-time pad with key reuse)?
  3. Little problem with Vernam Cipher

And, an article: A Natural Language Approach to Automated Cryptanalysis of Two-time Pads

  • 1
    $\begingroup$ A coincidence test suffices to detect re-use. No need for crib-dragging for that. See the classic texts by Friedman etc. $\endgroup$ Commented Feb 10, 2019 at 22:19
  • $\begingroup$ @HennoBrandsma good point. When I see the coincidence test I remembered but needs to refresh. Thanks. $\endgroup$
    – kelalaka
    Commented Feb 10, 2019 at 22:31

If the receiving side is able to generate the same series then how is it still random ?

Exactly, and it wouldn't be. But these days we can generate a key stream either in the middle of the two parties (shouldn't use Alice and Bob any more), or at one end, and then securely distribute to both/the other on the fly.

This is called quantum key distribution. Fundamental physical principles (the Observer Effect) mean that even though the key stream is whizzing past a belligerent observer (张三), the good parties will know whether the stream has been intercepted. It's a big subject with big budgets allocated to it, so I'll just include the above link and leave it there for now.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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