Skip to main content
CipherChronicle

Cipher methods Polyalphabetic

Vernam cipher (One-Time Pad)

The only provably unbreakable cipher. Perfectly random key, as long as the message, used exactly once.

Family :
Polyalphabetic
Difficulty :
Advanced
Era :
1917, Gilbert Vernam
Inventor :
Gilbert Vernam (perfected by Joseph Mauborgne)

Also known as : OTP · one-time pad

The Vernam cipher, also known as the One-Time Pad (OTP), was invented in 1917 by American engineer Gilbert Vernam to secure telegraph communications. Improved by Joseph Mauborgne — who added the requirement of a perfectly random key, never reused — it became the only provably unbreakable cipher, a theorem proved by Claude Shannon in 1949.

Principle

The principle is radically simple. The key K is a perfectly random sequence of integers, as long as the message P. The ciphertext is:

C_i = (P_i + K_i) mod 26

(In Vernam’s original binary form, modular addition is replaced by bitwise XOR.)

Three conditions are absolute:

  1. True randomness — no deterministic pseudo-random generator.
  2. Length equal to the message — no repetition, no cycle.
  3. Used only once — each key is destroyed after use (hence one-time).

Violate any condition and everything collapses.

Why it’s unbreakable

Shannon proved that against an OTP, an attacker gains no information about the plaintext beyond its length. For any ciphertext of length n, every plaintext of length n is equally likely: each corresponds to a valid key.

Example: the ciphertext ZJFQODBCGZJJZIYC could come from CIPHERCHRONICLE with key XBQJKMZVPLWRGNY, or from ATTACKATDAWNOWX with another key, or from anything imaginable. Without extra information, the attacker is stuck.

Example

Plaintext CIPHERCHRONICLE with random key XBQJKMZVPLWRGNY:

C+X=Z  I+B=J  P+Q=F  H+J=Q  E+K=O
R+M=D  C+Z=B  H+V=C  R+P=G  O+L=Z
N+W=J  I+R=Z  C+G=I  L+N=Y  E+Y=C

Result: ZJFQODBCGZJZIYC.

Variants

  • Stream cipher — a modern OTP approximation where the key is produced by a pseudo-random generator from a short seed. Not provably secure but widely used (RC4, ChaCha20).
  • Binary Vernam — original form on punched tape, XOR on each bit. Still used for the red telephone and some diplomatic links.

Practical weaknesses

Vernam is theoretically perfect but practically hard:

  • Distributing a key as long as all future messages is a logistical nightmare.
  • Generating true randomness at scale is non-trivial (thermal noise, quantum decoherence).
  • A single key reuse lets the attacker XOR two ciphertexts and recover the plaintexts’ difference — the famous attack that broke the VENONA project.

That’s why states — and almost nobody else — use OTP: armies and diplomats can absorb the logistics.

In CipherChronicle

Vernam is the perfect teaching moment to explain the gap between practical security and provable security. Its grids can stage the paradox: even with unlimited compute, the attacker fails — because there is literally nothing to guess.

Grid

Z
J
F
Q
O
D
B
C
G
Z
J
Z
I
Y
C
Q
R
S
T
U
V
W
X
Y
Z
KeyRandom OTP (message length)
  1. 1

    Ciphertext

    Perfectly uniform distribution — no structure to exploit.

  2. 2

    Neither Kasiski nor frequency

    The key is as long as the message and truly random: no period, no bias.

  3. 3

    The only possible attack

    Brute force on the key — but every plaintext of the correct length is a valid candidate.

  4. 4

    Apply the pad

    XOR (or add mod 26) each letter with the corresponding key letter.

  5. 5

    Message revealed

    The plaintext surfaces if and only if you hold the exact key.