The Purple machine was Japan's high-grade diplomatic cipher system during World War II, and its defeat was one of the most important American cryptanalytic achievements before Pearl Harbor. Japan called it the Type B Cipher Machine. U.S. Army cryptanalysts called it PURPLE. The intelligence produced from its decrypts was protected under the codeword MAGIC. Those 3 names describe different parts of the same story: a Japanese Foreign Ministry machine, an American codebreaking target, and a tightly controlled stream of diplomatic intelligence.
This article explains how the Purple machine worked, why it was harder than ordinary substitution ciphers, how the U.S. Signal Intelligence Service reconstructed its behavior without seeing the machine, and what its limitations teach modern students of cryptography. For hands-on comparison while reading, keep the substitution cipher tool, frequency analysis tool, and Enigma machine simulator open. The Enigma machine guide, Alan Turing cryptography article, and cryptography glossary give useful background for terms such as crib, key, ciphertext, and cryptanalysis.
TL;DR
- Purple was Japan's Type B diplomatic cipher machine, introduced for major posts in 1939.
- It split 26 letters into a 6-letter group and a 20-letter group.
- U.S. cryptanalysts solved it by exploiting cribs, traffic overlap, and machine reconstruction.
- MAGIC decrypts helped U.S. leaders read Japanese diplomatic strategy before Pearl Harbor.
- Purple was a diplomatic system, not the main Japanese naval code that signaled fleet operations.
What Was the Purple Machine?
The Purple machine was an electromechanical encryption machine used by the Japanese Foreign Ministry for sensitive diplomatic traffic. A cipher machine is a device that applies a repeatable encryption process to plaintext so the receiver can reverse it with the correct settings. A diplomatic cipher is a system designed for embassies, ministries, and political reporting rather than battlefield units. Cryptanalysis is the practice of recovering hidden information from a cipher without being the intended recipient.
The public technical name most often used today is the Type B Cipher Machine. It replaced the earlier Type A machine, which American cryptanalysts had nicknamed RED. The National Security Agency's history page on Red and Purple states that Japan introduced the Type B equipment in February 1939 and that U.S. Army cryptanalysts nicknamed it PURPLE.
Unlike the German Enigma machine, Purple did not use rotors in the familiar Enigma sense. It relied on telephone stepping switches and wiring patterns that produced changing substitutions. That design matters because many popular summaries wrongly describe every World War II cipher machine as a rotor machine. Purple belongs in the same broad family of machine cryptography, but its internal mechanics were different enough that the attack path was different too.
Purple is a good reminder that machine cryptography did not have one standard shape in the 1940s. Enigma used moving electrical rotor paths; Purple used a 6-and-20 split plus stepping-switch behavior that had to be reconstructed from traffic.
Why Japan Needed a High-Grade Diplomatic Cipher
Japan's diplomatic network needed secure long-distance communication among Tokyo, Washington, London, Moscow, Berlin, and other important posts. Diplomatic messages contained negotiation strategy, reports from ambassadors, military-political assessments, and instructions from the Foreign Ministry. In the late 1930s, that information had direct strategic value because Japan's relationships with the United States, Britain, Germany, Italy, China, and the Soviet Union were all unstable.
The older RED machine had already given American cryptanalysts valuable access. Once Japan moved its most important diplomatic circuits toward Purple, U.S. analysts had to solve a stronger target. The transition was not perfectly clean. Some posts still used RED, some used PURPLE, and some communications overlapped. That operational overlap later gave cryptanalysts the kind of repeated content and predictable openings that classical analysts call cribs.
A crib is a guessed or known piece of plaintext used to attack a ciphertext. Cribs can come from greetings, message forms, repeated diplomatic formulas, retransmissions, or the same message sent through two different systems. The NSA exhibit on The Magic of Purple explains that, for a brief period, Japan used Red and Purple on some diplomatic circuits, giving American analysts useful clues.
How the Purple Cipher Worked at a High Level
Purple operated on the 26-letter English alphabet used for telegraphy. Japanese-language content had to be transliterated, coded, or otherwise expressed for transmission. The crucial structural feature was the split between 6 letters and 20 letters. The machine treated one group of 6 letters differently from the other group of 20 letters, and that separation became a major weakness once analysts recognized it.
The sixes group used a smaller substitution structure, while the twenties group went through a more complex chain. In simplified terms, Purple did not transform all 26 letters uniformly through one moving alphabet. It divided the alphabet, applied separate mechanisms, and produced a changing substitution across the message. That is already far beyond the Caesar cipher, where every letter is shifted by one fixed number.
The 6-and-20 split also made Purple different from a normal monoalphabetic substitution. If you paste a long simple substitution message into the frequency analysis tool, language patterns remain visible because the same plaintext letter always maps to the same ciphertext letter. Purple changed mappings as the machine stepped, so simple single-letter counts were not enough. The analysts needed to understand the machine's state changes and wiring behavior.
That said, Purple was not a modern secure cipher. It was an electromechanical system with a hidden design, daily settings, operator procedures, and repeated diplomatic formats. Its security relied heavily on the enemy not learning the machine behavior. Once enough traffic accumulated, the machine's hidden regularities became measurable.
Purple Compared With Other WWII Cipher Systems
Purple is easiest to understand when compared with neighboring systems. It was more complex than hand ciphers and simpler than modern digital encryption. It was also aimed at a different communication problem than battlefield voice codes or naval fleet codes.
| System | Primary user | Core mechanism | Main weakness exploited | Best learning tool here |
|---|---|---|---|---|
| Purple / Type B | Japanese Foreign Ministry | Stepping-switch machine with 6-and-20 letter split | Cribs, traffic overlap, structural split, key procedures | Machine-cipher comparison |
| RED / Type A | Japanese diplomatic posts | Earlier Japanese machine system | Known structure and overlap with later Purple traffic | Substitution concepts |
| Enigma | German military and services | Rotors, reflector, plugboard, daily keys | Cribs, procedures, no self-encipherment, traffic depth | Enigma simulator |
| Navajo Code Talkers | U.S. Marine Corps | Spoken code layered on Navajo language | Not practically broken in wartime tactical use | Navajo code guide |
| Vigenere | Historical manual users | Repeated-key polyalphabetic substitution | Kasiski examination and column frequency analysis | Vigenere tool |
| Modern AES-style encryption | Digital systems | Published algorithm with large binary keys | Implementation, key management, protocol mistakes | Hashing contrast |
The comparison shows why "World War II cipher machine" is too broad a category. Purple, Enigma, Typex, SIGABA, and other systems all used machinery, but each had its own logic. Cryptanalysis depends on the exact rules of the target system, not on the fact that it has keys, lamps, switches, or a keyboard.
Who Broke Purple?
Purple was broken by the U.S. Army's Signal Intelligence Service, usually abbreviated SIS. William F. Friedman directed the overall effort. Frank Rowlett led much of the day-to-day work. Genevieve Grotjan made a crucial pattern discovery in September 1940. Leo Rosen built the electrical analog that allowed faster decryption once the machine behavior was understood. Albert Small, Samuel Snyder, and other cryptanalysts also contributed.
The NSA's Red and Purple history emphasizes that the solution was a team effort under Friedman's direction, with Rowlett handling day-to-day efforts and Grotjan, Small, and Snyder making important contributions. That detail matters because cryptography history is often flattened into one hero. Purple was not solved by one flash of genius. It was solved through years of traffic collection, RED experience, statistical pattern recognition, engineering, and disciplined secrecy.
The most striking fact is that the Americans solved Purple without first possessing a Japanese Purple machine. They inferred the behavior from intercepted messages and then built their own analog. That is a deeper achievement than stealing a key table. It meant the analysts had reconstructed the process well enough to imitate it electrically.
The Purple break was not just decryption. It was reverse engineering from ciphertext at national scale: infer the wiring logic, build an analog, test it against traffic, and turn analysis into daily production.
How Analysts Found the 6-and-20 Split
The first major clue was that six letters behaved differently from the other twenty. In the older RED system, analysts had already seen a related separation. When Purple appeared, that earlier experience gave them a hypothesis: perhaps the new system retained a similar split, even if the rest of the mechanism was more difficult.
Friedman's declassified Preliminary Historical Report on the Solution of the "B" Machine describes early evidence that six of the 26 letters appeared with abnormal behavior and that the B-machine retained a division into two letter categories. That did not solve the system by itself, but it reduced the unknown problem. Instead of one opaque 26-letter machine, analysts could study two linked subproblems.
This is a classic cryptanalytic move: find structure before trying to recover exact keys. A beginner attacking the Vigenere cipher does something similar by estimating key length before solving each Caesar-like column. In Purple, the stakes and machinery were much larger, but the mental habit was familiar: segment the problem into parts that leak different evidence.
Once the sixes could be separated, analysts still faced the harder twenties. The NSA exhibit notes that the sixes were important but not enough, and that by September 1940 the team knew enough to uncover the general patterns needed for the remaining 20 letters. The machine analog then converted fragile analytical insight into a repeatable decryption workflow.
What Was the Purple Analog?
The Purple analog was the American-built device that reproduced the behavior of Japan's Type B machine closely enough to decrypt traffic. It was not a captured Japanese machine. It was a functional reconstruction built from analysis. Leo Rosen's engineering contribution was central because manual analysis could identify patterns, but a practical intelligence service needed repeatable daily processing.
The analog used telephone stepping-switch technology. The NSA exhibit recounts Rosen noticing a "uniselector" in an electrical supply catalog and using stepping switches to build the prototype. The final analog connected sections through hundreds of wires, making the inferred cryptanalytic model into a working machine.
This is where Purple becomes especially relevant to modern security work. A break is not operationally valuable until it can be repeated under time pressure. A beautiful solution in a notebook may prove the system is vulnerable, but an intelligence organization needs a production pipeline: intercept, classify, set up the machine, decrypt, translate, distribute, and protect the source.
The same distinction applies in today's security testing. A proof-of-concept exploit is not the same as reliable exploitation. A statistical weakness in a cipher is not the same as a full plaintext recovery workflow. Purple's analog turned cryptanalysis into a working system.
What MAGIC Intelligence Revealed
MAGIC was the codeword used for highly protected intelligence derived from decrypts of Japanese diplomatic traffic, especially Purple. The decrypts gave selected U.S. leaders insight into Japanese policy and diplomacy before and during the war. The distribution was extremely restricted. According to the NSA Red and Purple article, a January 1941 arrangement limited MAGIC translations to 10 people, including the President and top War, Navy, State, military, and intelligence leaders.
MAGIC helped Washington understand Japanese negotiating positions before Pearl Harbor. It also provided valuable wartime intelligence from Japanese diplomatic reporting in Europe. Japanese ambassador Hiroshi Oshima in Berlin sent detailed reports about German military thinking and defenses. Because those messages were enciphered in Purple, Allied access to them had value far beyond the Pacific diplomatic crisis.
At the same time, MAGIC did not mean the United States had complete warning of every Japanese military move. Purple was a diplomatic cipher. The main operational picture for Japanese naval movements depended on naval codes and traffic analysis, especially systems outside Purple. This distinction is essential. Reading an embassy's diplomatic instructions is powerful, but it is not the same as reading every fleet order.
That difference is why good cryptography history avoids one-sentence claims such as "Purple warned Pearl Harbor." Purple decrypts showed diplomatic pressure and timing. They did not fully replace naval intelligence. The final intelligence picture before December 7, 1941 was fragmented across diplomatic messages, naval traffic, assumptions, distribution limits, and human interpretation.
The Fourteen-Part Message and Pearl Harbor
The most famous Purple episode is the Japanese fourteen-part message to its Washington embassy on December 7, 1941. U.S. cryptanalysts decrypted and translated the message before the Japanese embassy completed its own processing. The message broke off negotiations but did not explicitly say "attack Pearl Harbor." Its timing mattered because Tokyo instructed the embassy to deliver it at 1 p.m. Washington time, shortly before the attack began in Hawaii.
The Purple break made it possible for American officials to see the diplomatic break before formal delivery, but operational understanding still lagged. The delay at the Japanese embassy also became historically significant because the message was delivered after the attack had begun. Popular memory often turns this into a neat intelligence drama. The real lesson is messier: cryptographic access can be excellent while warning, distribution, interpretation, and action remain imperfect.
For learners, this is one of the best examples of why cryptography is part of a larger security system. Decryption answers "what does this message say?" It may not answer "what will happen next?" or "who needs this in the next 30 minutes?" Those are intelligence and command problems, not merely cipher problems.
Why Japan Kept Using Purple
Japan continued using Purple because it believed the system was secure. That confidence was not irrational from the operator's viewpoint. Purple was complex, no foreign power was known to possess the machine, and electromechanical cipher systems seemed far beyond ordinary hand analysis. The weakness was that secrecy of design is brittle when the system leaks patterns through traffic.
The Type B machine's 6-and-20 split, repeated procedures, and overlap with other systems gave analysts openings. Reports also indicate that warnings about possible compromise did not lead to a decisive replacement. A system can survive a warning if the defender lacks proof, underestimates the adversary, or considers replacement too disruptive.
This is a modern lesson too. Security teams often keep weak systems because migration is costly, evidence is ambiguous, or no breach is visible. The cryptographic version is sharper: if your system's safety depends mainly on the enemy not knowing how it works, every intercepted message becomes research material.
Why Purple Was Stronger Than Classical Ciphers
Purple was stronger than classical pen-and-paper ciphers because it changed substitutions over time and hid its mechanism inside an electromechanical process. Caesar, Atbash, and simple substitution can be explained with one alphabet mapping. Vigenere adds a repeated keyword and multiple shifts. Purple added machine state, stepping behavior, wiring, daily settings, and a split alphabet design.
That extra machinery made casual solution impossible. An interceptor could not simply count letters, guess E, and read the message. Analysts needed enough traffic, enough cribs, enough knowledge from RED, and enough engineering skill to reconstruct the unknown machine. That is a very different attack surface from solving a classroom substitution puzzle.
Still, "stronger than classical ciphers" is not the same as modern security. Modern cryptography generally assumes the algorithm is public and the key is secret. Purple relied heavily on both key secrecy and machine-design secrecy. Once the machine behavior was inferred, the problem became operational key recovery and daily processing.
The most durable lesson from Purple is not that old machines were naive. It is that hidden design gives a defender less margin than a published algorithm with well-studied keys, threat models, and implementation discipline.
Purple vs Enigma: Similar Story, Different Mechanics
Purple and Enigma are often mentioned together because both were World War II cipher machines broken by Allied cryptanalysts. The similarities are real: both transformed letters through electrical machinery, both used changing internal states, both depended on procedures, and both produced intelligence whose source had to be protected. But the differences are just as important.
Enigma used rotors, a reflector, a plugboard, and stepping behavior that ensured a letter could not encipher to itself. That property became useful in crib-based attacks. Purple used a 6-and-20 split and stepping switches. Its weakness was not Enigma's exact no-self-encipherment property. The attack grew from RED experience, overlapping traffic, cribs, and the discovery that six letters behaved separately from the other 20.
In operational terms, Enigma was tied heavily to German military traffic, while Purple was diplomatic. That difference affects what the decrypts could reveal. Enigma decrypts could show convoy, U-boat, air, or army information depending on the network. Purple decrypts showed diplomatic reporting and policy. Both mattered, but they answered different questions.
Use the Enigma machine simulator to see how rotor stepping changes letter mappings. Then compare that concept with Purple's structural split. The exercise helps prevent the common mistake of treating every machine cipher as if it were just "an Enigma in another country."
Modern Security Lessons From Purple
The first lesson is that algorithm secrecy is not enough. Purple's designers expected the machine's unknown structure to protect the system. That assumption failed once traffic supplied enough evidence. Modern guidance, including the NIST cryptographic glossary and CSRC resources, reflects a different mindset: use reviewed primitives, define terms precisely, and avoid depending on obscurity alone.
The second lesson is that procedure matters. Reusing content across systems, sending predictable diplomatic formulas, and making daily settings too regular can turn strong-looking machinery into a solvable target. In modern systems, the equivalent problems include nonce reuse, bad random number generation, repeated keys, exposed metadata, and insecure fallback modes.
The third lesson is that production matters. Breaking Purple required more than insight. It required an analog machine, trained operators, translation, distribution rules, and extreme source protection. In modern incident response, the same pattern appears when a vulnerability moves from theory to detection, exploitation, patching, monitoring, and governance.
The fourth lesson is that intelligence is not action. MAGIC gave U.S. leaders important diplomatic insight, but decrypts still had to be interpreted correctly and distributed in time. Cryptography can unlock a message; organizations still decide what the message means and what to do next.
How to Study Purple With the Tools on This Site
Start with a simple substitution exercise. Use the substitution cipher tool to encrypt a paragraph with one fixed alphabet, then inspect the result with the frequency analysis tool. You will see why monoalphabetic substitution leaks language patterns.
Next, use the Vigenere cipher tool with a short keyword. Notice how the repeated key hides single-letter frequency better but introduces periodic structure. That gives you a bridge from simple substitution to machine systems: stronger ciphers often defeat one attack while creating a subtler pattern somewhere else.
Then open the Enigma simulator and encrypt repeated letters. Watch how machine state changes the output. Enigma is not Purple, but the simulator makes the general idea of moving electrical substitution concrete. Once that concept is clear, Purple's 6-and-20 split becomes easier to appreciate as a different machine-design choice rather than a mysterious color name.
Finally, read the history of cryptography and compare Purple with older systems such as the Jefferson wheel cipher. Both show that mechanical cryptography often improves workflow and keyspace, but neither removes the human problems of key distribution, procedure, traffic reuse, and interpretation.
Common Misconceptions About Purple
The first misconception is that Purple was a Japanese naval code. It was mainly a Foreign Ministry diplomatic system. Japanese naval codes were separate and strategically critical, especially for operational warning. Confusing the two leads to exaggerated claims about what Purple decrypts could and could not reveal.
The second misconception is that the U.S. broke Purple by capturing the machine. The critical break came before the U.S. had a Japanese machine in hand. American analysts inferred the machine's behavior and built analogs. Physical fragments recovered later confirmed aspects of the design, but the cryptanalytic achievement had already happened.
The third misconception is that Purple and Enigma worked the same way. They were both electromechanical cipher machines, but their mechanisms and attacks differed. Enigma's rotor-reflector-plugboard design created one set of properties. Purple's stepping-switch design and 6-and-20 split created another.
The fourth misconception is that decrypting Purple made Pearl Harbor fully predictable. MAGIC decrypts were important, but they were diplomatic intelligence. The exact operational warning problem involved naval traffic, geography, assumptions, timing, and distribution. Good cryptography history keeps those layers separate.
References
- NSA National Cryptologic Museum: The Magic of Purple
- NSA Cryptologic History: Red and Purple
- Wikipedia: Type B Cipher Machine
- William F. Friedman: Preliminary Historical Report on the Solution of the B Machine
- NIST Computer Security Resource Center Glossary
FAQ
What was the Purple machine in World War II?
The Purple machine was Japan's Type B diplomatic cipher machine, introduced for major Foreign Ministry posts in 1939. It encrypted 26-letter telegraph text and was used for sensitive diplomatic messages between Tokyo and embassies such as Washington, London, Moscow, and Berlin.
Was Purple a Japanese naval code?
No. Purple was primarily a Japanese diplomatic cipher used by the Foreign Ministry. Japanese naval codes were separate systems, and that distinction matters because diplomatic decrypts could reveal policy and negotiation strategy but did not automatically expose every fleet operation.
How did the United States break the Purple cipher?
The U.S. Signal Intelligence Service broke Purple by combining RED-system experience, intercepted traffic, cribs, discovery of the 6-and-20 letter split, and engineering reconstruction. By 1940, analysts had enough understanding to build Purple analog machines for faster decryption.
Did Americans capture a Purple machine before solving it?
No. The major cryptanalytic success came before Americans possessed a Japanese Purple machine. SIS inferred the machine behavior from messages and built an analog. Physical parts recovered in 1945 helped confirm the design, but they were not the original source of the break.
What was MAGIC intelligence?
MAGIC was the codeword used to protect intelligence from decrypted Japanese diplomatic traffic, including Purple messages. In January 1941, distribution of MAGIC translations was reportedly limited to 10 senior U.S. officials, which shows how sensitive the source was.
Was Purple stronger than Enigma?
That is not a clean comparison because Purple and Enigma had different mechanisms and missions. Purple used stepping-switch behavior and a 6-and-20 split for diplomatic traffic, while Enigma used rotors, a reflector, and plugboard settings across many German military networks.
Can Purple be used for secure encryption today?
No. Purple is historically important but obsolete for real security. Modern systems should use reviewed cryptographic libraries and current standards. Purple lacks modern properties such as public algorithm review, authenticated encryption, safe key exchange, and resistance to large-scale computational analysis.
Final Takeaway
The Purple machine shows how World War II cryptography sat between classical hand ciphers and modern digital security. It was complex enough to defeat casual analysis and important enough to shape high-level diplomacy, yet it still leaked structure through design choices, procedures, repeated traffic, and predictable communication habits.
For students of cryptography, Purple is valuable because it connects mechanisms to consequences. The 6-and-20 split was a machine detail, but it became a cryptanalytic doorway. The analog was an engineering device, but it turned analysis into intelligence production. MAGIC was not just a decrypt label; it was a reminder that information has to be protected, interpreted, and acted on. To keep learning, compare Purple with the Enigma machine, practice simpler patterns in the substitution cipher tool, and use the frequency analysis tool to see why every cipher leaves a different kind of trace.
If you need help choosing a cipher, encoding, hashing, or cryptanalysis topic for a lesson, puzzle, or research workflow, use the contact page to reach the site team.