Special Exhibit Β· The Science of Breaking Codes

Cryptanalysis Techniques

"To know how to defend, you must first know how to attack."

Ten techniques that break almost every classical cipher in this museum β€” from Al-Kindi's frequency tables (850 AD) to modern hill-climbing algorithms.

Open Codebreaker's Workbench β†’ Open Cipher Detective β†’
The Toolkit

10 Techniques That Break Classical Ciphers

Technique 01
Frequency Analysis
Al-Kindi Β· Baghdad Β· ~850 AD

Languages have predictable letter frequencies. In English, E=12.7%, T=9.1%, A=8.2%. Any cipher that maps one letter to one symbol preserves these frequencies. Count the symbols, compare to known frequencies, recover the key.

A8.2BCDE12.7FGH6.1I7.0JKLMN6.7O7.5PQR6.0S6.3T9.1UVWXYZ% frequency in English textE dominates β€” any 1-to-1 substitution inherits this skyline
English letter frequency distribution β€” the foundation of frequency analysis attacks.
Technique 02
Kasiski Examination
Friedrich Kasiski Β· 1863

In a Vigenère cipher, the same plaintext + same key position = same ciphertext. Identical repeated strings in the ciphertext reveal probable key length. Their spacing is likely a multiple of the key length.

TRKOUIBNOERVOUIRNENREOUITNGTRKOUIBNOERVplainkeyciphersame plaintext + same key phase β†’ same ciphertextdistance = 9 = 3 Γ— 3 β†’ key length divides 9 β†’ try 3
Kasiski examination — finding repeated ciphertext sequences to determine Vigenère key length.
Technique 03
Index of Coincidence
William Friedman Β· 1920

Measures statistical similarity to natural language. English text has an IC of ~0.066. Random text has ~0.038. A polyalphabetic cipher produces values between these β€” and the IC can reveal the key length without finding repeated strings.

0.0667English0.0385randomreference IC12345678IC by assumed key lengthpeaks at 3, 6 β€” multiples of the true key length0.066 reads as language
Index of Coincidence β€” measuring statistical deviation from random to determine cipher type and key length.
Vigenère Running Key Polyalphabetic
Technique 04
Crib-Based Cryptanalysis
Polish Mathematicians Β· WWII Bletchley

Guess probable plaintext words called "cribs" β€” military messages often start with standard phrases. The Enigma was broken partly because operators always began with WETTER (weather), HEIL HITLER, or ANX (a header). Known structure is a fatal weakness.

JXATQBGGYWCRYBcipherWETTT = TERβœ— offset 0 rejected β€” T would encrypt to itself, and Enigma never doesWETTERβœ“ offset 2 survives β€” no letter meets itself; a legal alignmenteach surviving offset becomes a bombe menu to test
Crib-based cryptanalysis β€” exploiting predictable message headers and standard phrases to break machine ciphers.
Technique 05
Known Plaintext Attack
Universal Β· Classical through Modern

When some plaintext is known, the key can often be derived directly. The Hill cipher's matrix key is recoverable with just two known plaintext-ciphertext pairs by solving a system of linear equations. Enigma used weather forecasts as cribs.

known plaintext PHILLits ciphertext CAPATsolve C = KΒ·PK = CΒ·P⁻¹the keyKtwo matched pairs give the Hill matrix by linear algebra β€”the recovered key then opens every other message
Known plaintext attack β€” using matched plaintext-ciphertext pairs to recover the encryption key.
Technique 06
Hill Climbing Search
Modern Β· Computer Era

Start with a random key. Decrypt. Score the result using English language statistics β€” common digrams like TH, HE, IN. Make random changes to the key. Keep improvements, discard downgrades. Repeat millions of times. Works against substitution, Playfair, transposition.

stuck: every single swap scores worseglobal best β€” never reachedkey space, one small change per step β†’fitness (English-ness of the decrypt)
Hill climbing search β€” iteratively refining key guesses by scoring decrypted output against English language statistics.
Substitution Playfair Transposition
Technique 07
Simulated Annealing / Genetic Algorithms
Modern Β· AI-Assisted

Advanced optimization heuristics that explore key space more broadly than pure hill climbing. Genetic algorithms evolve populations of candidate keys. Simulated annealing occasionally accepts worse solutions to escape local optima. Breaks double transposition and Playfair in seconds; cracks small Hill keys too, though Hill's canonical break is the known-plaintext attack above.

worse move accepted while "hot"global best βœ“temperature cools β†’ downhill jumps become rarefitness
Simulated annealing β€” escaping local optima to find the global best key through controlled randomness.
Technique 08
Stepping-Switch Cryptanalysis
Frank Rowlett & Genevieve Grotjan Β· SIS Β· 1939–1940

Japan's Purple machine routed plaintext through banks of telephone-style stepping switches rather than rotors. The US Signals Intelligence Service had no machine to study, so they hunted statistical regularities in intercept traffic β€” looking for cycles in how the switches advanced. On September 20, 1940, Genevieve Grotjan spotted the alignment that revealed the wiring of the consonant bank, letting Rowlett's team build an analog replica from inference alone. The result was MAGIC, the intelligence stream that read Japanese diplomatic traffic before Pearl Harbor.

Purple Stepping-switch machines
Technique 09
HMM & Statistical MT Decoding
Knight, Megyesi & Schaefer Β· USC ISI / Uppsala Β· 2011

When a 250-year-old homophonic cipher resists every manual attack, treat it as a translation problem. Kevin Knight and his collaborators modeled the Copiale manuscript's symbol stream with a hidden Markov model trained on German n-grams, then applied expectation-maximization to align symbols to phonemes. After several false starts (including the wrong source language), the EM algorithm converged on German β€” and the Copiale Order's initiation ritual emerged. The first major historical cipher broken by computational linguistics.

Technique 10
Chaocipher Reconstruction
Moshe Rubin & George Lasry Β· 2010–2014

John F. Byrne's Chaocipher (1918) survived 92 years because its dynamic-permutation rule was kept secret. When the family donated his papers to the National Cryptologic Museum in 2010, Moshe Rubin reconstructed the algorithm from the worked examples. George Lasry later confirmed that with sufficient ciphertext (a few hundred characters of crib), simulated annealing on the two starting alphabets recovers the key β€” proving the cipher is not unbreakable, only secret.

⚑

Speed comparison: A Vigenère with a 5-letter key that took weeks in the 1800s is cracked in under one second today. Monoalphabetic substitution falls in milliseconds.

Hands-On

Try the Techniques

Apply cryptanalysis tools to real ciphertext.

IC = Ξ£ ni(niβˆ’1) / N(Nβˆ’1)  Β·  β€”

Letter Frequencies (gold = input, outline = English)

πŸ“œ

Frequency analysis is the oldest known cryptanalytic technique, formally described by the 9th-century Arab polymath Al-Kindi in his Manuscript on Deciphering Cryptographic Messages (c. 850 AD). It exploits the fact that monoalphabetic substitution ciphers preserve letter frequency — the cipher just relabels each letter, but a frequent letter in the plaintext stays frequent in the ciphertext. This is why every cipher invented after Vigenère had to break this property: a polyalphabetic key flattens the frequency distribution, denying the analyst the very pattern Al-Kindi discovered.

Historical Record

12 Famous Codebreaks in History

The moments that changed wars, toppled spies, and birthed the computer.

850 AD
Al-Kindi Breaks Substitution
Al-Kindi Β· Baghdad
Technique: Frequency Analysis

First documented scientific cryptanalysis. Introduced statistical analysis to codebreaking. Every cipher for the next 400 years was vulnerable.

1850s
Babbage Breaks Vigenère
Charles Babbage
Technique: Repeating Sequence Analysis

Ended the myth of the "indecipherable cipher." Babbage kept his method secret; Kasiski published it in 1863 and received the credit.

1863
Kasiski Publishes the Method
Friedrich Kasiski
Technique: Pattern Repetition Analysis

First widely published method for breaking polyalphabetic ciphers. European diplomatic Vigenère systems collapsed.

1932
Polish Mathematicians Break Enigma
Rejewski, RΓ³ΕΌycki, Zygalski Β· Warsaw
Technique: Permutation Analysis Β· Known Plaintext

Created the first Enigma-breaking machines. Passed their work to Britain and France just before WWII began β€” giving Bletchley Park a head start.

1940
US SIS Breaks Japanese Purple
Friedman's SIS team Β· Grotjan's insight Β· Washington DC
Technique: Statistical Analysis Β· Machine Reconstruction

The US could read Japanese diplomatic traffic before Pearl Harbor. The diplomatic warning was there β€” the military intelligence chain failed to act on it.

1974 Β· 1990
DES Hardened Against an Attack Nobody Could Name
IBM & NSA Β· rediscovered by Eli Biham & Adi Shamir
Technique: Differential Cryptanalysis

IBM's designers quietly hardened the DES S-boxes against a technique they were forbidden to describe. Sixteen years later Biham and Shamir rediscovered differential cryptanalysis in the open β€” and the unexplained design choices suddenly made sense. It reshaped how every cipher since has been designed and judged.

WWII
Bletchley Park Breaks Enigma
Alan Turing Β· Gordon Welchman
Technique: Crib Attacks Β· Electromechanical Bombe

Shortened WWII by an estimated 2–4 years. The Bombe machine tested thousands of possible Enigma settings per minute, exploiting known plaintext cribs.

1943
Lorenz Cipher Broken with Colossus
Bill Tutte Β· Tommy Flowers
Technique: Known Plaintext Β· Early Computer Search

Led to the creation of Colossus β€” the world's first programmable electronic computer. The direct ancestor of modern computing was built to break a cipher.

1943–80
VENONA: Soviet OTP Cracked
US Army Signal Intelligence
Technique: Key Reuse Exploitation

Soviet operators reused one-time pad key material under wartime pressure. VENONA decoded thousands of messages and exposed Julius Rosenberg and other Soviet spies in the US.

1993
Linear Cryptanalysis vs DES
Mitsuru Matsui
Technique: Linear Cryptanalysis

Found linear approximations of DES S-box operations, reducing the work to break DES from 2⁡⁢ to 2⁴³. Accelerated the case for replacing DES with AES.

1996
RSA Timing Attack
Paul Kocher
Technique: Side-Channel Timing Analysis

Broke RSA implementations by measuring how long decryption took. The math was fine β€” the implementation leaked secrets through time. Side-channel security became a new discipline.

2017
SHA-1 Collision (SHAttered)
Google Β· CWI Institute
Technique: Collision Attack

Produced two different PDF files with the same SHA-1 hash. Forced the entire internet to migrate from SHA-1 to SHA-256 and SHA-3. Cryptographic hash functions are not forever.

πŸ”

The Big Pattern: Most famous codebreaks succeeded not from pure mathematics, but from human mistakes (reused OTP keys, predictable message headers), protocol flaws (Enigma operators sending the same message twice), and implementation errors (RSA timing leaks). The math is often the last thing that fails. This is as true today as in Caesar's time.