PURPLE · Volume 12
PURPLE — Volume 12 — Running PURPLE — Keys, Procedures and a Message Worked in Full
How a Japanese code clerk keyed the Type 97 in December 1941, how the Americans read the same key, and Part 1 of the 14-part message taken from its indicator group to its English text — then a new message enciphered the 1941 way
12.1 About This Volume
A cipher machine is only half a cryptosystem. The other half is the procedure: where the key comes from, how it is hidden in the message, how the plaintext is prepared, what the operator does with errors. PURPLE’s procedures were as important to its fate as its switches, and they are what an operator of the replica built in Volumes 10 and 11 has to follow to read a real message.
This volume works through them on the most famous PURPLE message there is: Part 1 of the 14-part message sent from Tokyo to the Japanese embassy in Washington on 6 December 1941 (Volume 7 tells its story). It starts from the five-digit group at the head of the intercept, recovers the switch settings and the daily alphabet exactly as a Japanese clerk — or an American codebreaker — would, sets up the machine, and deciphers the message, explaining the code groups and garbles in the plaintext. It then enciphers a new message by the same rules, and closes with how the Americans ran their analogs, and how the Japanese kept changing the keying until 1945.
Every cipher letter here comes from the simulator, 03-outputs/tools/purple_sim.py, which reproduces the published decipherment of Part 1 exactly (Volume 11). On the replica, the same keys produce the same letters.

12.2 The Key in Two Parts
A PURPLE key had two parts with different lifetimes (FSW, pp. 19–21).
- The switch settings — the starting positions of the sixes and the three twenties switches, and the motion — changed with every message. They came from an indicator: a five-digit number chosen from a fixed list and sent, disguised, as the first group of the message.
- The alphabet — the plugging that put six letters on the sixes and twenty on the twenties, in a particular order — changed every day and was the same for every message that day. It came from a book.
Neither part could be chosen freely. A hard-wired machine with a period of 15,625 letters cannot be started anywhere: two long messages started too close together would overlap and be “in depth”, the condition every codebreaker hopes for. So the Japanese used a short list of carefully spaced starting points. Initially the indicator was “selected from a list of 120. Sixty of the indicators had all odd numbers (e.g. 73159), while the remaining 60 had all even numbers (e.g. 60284)”; by 1 May 1942 another 120 had been added (FSW, p. 19). The American history adds that the 120 were divided evenly among the motions, 20 each, and that the starting points “had been carefully selected by the Japanese to reduce the possibility of overlaps and to avoid messages in depth” (Cryptologic Quarterly 3, 1984–85, p. 72).
The cost of a short list was that the same starting point recurred across many days. That is exactly what broke PURPLE: six messages with indicator 59173, sent on different days, which SIS could convert to a common alphabet and so put in depth (Volume 5).
12.3 From the Indicator to the Switches
12.3.1 Disguising the indicator
Sent in the clear, an indicator from a list of 120 would have told any interceptor which messages shared a starting point. The Japanese disguised it by adding a five-digit number that changed every month: “PURPLE messages sent in November, 1941 used an additive of 82313; December, 1941 messages used an additive of 03210.” For the 14-part message there was a second layer: the indicator’s digits were first transposed in the order BEDAC, then the additive applied (FSW, p. 20).
Part 1 of the 14-part message begins, after its address and group count, with the group 62527. Recovering the settings reverses the clerk’s steps:
Table 1 — Part 1 of the 14-part message begins, after its address and group count, with the group 62527. Recovering the settings reverses the clerk's steps
| Step | Working | Result |
|---|---|---|
| Received indicator group | 62527 | |
| Subtract the December additive | 62527 − 03210 | 59317 |
| Undo the transposition BEDAC | digits 5 9 3 1 7 were taken from positions B E D A C | 15739 |
| Look up 15739 in the indicator list | sixes 9; twenties 1, 24, 6; motion 4 (231) |
Indicator recovery for Part 1. The arithmetic follows FSW, p. 20 and is checked by the simulator’s self-test (check 7: 15739 transposed is 59317, plus 03210 is 62527).
The transposition is easiest to see forwards. The true indicator 15739 has digits A = 1, B = 5, C = 7, D = 3, E = 9. Reading them in the order B E D A C gives 5 9 3 1 7; adding 03210 digit by digit gives 6 2 5 2 7. Freeman, Sullivan and Weierud describe the addition as “adding (with carry)”; in this example no digit carries, so the example cannot show which rule was meant, and the replica’s operator should simply note that every column here stays below ten.
The last row needs the indicator list itself. The Americans had reconstructed it by cryptanalysis long before December 1941 — “by this time (actually by April 1, 1941) all of the 120 original starting points and about 50% of the alphabets had been recovered” (FSW, pp. 28–29) — and the surviving intercept of Part 1 carries the answer in pencil. Weierud describes the notes: “6th” for the date, “ARMY” because the Army processed PURPLE on even days of the month and the Navy on odd ones, “Pt. 1”, the indicator 15739, and “9-1-24-6” with a circled 4 for the motion (CryptoCellar, “An Authentic PURPLE Message”).
12.3.2 Writing the setting down
The US analysts wrote a setting as a-b,c,d-ef: sixes at a, twenties #1, #2, #3 at b, c, d, switch e fast and switch f middle. Part 1’s setting is therefore 9-1,24,6-23: sixes 9; #1 at 1, #2 at 24, #3 at 6; #2 fast, #3 middle, and so #1 slow. The same setting in the other American form is 9-1-24-6-4, the 4 being the motion indicator for 231 (FSW, p. 20). On the replica: turn the motion knob to 4 (231), and press SET on each switch until the displays read 9, 1, 24 and 6.
12.4 From the Date to the Alphabet
The daily alphabet came from a book of 1,000 basic alphabets, “arranged as 50 pages with 20 lines per page”, which was then permuted before use. In December 1941 the rule was (FSW, p. 21):
- Add the month and the day to get the page.
- Starting from the bottom line, count up one line for each day of the month (subtracting 20 from days after the 20th).
- Apply the month’s permutation key to that line’s basic alphabet.
For 6 December 1941: page 12 + 6 = 18; six lines up from the bottom of a 20-line page is line 15; and line 15 of page 18 was the basic alphabet SUQDIAKXZVYGMLOJRENFWPTHBC. The permutation key, a list of 26 positions, says which letter of the basic alphabet goes in each place of the final one:
19 15 07 23 11 02 08 18 03 14 24 25 17 13 22 04 05 26 16 06 01 10 21 12 09 20
The 19th letter of the basic alphabet is N, so the final alphabet starts with N; the 15th is O; the 7th is K; and so on. The result is
NOKTYU XEQLHBRMPDICJASVWGZF
The first six letters go to the sixes, the other twenty to the twenties. Freeman, Sullivan and Weierud note that the permutation “is arranged to place the alphabet in the proper AEIOUYBCDFG…Z sequence” — that is, the final alphabet is read straight across onto the machine’s sockets in the order A E I O U Y B C D F … Z. They add that some stations used a different permutation, and that the permutations changed from time to time, “the result was that the effective number of alphabets was much greater than 1,000.”
A caution about plugboards. The Japanese plugboard and the American analog’s were laid out differently, so a Japanese alphabet had to be converted, letter position by letter position, before it could be plugged into the analog; Freeman, Sullivan and Weierud give both layouts, and use the SIS form throughout (FSW, p. 6). Every alphabet in this unit, including the one above, is already in SIS form, which is the form the replica uses.
12.4.1 Plugging it
On the replica’s stereo-cord plugboard (Volume 10), the alphabet is plugged by reading it straight across against the machine sockets: typewriter letter N into machine socket A, O into E, K into I, T into O, Y into U, U into Y, then X into B, E into C, Q into D, and so on to F into Z. Twenty-six cords, and both plugboards are set.
12.5 Deciphering Part 1
12.5.1 The intercept
The US Navy intercept station at Bainbridge Island, Washington, took Part 1 down at 1300 GMT on 6 December 1941. Its preamble reads S352/6 1000S GR265 — 265 groups — followed by OBESE OVALS TIARA ..OME, which Weierud reads as code words for Tokyo and Washington. Only 262 groups survive in the archive copy, whose teleprinter paper is torn along the last line; where the copy is unreadable the transcript has a dot, and where the operator marked letters as uncertain, a hyphen (CryptoCellar transcript). The text after the indicator begins:
ZTXOD NWKCC MAVNZ XYWEE TUQTC IMNVE UVIWB LUAXR RTLVA RGNTP CNOIU PJLCI …
With the machine set to 9-1,24,6-23 and plugged NOKTYU XEQLHBRMPDICJASVWGZF, typing those letters prints:
FOVTA TAKID ASINI MUIMI NOMOX IWOIR UBESI FYXXF CKZZR DXOOV BTNFY XFAEM
These are the first 60 letters of the simulator’s decipherment, and they agree with the plaintext Freeman, Sullivan and Weierud print and with Weierud’s note that “the first four groups of plain text are FOVTA TAKID ASINI MUIMI.” Volume 4 traces the first ten of these letters switch by switch; the simulator’s --trace option does the same for any letter.
12.5.2 Reading the plaintext
The plaintext is not English, nor quite Japanese. Diplomatic texts were prepared under conventions the codebreakers had to learn alongside the machine (FSW, pp. 23–24):
- Romanisation. Japanese was written in the older rōmaji spelling (si for shi, ti for chi, tu for tsu, zi for ji), and the pairs ai and ei were often contracted to the single letters L and X, so that taishi (“ambassador”) would be sent as TLSI. Near its start Part 1 has MOXI where the same word is later spelled MOJI; Freeman, Sullivan and Weierud read both as moji, “letters”.
- Three-letter codes for punctuation and layout, each containing an F: CFC for a full stop, LFL for a comma, FOV and FYX for opening and closing parentheses, XFC for “number”, FAE and FIO to begin and end a passage spelled in a foreign language.
- Shorthand code groups for common words, often the Japanese word with its vowels removed: BTN for betuden, “separate telegram”; and doubled letters for numerals, such as KZ and ZR.
Read with those conventions, the start of Part 1 is FOV tatakidasi ni muimi no moxi wo iru besi FYX: “(to be typed out into meaningless letters)”. Freeman, Sullivan and Weierud, who translated it with Kayoko Weierud’s help, suggest it may be deliberate padding to hide a stereotyped beginning, since it comes before the message number (FSW, p. 27). Then come XFC KZ ZR DX — “number 902” with a garble in the last group — the separate-telegram reference FOV BTN FYX, and, after the foreign-spelling marker FAE, the English the embassy was to hand to the US government:
FAEME MORAN DUMFI OFOVO OMOJI BAKAR IFYXR AICCY LFCBB CFCTH EGOVE -NMEN TOFJA PANLF LPROM PTEDB YAGEN UINED ESIRE TOCOM ETOAN AMICA BLEUN DERST ANDIN -WITH THEGO VERNM ENTOF THE-N ITEDS TATES INORD ERTHA TTHET WOCOU NTRIE SBYTH EIRJO INTEF FORTS MAYSE CURET HEPEA CEOFT HEPAC IFICA REA
(Letters 57 to 294 of the simulator’s output, regrouped in fives from letter 57.) That is BFS MEMORANDUM EFS, “(capitals only)”, then a sub-paragraph mark, and “The Government of Japan, prompted by a genuine desire to come to an amicable understanding with the Government of the United States in order that the two countries by their joint efforts may secure the peace of the Pacific area …” — the opening of the note Ambassador Nomura and Special Envoy Kurusu delivered to Secretary of State Hull on the afternoon of 7 December 1941 (Volume 7).
12.5.3 Garbles and errors
The hyphens in the plaintext — GOVE-NMENT, UNDERSTANDIN-, THE-NITED — are the letters the intercept operator could not read. The machine deciphers each garble as nothing, but steps, so that the letters after it stay in step. On the replica the garble key does the same: it steps the switches and prints a hyphen. A dropped garble, by contrast, puts everything after it one letter out, and the plaintext turns to nonsense at that point; the cure is to try inserting a garble where the sense fails.
Some errors survive into the plaintext even with every cipher letter read correctly. Further into Part 1 the simulator prints QOVERNMENX for GOVERNMENT, UERSISTENTLY for PERSISTENTLY and WORLZ for WORLD. These are faithful decipherments of what was intercepted: letters garbled in transmission without being marked, each producing one wrong plaintext letter, because a PURPLE error does not propagate. The analysts read through them as a reader reads through typing errors.
Part 1’s last groups are torn away in the archive copy. The surviving end deciphers to ITALYC- - - OV, which Freeman, Sullivan and Weierud read as ITALY CFC FOV; the missing three groups probably carried the “one of fourteen” marker, JYN NO BB FYX, which appears in the decipherments of Parts 2 and 3 (FSW, p. 28).
12.6 Enciphering a New Message
Enciphering follows the same steps in the other direction, with the replica’s mode switch at ENCIPHER.
Preparing the plaintext. Write the text in the clerks’ conventions: punctuation codes, foreign-spelling markers, rōmaji. For a practice message in English, the text “test message. the analog is ready.” becomes
FAETESTMESSAGEFIOCFCTHEANALOGISREADYCFC
— begin foreign spell, TEST MESSAGE, end foreign spell, full stop, THE ANALOG IS READY, full stop. Thirty-nine letters.
Choosing a key. A real clerk drew the day’s alphabet from the book and an indicator from the list. The indicator list itself (Freeman, Sullivan and Weierud’s Appendix A) is not reproduced in the copy of their paper used here, so the practice key borrows a setting the paper does give: the starting point of their second worked message, sixes 13, twenties 25, 23, 12, motion 321 — 13-25,23,12-32 — with the 6 December alphabet. On the replica: motion knob to 6 (321), switches set to 13, 25, 23, 12, cords as for Part 1.
Enciphering. Typing the 39 letters prints
SJEOD IUXBC HLLIJ LKLRX TZHDU EAKBD HWRAE KGXM
and setting the same key and deciphering those letters gives the plaintext back. Two properties of the machine are visible even in so short a text. The third letter, E, enciphers as itself, which PURPLE allows and Enigma did not. And the double S of MESSAGE enciphers as two different letters, C and H, because PURPLE never gives the same cipher letter twice running for the same plain letter (Volume 4).
Padding and the indicator. The clerk filled the last group to five letters with random letters, and put the disguised indicator at the head. The disguise is simple arithmetic: a practice indicator of 73159 — one of the all-odd indicators Freeman, Sullivan and Weierud cite as an example — transposed BEDAC is 39571, and with the December additive becomes 42781. (Which switch setting 73159 stood for is not known here, so this indicator illustrates only the arithmetic, not the key above.)
12.6.1 Bisection
From 20 August 1941 every PURPLE user was told to make messages harder to crib by splitting them. Freeman, Sullivan and Weierud describe the rule: the sender began enciphering in the middle of the plaintext, inserted “DDDD” at the end of the original message to mark the end of part two of two, then continued with the beginning of the original message up to the split point, added “DDBB” to mark the end of part one of two, and filled out the last group with random letters (FSW, p. 28). For the practice message split after MESSAGE, the clerk would encipher
FIOCFCTHEANALOGISREADYCFC DDDD FAETESTMESSAGE DDBB
as one run on the machine. The rule hid the stereotyped openings — message numbers, “The Japanese Government requests …” — that had given SIS so many cribs. It came too late: by then the starting points were known and half the alphabets recovered, and DDDD and DDBB were themselves cribs.
12.7 How the Americans Ran It
On the American side, reading PURPLE was a production line, not a puzzle. The Cryptologic Quarterly history gives the recipe the analysts worked from: subtract the dated additive from the indicator, and if the result is one of the 120, the message is PURPLE; check the special instructions in force; select the plugboard sequence for the date and plug it; and set the starting points and the selector motion from the table of indicators. “The unsolvable problem had been reduced to a mechanical exercise” (CQ, p. 75). As of 1 April 1941, the same history says, 99 per cent of intercepted traffic could be read. The Japanese transmitted their own forthcoming changes to the system in PURPLE, “Thus, the analysts were kept well posted on indicator additives or selector starting points.”
Speed was the remaining problem. In November 1944, at Frank Rowlett’s request, a study of 100 messages chosen at random found an average deciphering time of 1.5 hours; leaving out four with garbled indicators or text, which had taken 17, 12, 12 and 4 hours, the average fell to 42 minutes (FSW, p. 29). “U.S. cryptanalysts were able to decipher PURPLE messages almost as rapidly as the Japanese recipients were.”

12.8 How the Japanese Kept Changing It
The Japanese did change their procedures, repeatedly, and every change was eventually overcome. By July 1943 American analysts recognised four sets of rules, each with its own designator: JAA for regular traffic, JAB for “super secret messages of state”, JAC for code and cipher instructions, and JAD for the HIKAL traffic between Berlin and Tokyo. HIKAL messages took their starting points from the original list of 120 but modified them, for instance by reading the switch positions down a column of the list instead of across. All four used the same hardware and all were read (FSW, pp. 20, 29).
Two later systems caused real delays.
- JAA-1, on the Tokyo–Moscow circuit from 10 September 1944, used a five-letter indicator, whose letters’ positions in the message alphabet gave the switch positions; its alphabets were permuted by the next line of the book instead of a fixed key. A few messages broken, the rule was found.
- JAA-2, from April 1945, took new starting positions for every message from the indicator groups of an obsolete code. Finding a starting position by hand took about a week. The answer was machinery: an IBM card reproducer connected to a PURPLE analog printed every one of PURPLE’s starting positions onto cards in about a day, and the card file cut the search from a week to fifteen minutes (FSW, pp. 29–30).
That last episode closes the circle that Leo Rosen opened in 1940. A machine reconstructed from its ciphertext, built from telephone parts, ended the war wired to a punched-card machine, generating its own key tables faster than the people who designed it could use them.
12.9 Running the Replica: A Checklist
- Self-test. Power up; the controller runs its checks and shows the four positions.
- Mode. ENCIPHER or DECIPHER.
- Alphabet. Plug the 26 cords from the day’s alphabet, read straight across onto A E I O U Y B C D F … Z. Check the six sixes cords are in the coloured sockets.
- Motion. Turn the knob to the motion indicator (1 to 6).
- Positions. SET each switch to its starting position; check the displays.
- Text. Type the text; use the garble key for every unreadable letter of a ciphertext.
- Check. For any message whose plaintext is known — Part 1 above, or the practice message — compare the log with
purple_sim.py --log(Volume 11).
Back to the beginning — Volume 1: PURPLE — The Machine Nobody Saw. The machine, the people who rebuilt it without seeing it, and the twelve volumes of this series.
Comments (0)