Purple (Type 97 jiki-O-bun-In-ji-ki)
Stepping switches instead of rotors — and an analog replica built from inference alone.
Why This Matters
Purple was Japan's highest-grade diplomatic cipher from 1939 through the end of World War II. The US Signals Intelligence Service broke it without ever seeing the machine, building an analog replica from intercept traffic alone — one of the most impressive feats in the history of cryptanalysis. The intelligence stream that resulted, codenamed MAGIC, shaped American strategy in the Pacific and exposed the diplomatic moves of Tokyo, Berlin, and Rome to Washington in near real time.
Purple replaced the older "Red" machine in 1939 for high-grade Japanese diplomatic traffic. Where Enigma used rotating wheels, the Japanese designers chose stepping switches — telephone-exchange relays that step to a new contact each cycle. Purple split each plaintext character into two streams: the six vowels (A, E, I, O, U, Y) went through one stepping-switch bank, and the twenty consonants went through three more. That asymmetric design was its defining feature and ultimately the structural seam that exposed it.
William Friedman recruited Frank Rowlett to lead the cryptanalytic attack. The team had no machine, no diagram, and no defector — only ciphertext. For 18 months they hunted patterns in stepping cycles. On the afternoon of September 20, 1940, junior cryptanalyst Genevieve Grotjan brought Rowlett a worksheet with a recurring alignment in the consonant alphabet. Within weeks, the SIS had constructed a working analog of Purple from inference alone.
The MAGIC intercepts read Tokyo's instructions to its Washington embassy in the days before Pearl Harbor. The intelligence existed; the failure to act on it was bureaucratic, not cryptanalytic.
The pedagogical demo on this page faithfully reproduces Purple's structural design, not its full electrical wiring. The interactive engine implements:
- Split the input alphabet into a 6-letter vowel set and a 20-letter consonant set.
- Apply a stepping permutation to each set, advanced by an internal counter.
- Re-merge the encrypted vowels and consonants into the output stream in the original positions.
- Step the switch positions according to a daily key.
The actual 1940 machine used three stepping switches for the consonant bank wired in series, with carry-over advancement triggered by completed cycles — closer in spirit to a digital odometer than a rotor. The SIS analog used the same partition but standard rotary switches, since stepping relays were scarce in the US.
Rowlett's team treated the consonant bank's stepping cycle as the leverage point. By tabulating which ciphertext letters appeared in which positions across many intercepts, they reconstructed the stepping behavior without ever observing the hardware. The vowel bank, with only six letters, fell first — providing partial cribs that constrained the larger consonant problem.
On a worksheet aligning intercept plaintext-ciphertext pairs across repeated daily keys, Grotjan identified a recurring relationship in the consonant alphabet — the alignment that revealed how the consonant bank's stepping switches were wired. Rowlett later called it "one of the great breaks of the war."
Why it failed fundamentally: Treating vowels and consonants as separate sub-ciphers halved the effective keyspace and produced statistically distinguishable streams. Any modern design would feed the entire alphabet through a single, uniform permutation precisely to avoid this kind of structural seam.
| Concept from Purple | Modern Evolution |
|---|---|
| Stepping-switch keystream | Linear feedback shift register (LFSR) stream ciphers |
| Per-character-class subcipher | Cautionary anti-pattern — modern ciphers treat all bits uniformly |
| Daily key-sheet rotation | Modern key rotation policies (TLS session keys, signal protocol ratchets) |
| Reconstruction from traffic alone | Modern side-channel and known-ciphertext attack research |
The principle Purple violated — uniform treatment of all input symbols — is enforced explicitly in modern designs like the AES S-box, which applies the same nonlinear transformation to every byte regardless of value or position.
| Exhibit | 52 of 52 |
| Era | World War II · 1939–1945 |
| Status | Broken (1940) |
| Inventor | Japanese Foreign Ministry (Type 97) |
| Year | 1937 (deployed) · 1939 (replaced Red) |
| Key Type | Stepping-switch banks + daily key sheet |
| Broken By | Rowlett, Grotjan & the US SIS |
| Modern Lesson | Avoid per-class sub-ciphers |
- Frank B. Rowlett, The Story of Magic: Memoirs of an American Cryptologic Pioneer (Aegean Park Press, 1998).
- National Security Agency Center for Cryptologic History, The Friedman Legacy: A Tribute to William and Elizebeth Friedman (NSA, 2006).
- Stephen Budiansky, Battle of Wits: The Complete Story of Codebreaking in World War II (Free Press, 2000), ch. 5–6 on Purple and MAGIC.