Skip to content

Codename PURPLE: The Cipher America Broke — and Why It Didn’t Stop Pearl Harbor

On December 7, 1941, cryptanalysts at the U.S. Army’s Signal Intelligence Service (SIS) in Washington had Tokyo’s final note to its ambassador in Washington in hand before the embassy staff themselves did — before the embassy’s own staff had even finished decrypting and typing it up. The extraordinary intelligence edge that made this possible came from a Japanese Foreign Ministry cipher machine the United States had codenamed “PURPLE.” Yet that same day, a surprise attack struck Pearl Harbor, Hawaii. If the cipher had been broken, why wasn’t the attack stopped? Answering that question requires first establishing exactly what PURPLE covered — and, just as importantly, what it did not.

Background — From RED to PURPLE

The machine the Japanese Foreign Ministry actually fielded was officially named the “97-shiki Ōbun Injiki” (Type 97 Alphabetical Typewriter, literally “Type 97 Printing Machine for European-Language Text”), recorded in Allied documents as the “Type B Cipher Machine.” “PURPLE” was simply the nickname American cryptanalysts gave to the ciphertext this machine produced. According to the NSA National Cryptologic Museum’s official account, the name traces not to any Japanese designation but to the color of the binders in which American analysts filed their decryption results.

PURPLE succeeded the earlier “RED” (Type 91) cipher machine. RED carried a structural weakness: it split the 26 letters of the alphabet into a fixed group of six vowels (A, E, I, O, U, Y) and twenty consonants and enciphered each group differently — and PURPLE inherited a great deal of that same six-letter/twenty-letter split. What changed was that the six-letter grouping was now rotated every nine days, an attempt to shore up security. Engineers from Japan’s Ministry of Communications are known to have taken part in the design, and one account credits a member of that team with proposing that RED’s troublesome half-rotor switches be replaced with “stepping switches” borrowed from telephone-exchange equipment (though sourcing on this particular designer is comparatively thin, and the claim would benefit from further cross-checking).

A surviving fragment of a Type 97 Alphabetical Typewriter (PURPLE) on display. The U.S. rebuilt this machine from first principles, without ever seeing the original.
A surviving fragment of a Type 97 Alphabetical Typewriter (PURPLE) on display. The U.S. rebuilt this machine from first principles, without ever seeing the original. Photo: United States Government · Public domain · Source Wikimedia Commons

How It Worked — A Telephone-Exchange Part Becomes a Cipher Machine

PURPLE’s most distinctive feature was that, instead of the rotor mechanisms other nations favored at the time, it built its encryption around a component standard in telephone exchanges: the “stepping switch” (uniselector). The machine Japan actually used consisted of three seven-layer stepping switches; the analog machine the U.S. Army later reconstructed — having never once seen the original — used four six-level switches instead. This approach, so unlike rotor-based ciphers, initially left American analysts baffled.

Encyclopaedia Britannica describes PURPLE as “the most difficult Japanese cipher to break,” noting it was used for diplomatic message traffic from 1939 to 1945. Reverse-engineering the machine’s inner workings from ciphertext alone — with no cribs, no known plaintext-ciphertext pairs, nothing but the encrypted messages themselves — is regarded as one of the great tours de force in twentieth-century cryptanalysis.

The Break — Grotjan’s Breakthrough

The U.S. Army’s SIS began intercepting PURPLE traffic around 1938, but the concentrated push to break it did not begin until August 1939, when a team led by William F. Friedman took the problem on in earnest. SIS had already broken much of the RED cipher, but after the switch to PURPLE it went effectively dark on Tokyo’s diplomatic traffic for roughly eighteen months.

The team working the problem included, besides Friedman, Frank Rowlett, Robert Ferner, Albert Small, and MIT-trained Leo Rosen, who is credited with devising a device that helped accelerate the decryption effort. Then, on September 20, 1940, statistician Genevieve Grotjan spotted a recurring cyclical pattern buried in the ciphertext — the breakthrough the team had been searching for. Within a week of her discovery, on September 27, the team handed Friedman two fully decrypted PURPLE messages.

What came next was even more remarkable. SIS had never laid eyes on an actual Japanese machine, yet by the end of 1940 it had built an “analog” machine that reproduced how PURPLE worked. Six such reconstructions were eventually built and fielded — by the U.S. Army and Navy, and, starting in January 1941, in Britain, the Philippines, Singapore, India, and Hawaii as well. Friedman himself never credited the achievement to any single person, calling it instead “the product of eighteen months of concentrated study” and a genuinely collaborative effort — “no one of these men,” he said, “can be picked out as being responsible for the major part of the success.”

William F. Friedman, who led the U.S. Army Signal Intelligence Service (SIS) team that broke PURPLE.
William F. Friedman, who led the U.S. Army Signal Intelligence Service (SIS) team that broke PURPLE. Photo: Unknown · Public domain · Source Wikimedia Commons

What PURPLE Actually Had to Do With Pearl Harbor

This is where the story turns — and where it is most often misread. PURPLE was a cipher machine dedicated exclusively to “diplomatic” communications: traffic between the Japanese Foreign Ministry in Tokyo and its missions abroad, in Washington, London, Moscow, Berlin, and elsewhere. The Japanese Navy, by contrast, used an entirely separate family of ciphers — JN-25 and others — for its own communications. As the American Institute of Physics (AIP) puts it: “The U.S. could read only some of the diplomatic ciphers, and none of the military communications.” In other words, breaking PURPLE and Japan’s military operational communications belonged to two entirely different worlds from the outset.

What’s more, the Japanese carrier strike force en route to Pearl Harbor maintained total radio silence for the entire voyage along the northern Pacific route to Hawaii. AIP sums this up in three words: “Purple heard nothing.” No matter how completely PURPLE had been broken, there was simply no “military operational communications” for it to intercept in the first place.

None of this means PURPLE yielded the United States nothing at all. On December 6 and 7, 1941, the U.S. decrypted Tokyo’s so-called “14-Part Message” to its Washington embassy — the note announcing the breakdown of negotiations — before the embassy’s own staff had finished decoding and typing it themselves, having it in hand before 1:00 p.m. Washington time on December 7. But this was a diplomatic document announcing the collapse of talks and the severing of relations; it contained no specific target, no date, no coordinates for any attack on Pearl Harbor. What the PURPLE intercepts revealed was only the general shape of an approaching crisis — that negotiations were breaking down, that the embassy had been ordered to destroy its cipher machines and documents — not where, when, or how any attack would come. Japan’s military command had not even briefed the Foreign Ministry or its own embassies on the Pearl Harbor plan, so no amount of diplomatic decryption, however perfect, could have leaked a military secret that had never been placed inside that channel to begin with.

This is also borne out in the testimony of George C. Marshall, the U.S. Army Chief of Staff at the time. At the 1944 congressional hearings on Pearl Harbor, he stated that the U.S. had anticipated Japanese movement toward French Indochina, the Gulf of Siam, and the Malay Peninsula, and an attack on the Philippines — but “We did not…anticipate an attack on Hawaii,” because Hawaii’s defenses were strong enough that attacking it was judged “an extremely dangerous gamble.” In short: the fact that the United States broke Japan’s PURPLE diplomatic cipher, and the claim that the United States knew in advance that Pearl Harbor would be attacked, are two entirely different statements. The first is true. The second runs against the contemporaneous record.

MAGIC and PURPLE — Two Names Easily Confused

Another concept that popular accounts of PURPLE often blur together with it is “MAGIC.” MAGIC was the umbrella codename for the whole of the Japan-related cryptographic intelligence the United States gathered — not just the diplomatic traffic decrypted via PURPLE, but intercepts of naval ciphers such as JN-25 as well. MAGIC, in other words, was the larger category that contained PURPLE, and treating the two as identical is inaccurate. The April 1943 operation that shot down the aircraft carrying Admiral Isoroku Yamamoto, commander-in-chief of Japan’s Combined Fleet, is commonly described as a MAGIC success — but the consensus view is that it stemmed not from PURPLE, the diplomatic cipher, but from the interception and decryption of the JN-25 naval cipher. Accounts that draw a direct line between PURPLE’s achievements and the Yamamoto shoot-down blur this distinction and should be read with caution.

SIS servicewomen operating a PURPLE analog reconstruction machine.
SIS servicewomen operating a PURPLE analog reconstruction machine. Photo: US Army photographer · Public domain · Source Wikimedia Commons

Legacy

Intelligence drawn from PURPLE decrypts genuinely shaped American policy in meaningful ways — gauging the temperature of diplomatic tensions, learning in advance the final terms and deadlines Japan intended to bring to the negotiating table, and catching the Japanese embassy in Washington stalling and dissembling during talks. But as established above, this was material for diplomatic judgment, not military-operational secrets.

One striking fact is that Japan never realized, right up to the end of the war, that the United States had broken PURPLE. That Japan had no idea its top diplomatic cipher had been compromised is well documented across multiple sources. But it would distort the causal chain to leap from that fact straight to the conclusion that “Japan let its guard down, and that’s why Pearl Harbor happened.” As established above, the fundamental reason the Pearl Harbor attack could succeed was that Japan’s operational military plans simply never fell within the range of communications PURPLE was in a position to intercept. That a cipher was broken and that a surprise attack succeeded are events on two entirely different levels.

The breaking of PURPLE remained classified for decades after the war and is still regarded today as one of the towering achievements in the history of American cryptanalysis. The NSA National Cryptologic Museum displays the only surviving fragment of an actual PURPLE machine, honoring it under the title “The Magic of Purple.” Built not from rotors but from telephone-exchange parts, reconstructed from ciphertext analysis alone without anyone on the American side ever laying eyes on the original — the episode stands as a monument to how far human logical reasoning can penetrate the secrets of an intricate machine.

Close-up of the wiring on a PURPLE reconstruction machine displayed at the National Cryptologic Museum.
Close-up of the wiring on a PURPLE reconstruction machine displayed at the National Cryptologic Museum. Photo: ArnoldReinhold · CC BY-SA 4.0 · Source Wikimedia Commons

References

  • NSA National Cryptologic Museum, “The Magic of Purple” (official exhibit material) — https://www.nsa.gov/History/National-Cryptologic-Museum/Exhibits-Artifacts/Exhibit-View/Article/2718925/the-magic-of-purple/
  • Wikipedia, “Type B Cipher Machine” — https://en.wikipedia.org/wiki/Type_B_Cipher_Machine
  • George C. Marshall Foundation, “Breaking Purple in William Friedman’s own words” — https://www.marshallfoundation.org/articles-and-features/breaking-purple-in-william-friedmans-own-words/
  • George C. Marshall Foundation, “Marshall, PURPLE and Pearl Harbor” — https://www.marshallfoundation.org/articles-and-features/marshall-purple-pearl-harbor/
  • DVIDS (official U.S. Department of Defense distribution channel), “SIS Makes Breakthrough Against Japanese Code (20 SEP 1940)” — https://www.dvidshub.net/news/454045/sis-makes-breakthrough-against-japanese-code-20-sep-1940
  • American Institute of Physics, Inside Science, “Decrypting the Japanese Cipher Couldn’t Prevent Pearl Harbor” — https://www.aip.org/inside-science/decrypting-the-japanese-cipher-couldnt-prevent-pearl-harbor
  • Pacific Historic Parks (affiliated with the Pearl Harbor National Memorial), “Cryptologists, the Purple Machine, and Pearl Harbor” — https://pearlharbor.org/blog/cryptologists-purple-machine-pearl-harbor/
  • Encyclopaedia Britannica, “Purple | intelligence device” — https://www.britannica.com/topic/Purple
  • Encyclopedia.com, “Operation Magic” — https://www.encyclopedia.com/politics/encyclopedias-almanacs-transcripts-and-maps/operation-magic

Leave a Reply