Exhibit 37 of 172 1917

Vernam Cipher

Vernam’s teleprinter cipher used binary addition; developed in 1917 and patented in 1919

XOR gives perfect secrecy only with an independent, uniformly random secret pad at least as long as the message, used once. No authentication.

InventorGilbert Vernam (AT&T)
Year1917
Key TypeKey tape (bitwise XOR)
Broken ByKey reuse → depth attack
Modern LessonXOR as cipher operation · nonce uniqueness

Why This Matters

Gilbert Vernam’s 1917 XOR-based teleprinter cipher is an early ancestor of modern XOR-based stream encryption. ChaCha20, AES-CTR, and AES-GCM also combine data with a keystream using XOR; Vernam’s patent concerned a telegraphic system.

Historical Context

Gilbert Vernam was an AT&T engineer who in 1917 invented an automatic cipher (patented 1919) for teleprinter communications. Messages on punched paper tape were XOR'd with a key tape character by character. A uniformly random, independent, secret key used only once gives the one-time-pad construction. Vernam’s automatic tape system and the perfect-secrecy conditions are distinct ideas.

The Vernam cipher is an early ancestor of modern XOR-based stream encryption. ChaCha20, AES-CTR, and AES-GCM also use XOR to combine data and a keystream. The difference is that modern ciphers generate their keystream from a short key and a nonce, rather than requiring a physical tape as long as the message.

How It Works

The Vernam cipher operates at the bit level using the XOR (exclusive or) operation. Each bit of the plaintext is combined with the corresponding bit of the key.

Ciphertext = Plaintext XOR Key  (bitwise)

H = 01001000
K = 10110100  (key byte)
C = 11111100  (ciphertext)

Decryption is identical:
C XOR K = P  (XOR is its own inverse)

When key tape is:
  Random + same length + used once → One-Time Pad (unbreakable)
  Repeating tape → periodic-key weaknesses; a secure pseudorandom generator instead supports computational security

The elegance of XOR is that applying the same key a second time returns the plaintext: C XOR K = P. There is no separate decryption algorithm — the demo's Decrypt button simply reads the hex bytes back in and XORs them with the key again.

ℹ️

About this demo: Plaintext is normalized to the letters A–Z, XORed byte-by-byte with the key, and the ciphertext is displayed as two hexadecimal digits per byte — so Decrypt expects hex input, not letters. Leave the key blank and the demo generates a random pad using the browser's secure random source, appending it to the output as [Key: …]. A key shorter than the message is rejected rather than repeated, and a raw byte key can be supplied as hex:<bytes>. The displayed pad is not secret from the browser; this is an educational calculation, not a confidential channel.

How It Was Broken
Depth Attack (Key Reuse)
Complexity: Moderate · When key tapes were reused

For binary encryption, reusing the same keystream gives C1 ⊕ C2 = P1 ⊕ P2. This exposes relations that language guesses or known plaintext may exploit. A biased natural-language key is different from a cryptographically generated pseudorandom keystream: the latter aims for computational security, not perfect secrecy.

⚡

VENONA: VENONA exploited reused decimal additive pages. Cancellation is the analogous idea, but its digitwise arithmetic and codebook-recovery problem differed from this binary XOR example.

What It Teaches Modern Cryptography
Concept from VernamModern Evolution
XOR as cipher operationTypical XOR-based stream encryption: C = P ⊕ keystream
Key tape = keystreamChaCha20 generates 512-bit blocks of keystream per counter value
Reused key = catastrophic failureNonce uniqueness: AES-GCM fails catastrophically on nonce reuse
Automatic teleprinter encryptionHardware crypto acceleration: AES-NI CPU instructions
Can You Break This?

A short Vernam message, exactly as the demo above produces it. Use what you just learned.

0c0a1517

Key: KEYS · Hint: each pair of hex digits is one XORed byte. Paste ciphertext and key into the demo above, or work the XOR by hand.

GOLD — first byte: G = 01000111, K = 01001011, XOR = 00001100 = hex 0c.
Difficulty to Break
Moderate 40%

Reusing keystream exposes relations between plaintexts. A uniform, independent, secret, single-use message-length pad provides perfect secrecy, but not authentication.

Quick Facts
Exhibit37 of 172
Era1917
TrustSecure (Modern)
InventorGilbert Vernam
Year1917
Broken ByKey reuse / depth attack
← Previous One-Time Pad