Vernam Pad — Bench tool
Published 28 Oct 2026 ·
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
IWhat this tool does
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.
IIThe key
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.
IIIWhat it will not protect
Historical ciphers are for study and recreation and are not suitable for protecting real information. The full analysis is in the cipher entry.
Read the full entry, with deciphering steps and weakness analysis →