The One-Time Pad

1 Conversation

The Perfect Solution

For the entire history of cryptology people have been looking for the perfect cipher, a cipher that is easy to understand and offers absolutely perfect security. That cipher is the one-time pad.

A one-time pad is very simple in principle, it can be used in computer ciphers or paper-based field ciphers and it is mathematically perfect.

Imagine a genuinely random sequence of numbers or letters, that is all a one-time pad is. The random sequence is at least as long as the message and is only used for that single message, hence the name. Encryption could use any system available to provide single-character conversion; the security does not lie in the system but in the random key. OTP ciphers could be considered to be a Vigenère cipher with an infinitely long absolutely random key.

Why OTP is Perfect

The potential cryptanalyst has absolutely no useful information to go on, he can't look for any repeating pattern, he can't compare messages in the hope that they were encrypted with the same key and he can't even attempt to guess what is in the original message and deduce anything from that, this is because the random key means that the message has an exactly equal probability of being any combination of characters.

If the cryptanalyst assumes that the message 'SWPR MMWD' means 'SEND FOOD' then he could recover a fragment of assumed key on that basis, sadly he can't extrapolate that information to give him any idea what the next character in the sequence might be. It is also equally possible that the message might actually be 'HEAT WAVE', 'PORK CHOP' or 'HIGH MASS', all are equally likely.

OTP is absolutely unbreakable if:

  • The key is at least as long as the message.
  • The key is random.
  • The key is only used once.

Limitations of OTP

If OTP is perfect, why isn't it used all the time? Well in some instances it is, where perfect security is required, spies of the former Soviet Union carried OTP ciphers disguised cunningly in the heels of shoes or inside tobacco tins. Ultimately OTP has the huge weakness that in order to use it as a cipher you must securely pass between the users a vast number of keys, these keys must be at least the same length as the messages sent and must be sent in perfect security.

The question then becomes: If you can send these large keys securely then why is a cipher needed at all? The same mechanism could be used to send the original message equally securely.

Clearly the answer is that in some instances it is possible to send a key slowly but safely while the information to be encrypted must be sent in more haste. This is the case with an espionage agent. He can carry the key with him when he leaves his own country but the information he uncovers may be too urgent to wait until his return.


Bookmark on your Personal Space


Entry

A608690

Infinite Improbability Drive

Infinite Improbability Drive

Read a random Edited Entry


Written and Edited by

Disclaimer

h2g2 is created by h2g2's users, who are members of the public. The views expressed are theirs and unless specifically stated are not those of the Not Panicking Ltd. Unlike Edited Entries, Entries have not been checked by an Editor. If you consider any Entry to be in breach of the site's House Rules, please register a complaint. For any other comments, please visit the Feedback page.

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more