Special Exhibit Β· The Science of Breaking Codes

Cryptanalysis Techniques

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

Ten approaches to classical cryptanalysis, with seven hands-on demonstrations. Success depends on the cipher, evidence, language, key and message length; no technique here defeats a correctly used one-time pad.

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

10 Techniques That Break Classical Ciphers

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

Long English samples often have frequencies near E=12.7%, T=9.1%, A=8.2%, with variation by text. A fixed one-to-one substitution preserves the sample’s counts while relabeling letters. Compare counts and sequences to propose mappings; frequency alone does not guarantee key recovery. Homophonic and syllabic systems need additional analysis.

A8.2BCDE12.7FGH6.1I7.0JKLMN6.7O7.5PQR6.0S6.3T9.1UVWXYZ% frequency in English textfixed substitution preserves sample counts; symbols change
English letter frequency distribution β€” the foundation of frequency analysis attacks.
Technique 02
Kasiski Examination
Friedrich Kasiski Β· 1863

In repeating-key Vigenère, the same plaintext at the same key phase produces the same ciphertext. Repeated ciphertext fragments can suggest key periods through factors of their spacing. Accidental repeats also occur, so candidate periods need further tests.

TRKOUIBNOERVOUIRNENREOUITNGTRKOUIBNOERVplainkeyciphersame plaintext + same key phase β†’ same ciphertextdistance 9 β†’ candidate periods 1, 3, 9; repeats may be accidental
Kasiski examination — repeated ciphertext sequences suggest candidate Vigenère periods.
Technique 03
Index of Coincidence
William Friedman Β· published 1922

Measures the probability that two distinct sampled positions contain the same letter. Long English samples often lie near 0.066; independent uniform A–Z text has expected IC 1/26 β‰ˆ 0.0385. These are reference values, not bounds: an observed IC can range from 0 to 1. Coincidence statistics can suggest repeating-key periods, but do not identify a cipher by themselves.

0.0667English0.0385randomreference IC12345678IC by assumed key lengthillustrative peaks at 3, 6 β€” test a period of 3reference value, not proof
Index of Coincidence β€” a statistical clue for investigating cipher families and repeating-key periods.
Vigenère Running Key Polyalphabetic
Technique 04
Crib-Based Cryptanalysis
Polish Mathematicians Β· WWII Bletchley

Cribs are hypotheses about plaintext, suggested by message formats, context or repeated phrases. Against Enigma, analysts tested those hypotheses against machine constraints and additional traffic. Known plaintext is an attack model that modern encryption must withstand; it is not automatically 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

Known plaintext can expose a classical cipher's key. For a 2Γ—2 Hill cipher, two matched plaintext/ciphertext blocks suffice when the plaintext-block matrix P is invertible modulo 26: gcd(det(P), 26) = 1. Otherwise, more observations or other analysis are needed. Enigma cribs impose different, rotor-machine constraints.

known plaintext PHILLits ciphertext CTCOZsolve C = KΒ·PK = CΒ·P⁻¹the keyKtwo matched blocks: gcd(det(P), 26) must equal 1here det(P) = βˆ’11, so K = CΒ·P⁻¹ exists modulo 26
Hill key recovery β€” HILL β†’ TCOZ yields K = [[3, 3], [2, 5]] because the plaintext-block matrix is invertible modulo 26.
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. Use multiple starting points to explore candidates. Such searches can attack substitution, Playfair and transposition, but may stall at local optima or favor incorrect plaintext.

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

Genetic algorithms explore populations of candidate keys; simulated annealing sometimes accepts worse-scoring moves. These methods can help attack classical ciphers, but time and success depend on the problem and settings. A high language score does not prove a correct plaintext.

worse move accepted while "hot"global best βœ“temperature cools β†’ downhill jumps become rarefitness
Simulated annealing β€” one possible escape from a local optimum; a finite run need not reach the global best.
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. Genevieve Grotjan’s September 1940 insight was a crucial step in the team’s reconstruction of the switch behavior. SIS built an analog machine, enabling decryption of Purple diplomatic messages. MAGIC was the wider intelligence product, not the name of this single attack.

Purple Stepping-switch machines
Technique 09
Computer-Assisted Manuscript Decipherment
Knight, Megyesi & Schaefer Β· USC ISI / Uppsala Β· 2011

Knight, Megyesi and Schaefer combined careful transcription, symbol statistics and linguistic reasoning to decipher Copiale. Their 2011 paper describes unsuccessful early automatic-decryption attempts, then progress after treating the Roman letters as spaces and grouping likely homophones. This was a combination of computation and human analysis, not an EM algorithm automatically discovering the answer. Original Copiale paper.

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

The disclosure of Byrne’s Chaocipher algorithm in 2010 made independent implementation and attack possible. Subsequent research studied known-plaintext and ciphertext-only attacks under specified conditions. Distinguish revealing an algorithm from recovering a secret starting state. Researchers’ record of attacks and solved exhibits.

⚑

Search speed depends on the problem: Short repeating keys and long, ordinary-language messages can be easy for automated solvers. Short texts, unusual vocabulary, layered ciphers and poorly chosen scoring models can remain difficult. The demonstrations here are examples, not measured performance guarantees.

Hands-On

Try the Techniques

Apply cryptanalysis tools to real ciphertext.

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

Letter Frequencies (gold = input, outline = English)

πŸ“œ

Al-Kindi’s surviving treatise describes frequency-based cryptanalysis. A monoalphabetic substitution preserves counts while relabeling symbols; polyalphabetic substitution changes that relationship, but need not make a short sample uniform. Language frequencies are evidence for hypotheses, not a guarantee of successful decryption.

Historical Record

12 Famous Codebreaks in History

Selected attacks and advances, with their evidence and limitations.

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

An early surviving systematic account of frequency analysis. Its effectiveness depends on the cipher and available text.

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

Babbage worked on attacks against repeating-key polyalphabetic ciphers but did not publish his method. Kasiski independently published an approach in 1863.

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

Kasiski published a method using repeated ciphertext groups to investigate the period of repeating-key polyalphabetic ciphers. Publication did not make every polyalphabetic system immediately readable.

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

Rejewski reconstructed military Enigma in 1932; Polish analysts subsequently developed several attacks and aids, including the bomba in 1938. Their July 1939 exchange with Britain and France shared methods and reconstructed machines.

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

Purple provided valuable Japanese diplomatic intelligence. It did not reveal a complete operational plan for the Pearl Harbor attack; diplomatic and naval communications used different systems.

1974 Β· 1990
DES and Differential Cryptanalysis
IBM & NSA Β· rediscovered by Eli Biham & Adi Shamir
Technique: Differential Cryptanalysis

IBM’s designers knew a form of differential cryptanalysis while developing DES and used it in selecting the S-boxes. Biham and Shamir later developed the technique publicly. Its effectiveness depends on the cipher and the available data.

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

Polish mathematicians reconstructed military Enigma before the war. Later Allied bombe machines used crib-derived constraints to eliminate settings. The intelligence contribution was substantial; a precise number of years removed from the war cannot be measured.

1941–1944
From the Lorenz Depth to Colossus
Bill Tutte Β· Tommy Flowers
Technique: Known Plaintext Β· Early Computer Search

Tiltman’s 1941 work and Tutte’s structural reconstruction preceded Colossus. The electronic machine became operational in February 1944 and accelerated statistical wheel-setting searches.

1943–80
VENONA: Reused Pad Material
US Army Signal Intelligence
Technique: Key Reuse Exploitation

Duplicated Soviet pad material enabled attacks on some traffic. Analysts also had to reconstruct codebook meanings; recovery was partial and often took years. VENONA’s success did not break the perfect-secrecy guarantee of a correctly used one-time pad.

1993
Linear Cryptanalysis vs DES
Mitsuru Matsui
Technique: Linear Cryptanalysis

Linear approximations enabled a statistical attack on DES under a large known-plaintext requirement. The often-cited 2⁴³ figure is a data requirement for a particular attack, not an unconditional reduction of all attack costs to 2⁴³.

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

Kocher described how data-dependent execution times can leak secret information from implementations, including RSA. Such attacks require suitable observations and vulnerable implementations; they do not solve the underlying factoring problem.

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

The SHAttered team produced two different PDFs with the same SHA-1 digest. This demonstrated a practical collision and reinforced a migration already underway; collision resistance and preimage resistance are different properties.

πŸ”

The Big Pattern: These cases combine mathematical analysis with operational evidence, protocol weaknesses and implementation behavior. Reused pad material, predictable plaintext and timing leakage create different attack opportunities. Predictable plaintext is not itself an error: modern encryption should protect it under the stated attack model.

From papers to inspectable evidence

Evidence Workbench Β· Copiale, Mary Stuart and Z340 investigations Β· Modern attack conditions

Reading the search score

George Lasry, A Methodology for the Cryptanalysis of Classical Ciphers with Search Metaheuristics (2018 published thesis), Β§Β§3.2.1–3.2.4, printed pp. 29–34 / PDF pp. 50–55, and Β§4.5, printed pp. 56–57 / PDF pp. 77–78, distinguishes objectives, selectivity and resilience to key errors. The small Caesar landscape above is an original teaching example; it does not reproduce the thesis’s large-key experiments.

Reading

Joshua Holden, The Mathematics of Secrets: Cryptography from Caesar Ciphers to Digital Encryption (2017 edition), chapter 2 and Β§Β§5.1–5.2; David Kahn, The Codebreakers: The Comprehensive History of Secret Communication from Ancient Times to the Internet (revised edition, 1996); Robert L. Benson, The VENONA Story (Center for Cryptologic History edition, 2001), pp. 1–3, 7 and 14–17. The demonstrations illustrate hypotheses and search rules, not guaranteed recoveries.