Classical Ciphers & Cryptanalysis

The substitution-cipher lineage — Caesar, Trithemius, Vigenère, gamma ciphers — the frequency-analysis attacks that killed it, and the one member that is provably unbreakable until you reuse the pad.

Every cipher in this entry is broken, and that is exactly why they are worth an hour: the classical lineage is the cheapest way to acquire the attacker's mindset — counting letter frequencies, exploiting structure, solving for a key from known plaintext — and it ends at the one scheme with a proof of unbreakability, whose failure mode (pad reuse) is still shipping in production systems today under different names.

The shift lineage: Caesar and Trithemius #

Number the alphabet 0..n−10..n-1. The Caesar cipher shifts every letter by a fixed key kk:

y=(x+k) mod n,x=(y−k) mod ny = (x + k) \bmod n, \qquad x = (y - k) \bmod n

The keyspace is n−1n-1 candidates — brute force by hand in minutes. Mathematically it is the special case a=1a=1 of the affine cipher y=(ax+k) mod ny = (ax + k) \bmod n. Its only surviving descendant is ROT13, used as a don't-spoil-me encoding, not encryption.

Trithemius makes the shift depend on the position tt of the letter in the message — e.g. a linear rule k(t)=3t+2k(t) = 3t + 2:

L=(m+k(t)) mod NL = (m + k(t)) \bmod N

The position-dependent shift masks single-letter frequencies, but a linear key rule has two unknown coefficients: two characters of known plaintext solve the whole system. Structure survives; only the disguise improved.

Polyalphabetic ciphers and gamma #

The general form — the gamma cipher family, of which Vigenère is the classic member — adds a key stream γi\gamma_i (the gamma) to the plaintext, symbol by symbol:

ci=(ai+γi) mod Nc_i = (a_i + \gamma_i) \bmod N

With a keyword of length MM, the gamma is periodic: the ciphertext is really MM interleaved Caesar ciphers. That kills naive frequency counting — the histogram of a Vigenère ciphertext is much flatter than the plaintext's — and it resisted attack for ~300 years. Then two tools ended it:

  • Kasiski examination (1863): repeated plaintext fragments encrypted under the same key offset produce repeated ciphertext fragments; the distances between repeats are multiples of MM. GCD the distances → key length.
  • Index of coincidence (Friedman, 1920s): the probability that two random ciphertext letters match distinguishes a monoalphabetic column (English ≈ 0.066) from random (≈ 0.038), confirming MM statistically. Then each of the MM columns falls to plain frequency analysis.

The one that works: the one-time pad #

Make the gamma as long as the message, truly random, and never reused, and the gamma cipher becomes the one-time pad. Shannon proved (1949) it has perfect secrecy: the ciphertext is statistically independent of the plaintext, so an attacker with unlimited compute learns nothing but the length. It is the only cipher with such a proof — and the proof also shows the price is unavoidable: perfect secrecy requires key material at least as long as all traffic, exchanged out of band. That makes OTP a logistics problem, not an engineering solution, which is why it guards hotlines, not HTTPS.

The two-time pad: the failure mode that never dies #

Reuse a pad once and perfect secrecy inverts into near-total compromise:

c1⊕c2=(p1⊕γ)⊕(p2⊕γ)=p1⊕p2c_1 \oplus c_2 = (p_1 \oplus \gamma) \oplus (p_2 \oplus \gamma) = p_1 \oplus p_2

The key drops out. The XOR of two natural-language plaintexts is highly redundant and yields to crib dragging — sliding a guessed word along p1⊕p2p_1 \oplus p_2 and checking whether the complement reads as language.

  1. 1940s Soviet OTP factory reuses pad pages under wartime pressure; the US Venona project exploits the reuse for decades, exposing the Rosenberg and Fuchs networks.
  2. 1997 Microsoft PPTP (MS-CHAPv1 era) uses the same RC4 keystream in both directions of a session — a literal two-time pad.
  3. 2001 WEP's 24-bit IV space guarantees keystream reuse within hours on a busy AP; related-key structure (FMS attack) finishes it off.
  4. 2016+ Nonce reuse in AES-GCM and ChaCha20-Poly1305 recreates the same algebra — keystream reuse plus, for GCM, recovery of the authentication key (the "forbidden attack", found live on ~184 HTTPS servers in 2016).

Source claims audit #

Seeded from a university lab manual (Caesar / Trithemius / gamma labs). Status of its load-bearing claims:

Claim from source Status Notes
Caesar encryption/decryption equations, affine generalization current Standard; keyspace argument unchanged
"Caesar is easily broken and has practically no use" current ROT13 survives as an obfuscation convention only
Trithemius worked example (k=3t+2k=3t+2, mod 34) current Recomputed and verified; presented above
Decryption-by-strips method as the practical attack on Caesar outdated Museum technique; frequency analysis / brute force is the real story
"Vigenère is a gamma cipher; gamma masks letter frequencies" current But the source omits Kasiski/IC — the ciphers are broken; added above
Gamma from a "pseudorandom sequence produced by a rule" is secure outdated True only for a true-random, message-length, never-reused pad (OTP); a short or linear rule is solvable from known plaintext

Sources

  1. bookApplied Cryptography, 2nd ed. (Schneier)
  2. paperCommunication Theory of Secrecy Systems (Shannon, 1949)
  3. docsVenona declassified materials (NSA)

Searches titles, aliases, headings, summaries, and full text.↑↓ move ↵ open esc close