PURPLE · Volume 1

PURPLE — Volume 1 — PURPLE — The Machine Nobody Saw

What Japan's Type 97 diplomatic cipher machine was, why it was built from telephone stepping switches instead of rotors, how a small U.S. Army team rebuilt it in 1940 from intercepted messages alone, and what reading it meant from Pearl Harbor to Normandy — the orientation volume for the twelve-part series

Figure 1 — The largest surviving piece of a real PURPLE machine: three seven-level stepping switches on an aluminium frame, with their colour-coded wiring harness underneath, recovered from the wreckage of th…
Figure 1 — The largest surviving piece of a real PURPLE machine: three seven-level stepping switches on an aluminium frame, with their colour-coded wiring harness underneath, recovered from the wreckage of the Japanese embassy in Berlin in 1945. The museum plaque calls it "the largest of three surviving pieces of the famous Japanese diplomatic cipher machine." National Cryptologic Museum, Annapolis Junction, Maryland. — Photo: Daderot, CC0, via Wikimedia Commons, https://commons.wikimedia.org/wiki/File:PURPLE_(Type_97)_cryptographic_device_fragment_-_97-shiki_%C5%8Dbun_inji-ki_(%E4%B9%9D%E4%B8%83%E5%BC%8F%E6%AC%A7%E6%96%87%E5%8D%B0%E5%AD%97%E6%A9%9F)_or_%E6%9A%97%E5%8F%B7%E6%A9%9F_%E3%82%BF%E3%82%A4%E3%83%97B_-_National_Cryptologic_Museum_-_DSC07837.JPG

1.1 About This Volume

This is the entry point to a twelve-volume deep dive on PURPLE, the American cover name for the cipher machine that protected Japan’s most secret diplomatic telegrams from February 1939 to the end of the Second World War. The Japanese Foreign Ministry called it the 97-shiki ōbun injiki (九七式欧文印字機), the “Type 97 printing machine for European characters”, or more simply angōki taipu B, the Type B cipher machine. The U.S. Army’s Signal Intelligence Service (SIS) called it the B machine, then PURPLE, and in September 1940 broke it.

What makes PURPLE iconic is not only what its messages revealed, though that list runs from Japan’s negotiating limits in 1941 to the layout of German defences on the Normandy coast. It is the way it was broken. No American had seen the machine. None was captured, bought or stolen. A small team worked for eighteen months from intercepted ciphertext, deduced what the machine must contain, and then built one — out of the same kind of telephone exchange switches the Japanese had used, as it turned out five years later, when a fragment of a real machine was pulled from the ruins of Berlin.

This volume explains what PURPLE was, how it differed from the rotor machines that dominate most histories of wartime cryptography, and why its break mattered. It then tours the series volume by volume. Readers who want the background can go on to Volume 2 (the codebreaking that came before) and Volume 3 (PURPLE’s predecessor, RED). Readers who want the machine itself should go to Volume 4. The break is Volume 5; its consequences are Volumes 6 to 9. The last three volumes are a workshop: a design for building a working PURPLE from real electromechanical stepping switches, with a software simulator to check it against.

1.1.1 The Twelve-Volume Series

Table 1 — The Twelve-Volume Series

VolTitleFocus
1PURPLE — The Machine Nobody Saw (this volume)Orientation: what it was, how it worked, the whole story in miniature
2Before PURPLE — Japan’s Codes, Yardley’s Black Chamber and the Naval TreatyThe 1920s: the Cipher Bureau, the Washington Naval Conference, the 1929 closure, Yardley’s book and Japan’s turn to machines
3RED — The Type 91 Machine and Its BreakJapan’s first diplomatic cipher machine, the half-rotor and break wheel, and how SIS read it from 1936
4Inside the Type 97 — Sixes, Twenties and Stepping SwitchesThe plugboards, the 6/20 split, the switches, the stepping order and the keying system
5The Break — Friedman, Rowlett, Grotjan and 20 September 1940Eighteen months of attack, the afternoon of 20 September, Rosen’s analog and its cost
6MAGIC — Analogs, Translators and the Mission to BletchleyBuilding copies, sharing them with the Navy and Britain, the Sinkov mission, and how decrypts reached readers
7Pearl Harbor and the Fourteen-Part Message6–7 December 1941: the long message, the “1 p.m.” instruction and what the record does and does not show
8Oshima’s Window — Reading Berlin from WashingtonAmbassador Ōshima’s reports from Hitler’s Germany and their value to the Allies
9What Survived — The Berlin Fragment, CORAL, JADE and the LegacyThe surviving hardware, PURPLE’s naval cousins and what the break taught
10Building a PURPLE — DesignA working analog from real stepping switches: architecture, parts and the controller
11Building a PURPLE — Wiring, Controller and VerificationWiring the sixes and twenties, the stepping logic, and testing against published vectors
12Running PURPLE — Keys, Procedures and a Message Worked in FullKeying the machine as the Japanese did and taking a real message from ciphertext to plaintext

1.2 A Typewriter That Kept Secrets

A PURPLE station, as the Japanese built it, looked like office equipment. There were two electric typewriters and, between them, a box of switches and wires. A cipher clerk typed the plaintext on the first typewriter; an electrical pulse went from each key through the box, emerged on a different wire, and drove the second typewriter, which printed the ciphertext letter. To decipher, the clerk set the box to the same starting position, typed the ciphertext, and read the plaintext from the second typewriter. The machine handled only the 26 letters of the Latin alphabet. Japanese text was spelled out in Latin letters (rōmaji) before it was enciphered, and English text could be enciphered as it stood.

Inside the box there was nothing that turned like the rotors of the German Enigma. The working parts were stepping switches: electromagnetically driven rotary switches of a type made by the hundred thousand for automatic telephone exchanges. Each switch had a set of fixed contacts arranged in an arc and a wiper that stepped from contact to contact, one position per electrical pulse, sweeping round and starting again. PURPLE’s switches had 25 positions. A switch with several layers (levels) of contacts, all swept by wipers on one shaft, could switch several wires at once.

The machine split the alphabet in two. A plugboard at the input divided the 26 letters into a group of six, which the American codebreakers called the sixes, and a group of twenty, the twenties. Each group was enciphered separately:

  • The sixes went through a single six-level, 25-position switch. At each of its 25 positions the switch’s wiring connected the six input lines to the six output lines in a different scrambled order, giving 25 fixed alphabets used one after another.
  • The twenties went through three switch stages in series, each with twenty levels and 25 positions. One stage stepped every letter, one occasionally and one rarely, and which stage played which part was set by the key for each message.

A second plugboard at the output reversed the first, turning the six and twenty internal lines back into letters. The plugboard arrangement changed daily. The starting positions of the switches, and the order in which the three twenties stages moved, were set for each message by a five-digit indicator at its head.

Figure 2 — PURPLE as a block diagram. The input plugboard divides the alphabet into six letters and twenty; the sixes are enciphered by one 25-position switch, the twenties by three 25-position stages in seri…
Figure 2 — PURPLE as a block diagram. The input plugboard divides the alphabet into six letters and twenty; the sixes are enciphered by one 25-position switch, the twenties by three 25-position stages in series, and an output plugboard turns the internal lines back into letters. The position of the sixes switch controls which twenties stage steps. Volume 4 describes each part in detail. — Diagram drawn for this series (03-outputs/diagrams/diagrams_A.py), after Freeman, Sullivan & Weierud, "PURPLE Revealed", Cryptologia 27 (2003), http://cryptocellar.org/pubs/PurpleRevealed.pdf

The 6/20 division was inherited. Japan’s earlier diplomatic machine, the Type 91 that the Americans called RED, had enciphered vowels and consonants separately, partly because international cable tariffs had once charged less for “pronounceable” groups of letters (Volume 3). PURPLE kept the split but let the plugboard put any six letters in the small group. It was a weakness, because the six letters could be found by counting: in most messages they occurred noticeably more or less often than the twenty, and once found they could be read with comparatively little effort. That small door was the American way in.

1.2.1 Why stepping switches?

A rotor machine such as Enigma scrambles the alphabet with wired wheels that rotate like an odometer. Its alphabets are related to one another: each is the same wiring shifted round by one position, and a cryptanalyst who knows that can exploit it. A stepping switch is different. Each of its 25 positions is wired independently to the next stage, so the designer can choose 25 completely unrelated alphabets. Freeman, Sullivan and Weierud, whose 2003 paper in Cryptologia is the standard technical account of the machine, note that PURPLE and its naval cousins CORAL and JADE were “the first, and perhaps the only, known cryptographs to use stepping switches to permute the plaintext” (Freeman, Sullivan & Weierud 2003).

According to the Japanese side of the story, the stepping switch was a practical choice before it was a cryptographic one. The design team at the Foreign Ministry — led by Kazuo Tanabe, with the engineers Masaji Yamamoto and Eikichi Suzuki — adopted it at Suzuki’s suggestion in place of the “half-rotor” switch of the Type 91, which had needed its contacts cleaned daily to work reliably. Those names and that sequence rest on Japanese-language histories summarised in secondary sources; Volume 4 goes into what is and is not documented. The same family of switches, built by the Japanese Navy and Foreign Ministry, sat in other machines: the naval attaché machine the Americans called CORAL and the fleet machine they called JADE (Volume 9).

Figure 3 — A rotary stepping switch, or uniselector, of the kind used in automatic telephone exchanges: a fan of fixed contacts arranged in an arc, swept by wipers on a shaft that an electromagnet steps forwa…
Figure 3 — A rotary stepping switch, or uniselector, of the kind used in automatic telephone exchanges: a fan of fixed contacts arranged in an arc, swept by wipers on a shaft that an electromagnet steps forward one position per pulse. PURPLE's switches worked on the same principle with 25 positions and many stacked levels. This is a telephone switch, not a part of a PURPLE machine. — Photo: Brock Craft (Thatbrock), CC BY-SA 3.0, via Wikimedia Commons, https://commons.wikimedia.org/wiki/File:Uniselector_Stepper_detail.jpg

Readers who know telephone history will recognise the family. The automatic exchange descends from Almon Strowger’s step-by-step switch of 1891, which the companion site Telephones covers in depth. PURPLE’s switches were the simpler single-motion kind, often called uniselectors, which step round one arc of contacts rather than up and then around as a Strowger selector does. The SIS engineer who rebuilt the machine, Leo Rosen, used single-motion telephone switches bought in the United States; when a fragment of a Japanese machine was examined after the war, the construction was found to be very close to the parts he had chosen.

1.3 The Break in Brief

The machine came into service on 20 February 1939. SIS knew it was coming. It had been reading RED regularly since 1937, and RED messages in late 1938 had announced that a communications expert named Okamoto was travelling to install a new “Type B” machine at the major embassies (Friedman 1940). The first messages in the new system, sent from Warsaw, showed six letters with abnormal frequencies — the familiar fingerprint of a 6/20 split. Within weeks the team, led day to day by Frank Rowlett with Robert Ferner, had worked out how the sixes were enciphered; by 10 April 1939 it had reconstructed all 25 sixes alphabets.

The twenties took another seventeen months. The attack went forward on cribs: diplomatic notes quoted word for word in Japanese telegrams, messages sent in both RED and PURPLE, and the stereotyped openings of Foreign Ministry cables. The problem was that the machine behaved like nothing the team had seen. In Friedman’s words, written in October 1940, a statistical calculation showed that the repetitions in the ciphertext were “less than the number to be expected had the letters comprising them been drawn at random out of a hat!” The machine, he concluded, “had with malicious intent — but brilliantly — been constructed to suppress all plain text repetition.”

The break came from a set of six messages, all enciphered with the same indicator, 59173, on different days, which the team had laboriously reduced to a common base. On Friday 20 September 1940, at about 2 p.m., Genevieve Grotjan, a junior cryptanalyst who had come to SIS from a statistical clerk’s job at the Railroad Retirement Board, brought Rowlett, Ferner and Albert Small to her desk and showed them repeated patterns in the worksheets. Rowlett later remembered Small dancing round the room “like a victorious prizefighter”, and Friedman arriving to ask what the noise was about. One week later, on 27 September — the day Germany, Italy and Japan signed the Tripartite Pact — SIS handed in its first two PURPLE translations. Volume 5 tells this story in detail, including the question of how credit for the break was shared.

Figure 4 — "PURPLE Analog No. 1" at the National Cryptologic Museum: the SIS-built machine, with its plugboard across the front and banks of telephone stepping switches inside the wooden case. Its makers had …
Figure 4 — "PURPLE Analog No. 1" at the National Cryptologic Museum: the SIS-built machine, with its plugboard across the front and banks of telephone stepping switches inside the wooden case. Its makers had never seen the machine it imitates. Freeman, Sullivan and Weierud note that this exhibit has a single physical plugboard, which is all the machine needs when the input and output pluggings are the same. — Photo: Daderot, CC0, via Wikimedia Commons, https://commons.wikimedia.org/wiki/File:PURPLE_analog_No_1_-_National_Cryptologic_Museum_-_DSC07846.JPG

1.4 The Machine They Built Without Seeing

Knowing the principle and reading traffic quickly are two different things. Deciphering by hand from tables was slow. The answer was to build a copy — an analog, in the SIS vocabulary — and the man who designed it was Leo Rosen, an electrical engineer from the Massachusetts Institute of Technology who had recently joined SIS.

Rosen’s key idea predated the September break. While the sixes were still being deciphered by hand, he had suggested using standard six-level, 25-point telephone selector switches to mechanise their decipherment. Rowlett recalled that Colonel Spencer Akin, the officer in charge of the section, telephoned a friend at a Chicago telephone-equipment maker and had a supply of switches sent by air; within about two weeks Rosen had a working “six-buster”. When the twenties gave way, the same switches, four six-level units ganged together to make each twenty-level stage, formed the heart of the full machine (Hannah, “Frank B. Rowlett — A Personal Profile”).

Friedman’s report of 14 October 1940 describes the stage reached by then: a hand-operated B machine designed and built by the cryptanalytic section, already in use to help decipher messages, while materiel for two fully automatic machines was on order. Rowlett gave the cost of the parts for the automatic machine’s cryptographic unit as $290.97, with another $393.68 for the keyboard and printing typewriter — $684.65 in all, “surely one of the government’s better bargains”. The wiring team, working voluntarily through many fourteen-hour days, soldered more than 500 connections for each bank of switches.

The best testimony to the analog’s accuracy came after the war. Rowlett wrote that when the Americans were finally able to compare their machine with a real one, “of the several hundred connections we had recovered, only two were incorrect, and their effect on decipherment was negligible.” He also recorded an irony: intercepted messages showed the Japanese having more trouble with their machines than SIS had with its copies.

1.5 What PURPLE Revealed

The intelligence produced from PURPLE and the other Japanese diplomatic systems was distributed under the code word MAGIC. The name grew out of the habit of calling the codebreakers “magicians”: Rowlett credited the Army’s chief signal officer, Major General Joseph Mauborgne, with the word, while the NSA’s historians attribute it to Friedman. Its uses fall into three broad periods.

1940–41: the road to war. Through 1941 Washington read the instructions Tokyo sent to its ambassador, Admiral Kichisaburō Nomura, often before he had read them himself. MAGIC showed Japan’s negotiating positions, its deadlines and its preparations to move south into Southeast Asia. It did not show the plan to attack Pearl Harbor, which the Foreign Ministry did not put in diplomatic telegrams. Volume 7 sets out what the decrypts did show, culminating in the fourteen-part message of 6–7 December 1941 that broke off negotiations and the separate instruction to deliver it at 1 p.m. Washington time — dawn in Hawaii.

1941–45: a window on Berlin. The most valuable single source in PURPLE was General Hiroshi Ōshima, Japan’s ambassador in Berlin, a soldier-diplomat with unusual access to Hitler and his ministers who reported their conversations to Tokyo at length. General George C. Marshall wrote in 1944 that Ōshima’s messages were “our main basis of information regarding Hitler’s intentions in Europe”. Rowlett recalled that Ōshima’s reports gave a detailed description of German fortifications along the Normandy coast before D-Day. Volume 8 is about Ōshima.

Throughout: an alliance currency. In January 1941, eleven months before the United States entered the war, a four-man Army and Navy team sailed to Britain on the new battleship King George V with a PURPLE analog in its crates and handed it to the Government Code and Cypher School at Bletchley Park. The gift helped open the door to a cryptologic partnership with Britain that grew into the wartime and post-war alliance. Volume 6 tells the story of that mission and of the other analogs.

Japan never learned in wartime that PURPLE had been broken. In May 1941 Berlin did warn Tokyo, through Ōshima, that a “fairly reliable” German source reported that the Americans were reading Ambassador Nomura’s codes; Tokyo asked Nomura, who replied that he had found the United States was reading “some of our codes”. Those exchanges were themselves read in PURPLE, and the machine stayed in service. The Japanese learned the full story only from the Congressional investigation of Pearl Harbor in 1945–46, when MAGIC was made public.

Figure 5 — Looking down into the Berlin fragment: three stepping switches side by side, each with its stack of contact levels, wiper assembly and stepping ratchet. Hand-written figures on the switch frames ap…
Figure 5 — Looking down into the Berlin fragment: three stepping switches side by side, each with its stack of contact levels, wiper assembly and stepping ratchet. Hand-written figures on the switch frames appear to be position or assembly markings. — Photo: ArnoldReinhold, CC BY-SA 4.0, via Wikimedia Commons, https://commons.wikimedia.org/wiki/File:Purple_code_machine_fragment_top.agr.jpg

1.6 What Survives

The Japanese are reported to have destroyed their PURPLE machines at the end of the war, and post-war searches in Japan found little or nothing. What survives of the real thing is a fragment: three seven-level stepping switches on a frame, with their wiring, recovered from the wreckage of the Japanese embassy in Berlin in 1945. It is in the collection of the National Cryptologic Museum beside NSA headquarters at Fort Meade, Maryland, alongside SIS analogs including an improved version the Army built in March 1944. Volume 9 describes what is held there and what the fragment taught: the Japanese built each twenties stage from three seven-level switches, where Rosen had used four six-level ones, a difference of construction with no cryptographic consequence.

1.7 Why PURPLE Matters

First, it is the purest case on record of reconstructing a machine from its output. The Poles had worked from documents supplied by a French agent as well as ciphertext when they recovered Enigma’s wiring; the British broke the Lorenz teleprinter cipher without seeing the machine, but with the help of an operator’s error that handed them two long messages in depth. SIS had nothing but ciphertext, cribs and patience. The analog was a hypothesis built in metal, and it worked.

Second, it shows cryptographic design meeting procedure. PURPLE’s stepping-switch alphabets were stronger in principle than Enigma’s rotor alphabets. What undid the machine was the inherited 6/20 split, the practice of sending the same text in different systems, the quoting of English-language documents word for word, and a key system with only 120 starting positions per day. The Japanese also sent new keying instructions in the system itself, so that each change was compromised as soon as it was made. Volume 4 examines each of those choices.

Third, it changed how intelligence was organised. MAGIC was one of the first compartmented intelligence products in the U.S. government, with a short distribution list and couriers who waited while readers read. Its successes and failures fed directly into the Pearl Harbor investigations, the wartime partnership with Britain, the creation of the Armed Forces Security Agency in 1949 and the National Security Agency in 1952.

Fourth, it is buildable. The stepping switch was the commodity part of mid-century telephony, and surplus switches still exist. A working PURPLE, electrically equivalent to the SIS analog and checkable letter for letter against published test material, is within reach of a determined workshop. That is the subject of Volumes 10 to 12.

Figure 6 — The PURPLE story at a glance, from Yardley's Cipher Bureau in 1919 to the recovery of the Berlin fragment in 1945. Dots are coloured by the volume that covers each event. Events are evenly spaced, …
Figure 6 — The PURPLE story at a glance, from Yardley's Cipher Bureau in 1919 to the recovery of the Berlin fragment in 1945. Dots are coloured by the volume that covers each event. Events are evenly spaced, not to scale. — Diagram drawn for this series (03-outputs/diagrams/diagrams_A.py)

1.8 Names, Spellings and Conventions

The machine has many names. The Japanese official designation was kyūnana-shiki ōbun injiki, written in the sources as 97-shiki ōbun injiki and similar romanisations; “97” refers to the Japanese imperial year 2597, which is 1937. The Foreign Ministry also used angōki taipu B, “cipher machine type B”. U.S. Army cryptanalysts first called it the B machine and then PURPLE; the U.S. Navy at first called it the “B-machine” and adopted the Army’s name once joint work began. On paper, the Allies gave it the short title JAA. “MAGIC” was the name for the intelligence, not the machine.

Japanese personal names in this series are given family name last, as they appear in the English-language sources of the period (Hiroshi Ōshima, Kichisaburō Nomura), with long vowels marked where the sources mark them. Times are local to the place named unless stated. Where sources disagree — and on PURPLE they often do, because several key participants wrote decades later from memory — the text says so and gives both.

Three kinds of figure appear: photographs of surviving hardware and of the people involved; scans of primary documents; and line diagrams drawn for this series, whose generating scripts are kept with the project. Worked cipher examples in the later volumes come only from the series’ own simulator, 03-outputs/tools/purple_sim.py, which is checked against the published test material of Freeman, Sullivan and Weierud.

1.9 The One-Paragraph Version

PURPLE was the cipher machine Japan’s Foreign Ministry used for its most secret telegrams from February 1939 to 1945: two typewriters and a box of telephone stepping switches that divided the alphabet into six letters and twenty and enciphered each group through switches of 25 positions, with plugboards that changed daily. The U.S. Army’s Signal Intelligence Service, under William Friedman and Frank Rowlett, broke the sixes within weeks and the twenties after eighteen months, on 20 September 1940, when Genevieve Grotjan found the repeating patterns the team had been looking for; Leo Rosen then built a working copy out of American telephone switches for under $700, without ever seeing the original. The resulting intelligence, MAGIC, tracked Japan’s diplomacy up to the fourteen-part message of 7 December 1941, gave the Allies the reports of the Japanese ambassador in Berlin throughout the war, and bought Britain’s trust in early 1941. A fragment of one real machine survives. The remaining eleven volumes are the long version — and the last three show how to build one.


Next — Volume 2: Before PURPLE — Japan’s Codes, Yardley’s Black Chamber and the Naval Treaty. A poker-playing telegraph clerk who talked his way into running America’s first peacetime codebreaking bureau from a New York brownstone; the Japanese telegram of 28 November 1921 that told Washington exactly how far Japan’s admirals would bend at the naval conference; a Secretary of State who decided that gentlemen do not read each other’s mail; and the 1931 best-seller that told Japan everything — and sent its Foreign Ministry shopping for cipher machines.

Comments (0)

  1. Loading…

Comments are held for moderation — nothing appears until approved.