One-Time Pad Explained: The Unbreakable Code Spies Actually Used

One time pad explained in plain terms means understanding the only cipher in history that mathematics itself declares unbreakable — and the reason nobody uses it to send you a text message. The central question is why a perfect code is also an impractical one, and the answer is that its perfection comes with a price no ordinary conversation can pay.

A one-time pad is an encryption method in which the message is combined with a random key of exactly the same length, used once and then destroyed. If the key is truly random, as long as the message, and never reused, the resulting cipher text reveals nothing at all, not even in principle.

The story of the one-time pad is a story of spies, wartime radio rooms, and mathematicians arguing over what “unbreakable” really means. It begins long before computers, and it ends with a lesson that still shapes how encryption is designed today.

Key takeaways

  • A one-time pad is the only cipher proven unbreakable by mathematics.
  • The key must be truly random, as long as the message, and used once.
  • Reusing a key destroys the security completely.
  • Spies and diplomats used it for their most sensitive messages.
  • Distributing the key safely is the problem that limits it.

What a one-time pad is

Picture a pad of paper, each page covered in random letters, and two copies of the same pad, one held by the sender and one by the receiver. To send a message, you take the top page, combine each letter of your message with the matching random letter, write down the result, and then tear the page off and burn it. The receiver, holding the identical page, reverses the process and reads the message, then burns their copy too.

The mathematics behind this is disarmingly simple. Each letter of the message is shifted by the matching random letter, and because the key is random, the result could be any message of the same length with equal probability. An attacker holding only the cipher text learns nothing, because every possible message is equally likely, and there is no pattern to analyse, no structure to exploit, and no amount of computing power that changes that.

The idea was first described in the late nineteenth century, and it was put into serious use in the twentieth, when Gilbert Vernam patented a version in 1919 and Joseph Mauborgne, a US Army officer, recognised that the key had to be random and used only once. Claude Shannon proved its perfect secrecy in 1949, in a paper that founded modern information theory, and his proof is still the gold standard: a one-time pad, used correctly, cannot be broken, full stop. Our guide to symmetric encryption explains the family the one-time pad belongs to, and our guide to end-to-end encryption explains how modern messaging protects conversations instead.

How a one-time pad works

Encryption starts with the key, and the key is everything. It must be generated from a genuinely random source, it must be exactly as long as the message, and it must never have been used before and never be used again. The sender adds each message character to the matching key character, modulo the alphabet, and the result is the cipher text, which looks like pure noise.

Decryption is the same operation in reverse. The receiver, holding the identical pad, subtracts each key character from the matching cipher character and recovers the original message, then destroys the key page. If the key was random and used once, the cipher text is statistically independent of the message, which is what Shannon’s proof means by perfect secrecy: the message could have been anything, and the cipher text gives no clue which.

Reuse is where the whole thing falls apart. If the same key page encrypts two messages, an attacker can combine the two cipher texts and cancel out the key, leaving the two messages combined with each other, and from there, with enough patience, both messages can be pulled apart. This is not a theoretical worry: Soviet reuse of one-time pad pages in the 1940s, in the traffic later studied under the codename VENONA, let American cryptanalysts read messages that should have been unbreakable.

Randomness is the other place it fails in practice. A key that looks random but was produced by a predictable process is not a one-time pad at all, and a key generated from a pattern, a phrase, or a flawed machine can be attacked like any other cipher. True randomness is hard to produce and harder to prove, which is why serious one-time pad systems generated keys from physical processes, such as radioactive decay or noisy diodes, rather than from arithmetic.

Delivery is the quiet problem nobody talks about until it is too late. The pad has to reach both people safely before any message can be sent, and the pad itself is as long as all the messages it will ever protect, so sending the pad is as hard as sending the messages in the first place. If you can deliver a thick pad of random keys securely, you could often have delivered the message itself, which is the paradox at the heart of the system.

A dark office desk with a small notepad of random letters, a pencil, and a sealed envelope under a green lamp
A dark office desk with a small notepad of random letters, a pencil, and a sealed envelope under a green lamp, shows how a one-time pad works: one random page, one message, then the page is gone.

Comparing the one-time pad with other encryption methods

The one-time pad is one of several ways to encrypt a message, and each was built with a different emphasis. A stream cipher reuses a short key to generate a long keystream, a block cipher scrambles fixed-size chunks with a short key, and public-key systems solve the delivery problem by splitting the key in two, and each approach trades perfection for practicality in a different way.

The table below sets out the main contrasts between the leading approaches.

Aspect One-time pad Stream cipher Public-key encryption
Security proof Perfect, proven Strong, not proven Strong, based on hard problems
Key length As long as the message Short, reused safely Short public and private keys
Key reuse Never allowed Allowed with a fresh nonce Keys reused for many messages
Key delivery Must be done in person Short key, easy to share Public key can travel openly
Best for A few vital messages Fast bulk encryption Everyday secure communication

The practical result is that the one-time pad is the right choice for a handful of messages that must never be read, a stream cipher suits fast bulk encryption, and public-key encryption fits everything else, because it solves the delivery problem the pad cannot.

Where the one-time pad was used

Diplomats carried one-time pads through the Cold War. Embassies kept pads in safes, couriers carried fresh pads in diplomatic bags, and the most sensitive messages between Moscow and its stations abroad were encrypted with pads, because when the message is a matter of national survival, the cost of distributing keys is worth paying.

Spies in the field used miniature pads, printed on tiny pages, hidden in everyday objects. A pad could be concealed in a hollowed-out coin, a matchbook, or the lining of a coat, and a single page was enough for a short, vital message. The KGB issued such pads to its agents, and the CIA did the same, and the rule was always the same: use the page once, then destroy it.

The VENONA story is the cautionary tale. Soviet code clerks, under pressure during the war, reused pad pages, and American and British analysts, working for decades on the intercepted traffic, recovered enough of the messages to expose atomic spies. The cipher itself never failed; the people using it did, which is the lesson the whole field took away from it.

Hotlines between governments have used one-time pads. The famous Washington-Moscow hotline, set up after the Cuban Missile Crisis, encrypted its messages with one-time pads, because a channel meant to prevent nuclear war cannot afford even a theoretical weakness.

Modern uses are rare but real. A few organisations still use one-time pads for their most sensitive short messages, and the idea survives in a modern form in quantum key distribution, where physics delivers the random key.

Strengths and limits

The greatest strength of the one-time pad is its proof. No other cipher can claim perfect secrecy, and the proof does not depend on assumptions about computing power, about undiscovered mathematics, or about the future. It is secure against any adversary, with any amount of time and any amount of hardware, forever.

It is also a strength that the system is simple to understand and to check. There is no complex algorithm to get wrong, no implementation subtlety to hide a flaw, and anyone can verify that the key is random and used once. Simplicity is a kind of security, and the pad has it in full.

The limits are real, though, and they are the reason you are not using one right now. The key must be as long as everything you will ever say, it must reach the other person safely, it must be truly random, and it can never be reused. For a conversation of any length, that is an impossible burden, which is why the world uses ciphers that are merely very strong instead of perfect.

One-time pad checklist

  • Generate the key from a truly random source, never from a pattern.
  • Make the key exactly as long as the message, no shorter.
  • Use each key page once, then destroy it completely.
  • Deliver the pad through a channel you trust with your life.
  • Store the pad securely; anyone who holds it can read everything.
  • Never reuse a page, even for a short message.
  • Check that sender and receiver hold identical copies.
  • Plan for what happens if a pad is lost or stolen.
  • Use a modern cipher for ordinary messages; save the pad for the vital few.

Frequently asked questions

What is a one-time pad in simple terms?

It is a cipher where each message is combined with a random key exactly as long as the message, used once and then destroyed, which makes the result unbreakable by mathematics.

Why is the one-time pad considered unbreakable?

Because Claude Shannon proved that with a truly random key used once, the cipher text could correspond to any message of the same length, so an attacker learns nothing at all, no matter how much computing power they have.

What happens if you reuse a one-time pad key?

The security collapses. Combining two messages encrypted with the same key cancels the key out and leaves the messages mixed together, which lets an attacker recover both, as the VENONA decrypts showed.

Why does nobody use one-time pads for everyday messages?

Because the key must be as long as all your messages combined and delivered safely in advance, which is impractical for ordinary conversation, while modern ciphers are strong enough and far easier to use.

How do you make a truly random key?

From a physical process, such as radioactive decay, thermal noise, or a hardware random generator, because anything produced by a predictable formula is not truly random, however random it looks.

Is a one-time pad still used anywhere today?

Rarely, for a few highly sensitive short messages, and its ideas live on in quantum key distribution, which uses physics to deliver random keys securely.

The bottom line

One time pad explained in one line is this: a random key as long as the message, used once and burned, and a cipher that mathematics itself cannot break.

It is the perfect code that nobody can afford to use, and the reason the rest of cryptography is a long negotiation between perfection and practicality.

This article is general information about how one-time pads work, not advice about choosing encryption for a particular system.

Latest articles

Scroll to Top