Vernam Pad
Published 28 Oct 2026 · · 9 min read
The one-time pad is the only cipher ever proved unbreakable, and the proof is only four lines long. It is also almost impossible to use correctly, and every documented failure of a one-time pad system has been a failure of key handling rather than of mathematics. It is the right note to end this loom on: perfect in theory, and defeated in practice by people.
- Era
- Modern
- Type
- Polyalphabetic
- Key space
- 32^n, unlimited n
- Level
- Specialist
IPhenomenon
The operation is exclusive-or on a small alphabet. This bench uses 32 symbols — A to Z plus the digits 2 to 7 — so that every symbol has a five-bit code and XOR never leaves the alphabet.
| Symbol | Code | Symbol | Code |
|---|---|---|---|
| A | 00000 | M | 01100 |
| B | 00001 | N | 01101 |
| C | 00010 | O | 01110 |
| ... | ... | ... | ... |
| Z | 11001 | 4 | 11100 |
| 2 | 11010 | 5 | 11101 |
| 3 | 11011 | 6 | 11110 |
Plaintext L is 01011. Pad B is 00001. XOR gives 01010, which is K. The receiver XORs K with the same pad symbol and gets L back, because XOR is its own inverse.
Now the crucial part. If the pad symbol is genuinely random, uniformly distributed, and used exactly once, then for every possible plaintext letter there is a pad symbol that produces the observed ciphertext letter — with equal probability. The ciphertext tells the attacker nothing about the plaintext, not because the computation is hard but because the information is not there. This is not a claim about effort; it is a claim about existence.
IIKey space
For an n-character message the key space is 32^n, and unlike every other cipher in this collection the key does not repeat, so the space grows with the message instead of being fixed.
That is the source of the proof. Shannon's 1949 result states that perfect secrecy requires the key to be at least as long as the message, to be uniformly random, and to be used only once. The one-time pad meets all three conditions and is therefore unbreakable by any amount of computation.
The three conditions are also the three reasons it fails in practice.
| Condition | How it fails in the field |
|---|---|
| at least as long as the message | pads must be generated, printed, distributed and stored in bulk |
| uniformly random | hand-generated pads are never random; typewriters and early generators had biases |
| used only once | the single hardest discipline in cryptography, and the one most often broken |
A one-time pad used twice is no longer a one-time pad. It is a Vigenere cipher whose key you have just handed to the enemy.
If two messages are encrypted with the same pad, XORing the two ciphertexts together cancels the pad entirely and leaves the XOR of the two plaintexts. From that point the attack is a crib-drag: guess a word in one message, XOR it in, and see whether the other message produces readable text.
IIIEnciphering
- Generate the pad: genuinely random symbols, one per plaintext character, from a source that has no bias.
- Distribute the pad to the receiver in advance, by a channel that is not the one the message will use.
- Write the plaintext in the alphabet the pad uses.
- For each position, convert the plaintext symbol and the pad symbol to their five-bit codes.
- XOR the two codes position by position.
- Convert the results back to symbols and transmit.
- Destroy the pad page. Do this before the reply is sent, not after, and never keep a working copy.
IVDeciphering
- Take the next unused page of the pad. Confirm with the sender's records that it is the same page, because using different pages produces garbage and looks like an attack.
- Convert each ciphertext symbol to its five-bit code.
- XOR with the corresponding pad code. The operation is identical to enciphering, which is one of the few things the pad makes easier.
- Convert the results back to symbols to recover the plaintext.
- Destroy the page.
- If the plaintext is readable for a while and then degrades, the likely cause is a padding or synchronisation error in the middle, not a key problem. Check the message for a dropped character before suspecting the pad.
- If two messages have ever shared a page, treat both as compromised and rekey everything the pad was to protect.
VWeakness
Key reuse is fatal and has happened repeatedly. Soviet intelligence reused pad pages across different agents and different years in the 1940s; the resulting project, known to the Americans as Venona, decrypted thousands of messages over two decades and identified hundreds of sources.
Hand-generated pads are not random. The Soviet pads had documented statistical biases from the typewriters used to produce them, which is what made the Venona attack possible at all. A biased pad is a weak key, and a weak key defeats the proof's assumption rather than the proof itself.
Distribution is as hard as the problem it solves. A pad as long as all the traffic it must protect has to be delivered by someone, physically, ahead of time. The pad is only as secure as the courier.
Destruction is part of the protocol and is often skipped. Every page must be destroyed after use. A retained page is a future compromise of everything it will encrypt.
It has no integrity protection. XOR is malleable: an attacker who knows or guesses part of the plaintext and where it sits can flip bits in the ciphertext and change the message without knowing the key. This is why modern systems need authenticated encryption, not just secrecy.
VIPractice
Ciphertext
K7O6YO4
Hint: Pad BRASSKEY, alphabet A-Z then 2-7, XOR the five-bit codes.
Reveal the answer
Plaintext
LOOMKEY
·History note
Gilbert Vernam, an engineer at AT&T, patented the technique in 1919 for use with punched paper tape; Joseph Mauborgne of the US Army Signal Corps recognised that the key tape had to be as long as the message and random, which turned Vernam's practical system into the theoretically perfect cipher. Claude Shannon proved the security property in Communication Theory of Secrecy Systems in 1949. The most instructive historical case is Venona: Soviet intelligence reused one-time pad pages across different messages in the 1940s, and the resulting decryptions by US and British cryptanalysts, running from 1943 into the 1980s, exposed hundreds of intelligence sources. The failure was not cryptographic. It was a station officer reusing a page because there were not enough pages.
·Further reading
The one-time pad occupies a strange position. It is the only cipher here that is provably perfect, and the only one that is practically unusable for the traffic volumes modern systems carry. Its contribution is not that anyone should use it, but that it defines what perfect secrecy means — the standard against which every other system is measured, usually to be found wanting.
Its practical descendants are the stream ciphers: AES in counter mode generates a keystream and XORs it with the data, exactly as Vernam did. The difference is that the keystream is generated from a short key by a pseudorandom function, so it looks random and repeats after a very long time. That is a real and useful compromise, and it is a compromise — the proof does not carry over.
That is the end of the loom. Twenty ciphers, one idea repeated in twenty costumes: the attacker knows the statistics of the language, and every design in this collection is an attempt to make those statistics stop meaning anything.
+Weave into
Enigma Rotor Machine
Enigma is the cipher that looks unbeatable on paper and lost a war in practice. Its key space was in the…
Vigenere Tableau
The Vigenere cipher was called *le chiffre indéchiffrable* — the indecipherable cipher — for roughly three…
Nomenclator
A nomenclator is half cipher, half dictionary. It substitutes letters as usual but also assigns its own…
Book Cipher
A book cipher replaces the alphabet with a book. Every letter is written as a position — page, line, word…