thumb|Analog of the Japanese Type B Cipher Machine (codenamed Purple) built by the U.S. Army [[Signal Intelligence Service]]
thumb|Purple analog equipment in use
The "System 97 Typewriter for European Characters" (九七式欧文印字機 kyūnana-shiki ōbun injiki) or "Type B Cipher Machine", codenamed Purple by the United States, was an encryption machine used by the Japanese Foreign Office from February 1939 to the end of World War II. The machine was an electromechanical device that used stepping-switches to encrypt the most sensitive diplomatic traffic. All messages were written in the 26-letter English alphabet, which was commonly used for telegraphy. Any Japanese text had to be transliterated or coded. The 26-letters were separated using a plug board into two groups, of six and twenty letters respectively. The letters in the sixes group were scrambled using a 6 × 25 substitution table, while letters in the twenties group were more thoroughly scrambled using three successive 20 × 25 substitution tables.
The cipher codenamed "Purple" replaced the Type A Red machine previously used by the Japanese Foreign Office. The sixes and twenties division was familiar to U.S. Army Signals Intelligence Service (SIS) cryptographers from their work on the Type A cipher and it allowed them to make early progress on the sixes portion of messages. The twenties cipher proved much more difficult, but a breakthrough in September 1940 allowed the Army cryptographers to construct an analog machine that duplicated the behavior of the Japanese machines, even though no one in the U.S. had any description of one. The Ministry of Foreign Affairs was supplied Red and Purple by the Navy. No one in Japanese authority noticed the weak points in both machines.
Prototype of Red
thumb|Japanese Type A (RED) cipher machine
Japanese diplomatic communications at negotiations for the Washington Naval Treaty were broken by the American Black Chamber in 1922, and when this became publicly known, there was considerable pressure to improve their security. The Japanese Navy had already planned to develop their first cipher machine for the following London Naval Treaty; Japanese Navy Captain Risaburo Ito, of Section 10 (cipher & code) of the Japanese Navy General Staff Office was selected to supervise the work.
The development of the machine was the responsibility of the Japanese Navy Institute of Technology, Electric Research Department, Section 6. In 1928, the chief designer Kazuo Tanabe and Navy Commander Genichiro Kakimoto developed a prototype of Red, "Roman-typewriter cipher machine".
The prototype used the same principle as the Kryha cipher machine, having a plugboard, and was used by the Japanese Navy and Ministry of Foreign Affairs at negotiations for the London Naval Treaty in 1930.
Red
The prototype machine was finally completed as "Type 91 Typewriter" in 1931. The year 1931 was year 2591 in the Japanese Imperial calendar. Thus it was prefixed "91-shiki" from the year it was developed.
The 91-shiki injiki Roman-letter model was also used by the Ministry of Foreign Affairs as "Type A Cipher Machine", codenamed "Red" by United States cryptanalysts.
The Red machine was unreliable unless the contacts in its half-rotor switch were cleaned every day. A significant weak point was that it enciphered vowels (AEIOUY) and consonants separately, perhaps to reduce telegram costs. there were electric typewriters at either end, similar to those used with the Type A Machine. The Type B was organized for encryption as follows:
- An input typewriter
- An input plugboard that permutes the letters from the typewriter keyboard and separates them into a group of 6 letters and a group of 20 letters
- A stepping switch with 6 layers wired to select one out of 25 permutations of the letters in the sixes group
- Three stages of stepping switches (I, II, and III), connected in series. Each stage is effectively a 20 layer switch with 25 outputs on each layer. Each stage selects one out of 25 permutations of the letters in the twenties group. The Japanese used three 7-layer stepping switches geared together to build each stage (see photos). The U.S. SIS used four 6-layer switches per stage in their first analog machine.
- An output plug board that reverses the input permutation and sends the letters to the output typewriter for printing
- The output typewriter
For decryption, the data flow is reversed. The keyboard on the second typewriter becomes the input and the twenties letters pass through the stepping switch stages in the opposite order.
Stepping switches
A stepping switch is a multi-layer mechanical device that was commonly used at the time in telephone switching systems. Each layer has a set of electrical connects, 25 in the Type B, arranged in a semicircular arc. These do not move and are called the stator. A wiper arm on a rotor at the focus of the semicircle connects with one stator contact at a time. The rotors on each layer are attached to a single shaft that advances from one stator contact to the next whenever an electromagnet connected to a ratchet is pulsed. There are actually two wiper arms on each level, connected together, so that when one wiper advances past the last contact in the semicircle, the other engages the first contact. This allows the rotor connections to keep cycling through all 25 stator contacts as the electromagnet is pulsed.
Knowing the plaintext of 6 out of 26 letters scattered throughout the message sometimes enabled parts of the rest of the message to be guessed, especially when the writing was highly stylized. Some diplomatic messages included the text of letters from the U.S. government to the Japanese government. The English text of such messages could usually be obtained. Some diplomatic stations did not have the Type B, especially early in its introduction, and sometimes the same message was sent in Type B and in the Type A Red cipher, which the SIS had broken. All these provided cribs for attacking the twenties cipher.
William F. Friedman was assigned to lead the group of cryptographers attacking the B system in August 1939. A pair of other messages using indicator 59173 were decrypted by 27 September, coincidentally the date that the Tripartite Agreement between Nazi Germany, Fascist Italy, and Imperial Japan was announced. There was still a lot of work to do to recover the meaning of the other 119 possible indicators. As of October 1940, one third of the indicator settings had been recovered.
The Japanese believed Type B to be unbreakable throughout the war, and even for some time after the war, even though they had been informed otherwise by the Germans. In April 1941, Hans Thomsen, a diplomat at the German embassy in Washington, D.C., sent a message to Joachim von Ribbentrop, the German foreign minister, informing him that "an absolutely reliable source" had told Thomsen that the Americans had broken the Japanese diplomatic cipher (that is, Purple). That source apparently was Konstantin Umansky, the Soviet ambassador to the US, who had deduced the leak based upon communications from U.S. Undersecretary of State Sumner Welles. The message was duly forwarded to the Japanese; but use of the code continued and American cryptographers continued to read Japanese messages through the war.
American analogs
The SIS built its first machine that could decrypt Purple messages in late 1940. A second Purple analog was built by the SIS for the US Navy. A third was sent to England in January 1941. That Purple analog was accompanied by a team of four American cryptologists (two Army, two Navy) who received information on British successes against German ciphers in exchange. This machine was subsequently sent to Singapore, and after Japanese moves south through Malaya, on to India. A fourth Purple analog was sent to the Philippines and a fifth was kept by the SIS. A sixth, originally intended for Hawaii, was also sent to England for use there.
Apparently, all other Purple machines at Japanese embassies and consulates around the world (e.g. in Axis countries, Washington, London, Moscow, and in neutral countries) and in Japan itself, were destroyed beyond recognition by the Japanese. American occupation troops in Japan in 1945–52 searched for any remaining units. A complete Jade cipher machine, built on similar principles but without the sixes and twenties separation, was captured and is on display at NSA's National Cryptologic Museum.
Impact of Allied decryption
The Purple machine itself was first used by Japan in June 1938, but American and British cryptanalysts had broken some of its messages well before Japan's December 1941 attack on Pearl Harbor. US cryptanalysts decrypted and translated Japan's 14-part message to its Washington embassy to break off negotiations with the United States at 1 p.m., Washington time on 7 December before the Japanese Embassy in Washington had done so. Decryption and typing difficulties at the embassy, coupled with ignorance of the importance of it being on time, were major reasons for the "Nomura Note" to be delivered late.
During World War II, the Japanese ambassador to Nazi Germany, General Hiroshi Oshima, was well-informed on German military affairs. His reports went to Tokyo in Purple-enciphered radio messages. One had a comment that Hitler told him on 3 June 1941 that "in every probability war with Russia cannot be avoided." In July and August 1942, he toured the Eastern Front, and in 1944, he toured the Atlantic Wall fortifications against invasion along the coasts of France and Belgium. On 4 September, Hitler told him that Germany would strike in the West, probably in November.
Since those messages were being read by the Allies, they provided valuable intelligence about German military preparations against the forthcoming invasion of Western Europe. He was described by General George Marshall as "our main basis of information regarding Hitler's intentions in Europe."
The decrypted Purple traffic and Japanese messages generally were the subject of acrimonious hearings in Congress after World War II in connection with an attempt to decide who, if anyone, had allowed the attack at Pearl Harbor to happen and so should be blamed. It was during those hearings that the Japanese for the first time learned that the Purple cipher machine had indeed been broken. (See the Pearl Harbor advance-knowledge conspiracy theory article for additional detail on the controversy and the investigations.)
The Soviets also succeeded in breaking the Purple system in late 1941, and together with reports from Richard Sorge, learned that Japan was not going to attack the Soviet Union. Instead, its targets were southward, toward Southeast Asia and American and British interests there. That allowed Stalin to move considerable forces from the Far East to Moscow in time to help stop the December 1941 German push to Moscow as part of the Reich's Operation Barbarossa invasion of the Soviet Union.
References
Further reading
- Big Machines, by Stephen J. Kelley (Aegean Park Press, Walnut Creek, 2001, ) – Contains a lengthy, technically detailed description of the history of the creation of the PURPLE machine, along with its breaking by the US SIS, and an analysis of its cryptographic security and flaws
- - Appendix C: Cryptanalysis of the Purple Machine
- Clark, Ronald W. "The Man Who Broke Purple: the Life of Colonel William F. Friedman, Who Deciphered the Japanese Code in World War II", September 1977, Little Brown & Co, .
- Combined Fleet Decoded by J. Prados
- The Story of Magic: Memoirs of an American Cryptologic Pioneer, by Frank B. Rowlett (Aegean Park Press, Laguna Hills, 1998, ) – A first-hand memoir from a lead team member of the team which 'broke' both Red and Purple, it contains detailed descriptions of both 'breaks'
External links
- The Japanese Wikipedia article on the Type B machine has much technical information including the substitution tables, detailed stepping algorithm, punctuation codes and a sample decryption. It also has reactions from Japanese sources to the American decryption. Entering the website link https://ja.wikipedia.org/wiki/パープル暗号 into Google Translate and clicking "Translate this page" will provide a serviceable English translation.
- Red and Purple: A Story Retold NSA analysts' modern-day attempt to duplicate solving the Red and Purple ciphers. Cryptologic Quarterly Article (NSA), Fall/Winter 1984–1985 – Vol. 3, Nos. 3–4 (last accessed: 22 August 2016).
- A web-based Purple Simulator (last accessed: 10 February 2019)
- A Purple Machine simulator written in Python
- A GUI Purple Machine simulator written in Java
- Purple, Coral, and Jade
- The Purple Machine Information and a simulator (for very old Windows).
