Purple (97-shiki ōbun injiki)
Stepping switches instead of rotors — and an analog replica built from inference alone.
Frank Rowlett, Genevieve Grotjan & the US SIS · 20 September 1940
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 Red for important Japanese diplomatic traffic in 1939. It used telephone-type stepping switches rather than Enigma-style rotors. Its wiring separated six electrical paths from twenty others. With the external alphabet connections, these groups need not correspond to vowels and consonants; “sixes” and “twenties” are the more precise names.
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.
MAGIC revealed diplomatic instructions before Pearl Harbor, including the breakdown in negotiations. Those messages did not disclose the Pearl Harbor attack plan or its target. Reading diplomatic traffic was not the same as reading every Japanese operational order.
This pedagogical demo is a simplified split-alphabet stepping model, not a faithful reconstruction of Purple’s wiring, alphabet connections or switch movement. It 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 historical machine used one switch for the sixes and three in series for the twenties. The latter had designated fast, medium and slow roles and an irregular stepping rule. This is not an ordinary odometer, and the widget’s simple counter does not reproduce it.
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."
Structural lesson: The sixes/twenties separation gave analysts an important foothold. It does not follow that the effective keyspace was simply halved. Recovering Purple required a combination of traffic, repeated patterns, painstaking analysis and machine reconstruction.
| 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 |
Modern cipher security is assessed through the complete construction and its attack model. Merely applying one substitution to every input byte is insufficient: a fixed substitution still preserves frequency information.
| Exhibit | 52 of 169 |
| 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.