IB Extended Essay: Allied Codebreaking During World War II

Table of Contents
Abstract
Introduction
The Pacific Theatre
The European Theatre
Further Analysis and Conclusion
Illustrations
Works Cited

Abstract
What role did Allied codebreakers have in the outcome of World War II? Though cryptography did not decide the outcome of World War II, it was very successful in shortening the war. In the Pacific theatre, the Americans broke several codes, including the PURPLE and JN25 codes. Though they were unable to anticipate the Pearl Harbor attack, codebreaking did benefit the Americans at the Battle of Midway and with the assassination of Yamamoto. In Europe, the Allies worked together against Germany to break the ENIGMA naval code, allowing the Allies to maintain superiority in the Battle of the Atlantic. Breaking the Japanese and German codes allowed the Allies to gain an advantage in both theatres, bringing about a resolution to the war. From World War II, it is clear that cryptography is important even during peacetime, for one can never know the true intentions of any government.

Allied Code Breaking During World War II

Introduction
The adage 'knowledge is power' certainly applies to war. As opposing forces battle against each other, knowledge of the enemy - quantity of troops and their whereabouts, weapons, tactics, et cetera - as well as technological advances and scientific breakthroughs, become a priceless commodity. Knowledge is used as a two-edged sword, as one seeks to maximize one's own knowledge about the enemy, while preventing the enemy from gaining knowledge of him. Before the first battles of World War II were even fought, the 'war of information', codebreaking, and espionage had already begun. More than any previous war, the cryptanalysts played a major role in gathering secret information. Americans and other allied code breakers broke the Japanese PURPLE and JN25 codes, and the German ENIGMA code, giving the Allies crucial information and an important advantage over the Axis powers. Though code breaking does not win wars in and of itself, it certainly helps to shorten wars, as was the case for the Allied troops in World War II.

A few terms are important to understanding codebreaking. First, cryptology is the general study of codes. It comprises cryptography and cryptanalysis. Cryptography, in its technical sense, means the art or science of making codes. However, it is used loosely to refer to all things relating to codes. Cryptanalysis is the predominantly mathematical study of breaking codes. Plaintext is a term that refers to the unencrypted, readable contents of a message. Plaintext, when enciphered, becomes ciphertext. It is common convention to break ciphertext into five-letter blocks, so that the length of words gives no information away. The last block, if partial, is completed with X'es. Lastly, the term channel refers to a specific code, and the path that messages encrypted with that code travel. For example, the United States (US) broke the channel between Tokyo and the Japanese Embassy in Washington, which used the PURPLE code ("Cryptography FAQ Index").

In the past few years, cryptography has come into the limelight. Many of the sources of this paper have been published very recently. As computers and access to information become more ubiquitous, people are realizing the importance of keeping certain information secret and confidential. Good cryptosystems are what allow the use of credit cards, and keep medical records private. Cryptography is even receiving attention from popular culture. Cryptonomicon is an acclaimed novel by Neal Stephenson, which tells a dramatized account of cryptanalysts during World War II. Also, a movie based on a fictionalized account of capturing an ENIGMA machine, titled U-571 is being produced. David Kahn, author of The Codebreakers and Seizing the Enigma has gained a reputation as one of the most knowledgeable historians of cryptography. Interestingly, authors from Allied countries, such as Kahn, an American, or Singh, a British, attribute any cryptographical mistakes to insufficient funding. Only Kamatsu, a Japanese, criticizes Allied cryptanalysts by attributing the breakdown of US-Japanese negotiations to incorrect translations of MAGIC. This disparity might imply a nationalistic subjectivity on the part of the historians. Other disparities exists in more minor issues, such as whether PURPLE (supported by Prados) was a more difficult code to break than ENIGMA (supported by Kahn and Singh). Yet arguments in the sources, whether by Komatsu or Kahn, are substantiated, though not necessarily the only possible perspective through which to interpret these events.

Before World War II, cryptography played an increasing role in gathering information. In Britain, the British cryptanalytic bureau (called Room 40) captured the German Naval codebook in 1914. This even allowed them to read much of Germany's communication during World War I, including the famous Zimmerman telegram, which became a reason for the US to enter the war (Kahn, Codebreakers 266-298). In the US, Truman founded the US Cipher Bureau following World War I. Headed by Yardley, it was successful in breaking many European and South American codes. However, it's funding was severely cut in 1924, and later Secretary of State Stimson cut all funding, saying "gentlemen do not read other gentlemen's mail" (357-360). Though this may have been a time of openness and trust in society, it will become clear from World War II that national security and intelligence gathering is as important during peacetime as during war.

The Pacific Theatre
In the Pacific, US code breaking against the Japanese began early. In the 1920's, US Navy cryptanalysts had broken the Japanese diplomatic ORANGE code and later broke the more difficult RED code (Kahn, Codebreakers 20). In 1939, Japan switched to the PURPLE code, one of the most complicated codes of World War II - even more complex than the German ENIGMA code, according to Prados (163). However, Americans cryptanalysts had a few clues about how to break the cipher, such as the formal language Japanese commanders used in their messages. This formality was exploited by codebreakers, who could generally guess the opening and closing of the messages, giving them clues about the nature of the code. Second, on the day Japan changed from the RED to the PURPLE code, many diplomats enciphered their messages with both codes, allowing US cryptanalysts to match several plaintext messages with their PURPLE ciphertext ("Secrets of War"). With this, the US Army Signal Intelligence Service (SIS), under the direction of Chief Cryptanalyst Friedman, went to work on PURPLE. The project was under-funded, but the Navy offered to fund the effort and take over the usual work of the SIS so it could focus on PURPLE. Cryptanalyst eventually proved that the code was based on a system of electrical switches, rather than a conventional rotor system. With this, the SIS set up a complex system of telephone switches to simulate the machine, and was able to solve the rest of the code by trial and error. The Army's Chief Signal officer, Gen. Mauborgne, referred to these codebreakers as "magicians" and their product as MAGIC (Prados 163-165).

Eighteen months later, in September of 1940, PURPLE intercepts were being decrypted, marking one of the greatest cryptographical achievements in history. It is also significant because it was broken using mathematical associations and rigor rather than linguistic analysis (Prados 164-165). This paradigm shift from linguistics (used on codes that enchiphered words as a single unit) to mathematics (used on codes that enciphered each letter) was significant to World War II cryptology. But why then, if the US was reading Japan's diplomatic messages, did the US fail to anticipate the attack on Pearl Harbor that December? Though this question is still a point of contention for historians, David Kahn seems to provide the best explanation for the Pearl Harbor attack in Codebreakers. Due to budget restraints, the US Army only produced 5 PURPLE machines. One was originally to be shipped to Hawaii, but was instead sent to Britain as part of a cryptographical information exchange between the US and Britain. Thus, Hawaii had no means of deciphering PURPLE messages, though it did have information of a substantial Japanese Navy build-up though other channels (1-67). Komatsu, in his book on the origins of the war and MAGIC, blames "mistranslations or distortions of MAGIC" for the strained Japanese-US relations, and both sides had contingencies firmly opposed to negotiation and demanded more aggressive action (247-9). Many Japanese diplomats claimed that negotiations with the US were "at an impasse", and at 1:28 a.m. December 7, 1941, a Navy radio station in Seattle intercepted a message from Tokyo to the Japanese Embassy in Washington. The message stated that the Ambassador was to

"Submit to the United States Government (if possible to the Secretary of State) our reply [to end all formal negotiations] at 1:00 p.m. on the 7th."

So, the US knew that the Japanese intended on ending formal negotiations, inevitably leading to war, and of the Japanese Naval forces building near Hawaii. Is this conclusive evidence to prove a major offensive attack on Pearl Harbor at 2:00 p.m. the same day? Kahn maintains that the Navy Signal officers made no error in deciphering and relaying information, as opposed to Komatsu. No American military officials realized that the Japanese would be so quick to seek an advantage in their inevitable war with the US. Pearl Harbor showed the US military the importance of code breaking. The information to prevent the devastating attack on Pearl Harbor was at their fingertips, and this was a mistake that the US would not repeat in the war (Komatsu, 247-284).

Following Pearl Harbor, the cryptologic unit of the US Navy Security Section (OP-20-GY) surpassed the Army SIS in onus ("Secrets of War"). In 1940, the Japanese Navy switched to a code known as JN25. This code was based on a codebook, in which each Japanese word was given a 5-digit numerical code. On top of that, the message was encrypted with a numerical key before it was sent, so that the decoder needed both the key, and the codebook to decipher the message. Further, the Japanese Navy issued several revised editions of this code, to make it more secure. Without the key or the codebook, American cryptanalysts made little progress in breaking the code. They made significant inroads when the US broke into the Japanese embassy in Washington and photographed many of the codebooks ("Secrets of War"). Also, by exploiting insecurities in the physical distributions of these codebooks, and plundering wreckage, the US Navy was able to recover about a third of the B edition lexicon (Kahn, Codebreakers 567).

US cryptanalysts are generally considered to have broken the code by January of 1942. Interestingly, some conspiracy theorists think that the British had broken the code much earlier, and knew of the Pearl Harbor strike. These theorists say that Britain did not divulge this information so that the US would have more reason to enter into World War II on the side of the Allies. However, many historians consider this to be unlikely because of the extent of which Britain did share the results of her code breaking efforts ("Secrets of War").

With the JN25 code sufficiently broken, OP-20-GY began to use its deciphered information to aid in the US war effort. Perhaps their greatest contribution to World War II resulted in the US victory at the Battle of Midway. In April and May of 1942, US cryptanalysts learned of a massive offensive being planned at a location simply called 'AF' by the Japanese. The Japanese would have a small diversionary strike on the Aleutian Islands, and then attack with the majority of her Navy on 'AF'. Admiral Nimitz and other military and cryptological advisors suspected Midway Island as the target 'AF', so they sent the message 'Midway is short on fresh water' through a channel that was known to be broken by the Japanese. Fortunately for the Americans, a few days later codebreakers read a Japanese message stating 'AF is short on fresh water', confirming their suspicions. As a result, the US ignored the diversion in the Aleutians, and caught the Japanese Navy off guard at Midway (Kahn, Codebreakers 567-573). In the battle, the Japanese lost four carriers and 3500 men, while the US only lost only one carrier and 307 men. This victory gave the US the advantage in the Pacific theatre. Admiral Nimitz said that the victory at Midway "was essentially a victory of intelligence," giving credit to the cryptanalysts who provided his information (Singh 191-192). After Midway, Japanese military leaders suspected that their naval codes had been compromised, but considered this possibility too outrageous, and instead attributed it to chance. They continued to use the same compromised codes ("Secrets of War").

Another great achievement in the Pacific attributed to US codebreakers was the assassination of Admiral Yamamoto, the Japanese Commander in Chief. Cryptanalysts informed Nimitz when they received information that Yamamoto's plane would be flying within the attack range of fighter planes at Henderson Field on Guadalcanal Island. However, Yamamoto would be at the very end of their range, making it an extremely risky mission. However, Singh describes Yamato as renowned for being "compulsively punctual" (191), so Nimitz felt confident that they could successfully attack the plane even though fuel limitations gave them little room for error. But more importantly, would the Japanese realize that the US had been reading their mail? Would they believe that US fighter planes just happened to stumble on Yamamoto's plane at the end of his fuel range? Probably not, but Nimitz was willing to take the risk. Thus, on May 12, 1943, eighteen P-38 fighters engaged and successfully destroyed Yamamoto's plane (Kahn, Codebreakers 595-603). And, as Nimitz and his codebreakers predicted, the Japanese did suspect that codes had been broken. But they assumed that different, less significant codes had been compromised, so they continued to use their primary naval codes ("Secrets of War"). Nimitz's decision represents one of the core principles of cryptography, which is the balance of using knowledge gained through codebreaking and keeping the enemy from knowing that the codes are broken. In this case, Nimitz chose to use the information to kill Yamamoto and risk the Japanese realizing their codes had been broken, and subsequently changing the codes. Fortunately for the US, this choice worked out to their advantage.

Yamamoto's death had a sweet irony for US Navy codebreakers. They had used their codebreaking skills to defeat the man who had caught them off guard at Pearl Harbor. In summary, US codebreakers were an excellent aid to the Army and Navy forces fighting in the Pacific theatre. As examples of their contributions, they played key roles in the Battle of Midway and the assassination of Yamamoto. Their efforts in breaking the PURPLE and JN25 codes are famed to be among the best cryptological achievements in history.

The European Theatre
By far, the most significant codebreaking feat in the European theatre was the breaking of the ENIGMA cipher machine, used by German U-boats. In terms of secrecy and availability of public information after the war, this German cipher differs from those broken in the Pacific. Much of the classified information regarding the MAGIC secret in the Pacific was declassified soon after the war. Perhaps because Nazi Germany was viewed as a more threatening enemy than the Japanese, the public did not learn about the ENIGMA machine until the last functional ENIGMA machine physically wore out. Only then did the British government allow The Ultra Secret to be published, detailing the story of the ENIGMA. The breaking of the ENIGMA machine had a tremendous impact on the outcome of the war. The New York Times reviewed The Ultra Secret as "the greatest secret of World War II after the atom bomb" (Kahn, Codebreakers 979). Churchill said "the Battle of the Atlantic was the dominating factor all throughout the war." The breaking of ENIGMA allowed allies to read messages between German U-boats at sea and Berlin, mitigating the U-boat threat to precious allied convoys (Singh, 143).

Scherbius, the inventor of the ENIGMA machine, initially had trouble selling his idea to the German military. It was not until 1925, when Germans discovered that the British had broken their codes in World War I that they decided to implement the expensive, but extremely secure, ENIGMA (Singh, 141-142). In 1914, the German cruiser Magdeburg ran aground, and in haste to abandon ship, only destroyed three of their four copies of the German naval codebook. The Russians subsequently recovered the codebook, and turned it over to the British, who conveniently monitored the majority of German naval traffic throughout the war. British cryptanalysis also decoded the famous Zimmerman telegram, a major factor in the US decision to enter the war. Germany did not realize the cause of her naval frustrations until Churchill made public the dramatic tale of the Magdeburg. Germany now knew the importance of having a strong cryptosystem (Kahn, Codebreakers 972).

The ENIGMA machine was amazingly complicated and is considered to be the most secure encryption system at that time. Because of its mechanical and electrical nature, there was less room for human error, a problem that had plagued cryptosystems of the past. It worked on a system of rotors, which had been used for many modern cryptosystems at the time, yet never had the machines been as complex as the ENIGMA. Based on Albeti's cipher disc, ENIGMA was invented in 1918 by German inventors Scherbius. To encode a message with the machine, the operator would type the plaintext message into the typewriter-style keyboard, which would send an electrical impulse through the scrambling unit, and finally illuminate the corresponding ciphertext character on the display board.

The scrambling unit is appropriately the most complex part of the machine. To construct the scrambling unit, the operator chooses three of eight rotors. Each rotor has 52 electrical connections, 26 on each side (corresponding to every letter of the alphabet). Within each rotor is a fairly complex wiring system. Each letter on one side of each rotor was electrically wired to a different letter on the other side. The eight different rotors have unique internal wiring. After a plaintext letter is typed, an electrical signal travels through the complex electrical path formed by the rotors, then through a reflector (a one-sided, stationary rotor that reflects the signal back through a different path), and the ciphertext character is finally displayed (see Figure 1). Though the reflector does not increase the strength of the cryptosystem because it is static, it does make the decryption process much easier for the receiver.

After this process is complete, the first rotor rotates a single position, so that the next letter will travel a new path. After the first rotor has completed a full revolution, the second rotor will rotate one position, like the odometer of a car. The rotation and complexity of the rotors is the primary reason for the strength of the cryptosystem. However, the Germans wanted a cryptosystem that could not be broken even if the enemy possessed a replica of the machine. The current weakness of the machine was that there were relatively few starting positions for the rotors. Thus, Scherbius added a plug board, in which the operator could connect pairs of letters to be switched before going through the rotors. The rotors and their starting positions, in addition to the plug board settings, formed the "key" for encrypting with ENIGMA. With the addition of the plug board, there were over 1016 different keys, or starting positions, so it was infeasible for the enemy to check every key even if they possessed the machine. The key settings were determined for the Germans by a codebook distributed monthly (Singh, 127-142).

Breaking the ENIGMA was truly an international effort. Fascinatingly, the breaking of the ENIGMA depended much more on stealing and buying information, rather than mathematical rigor, which was used in the Pacific. The effort began in late 1920's. Poland, formed again after World War I in the Treaty of Versailles, was cognizant of her treacherous position between Russia, who historically sought land and warm-water ports, and Germany, whom her new territory divided. Consequently, Poland had a vested interest in keeping tabs on foreign affairs. The Biuro Szyfr!w, the Polish Cipher Bureau, first detected the new German cryptosystem in 1926, along with the Bureau du Chiffre and Room 40 (the French and British cryptanalytic bureaus, respectively). Though they had commercial versions of the ENIGMA that gave them clues about the messages, the German military version was significantly different. They still had too little information about the machine to begin to break the code.

The first clues to solving ENIGMA would not come though cryptanalysis but through bribery. In 1928, Hans-Thilo Schmidt, an embittered civilian clerk who supervised the distribution and destruction of German ciphers, contacted the French government. For a price (about US$4000), he was willing to turn over some ENIGMA documents. In the meeting that followed, Schmidt showed the French both the instructions for operating the ENIGMA machine and the directions for setting the keys. These documents alone could not break ENIGMA, but provided more clues. These documents were then forwarded to British and Polish governments, who were French allies, to try to gain insight into ENIGMA (Kahn, Seizing Enigma 55-60). Interestingly, only the Polish had some success deciphering ENIGMA messages at this point. Rejewski, a genius Polish cryptanalyst, had developed a mechanical protocomputer that could systematically check many ENIGMA keys (Parrish, 47-48). Regarding Polish success, Langer, chief of the Biuro Szyfr!w, said to the French, "you don't have the same motivation we do" (61-62). This statement alludes to a pattern prior to World War II; governments did not prioritize cryptography until they needed it very badly. This was true for the US in the Pacific, as Pearl Harbor may have been prevented with a more extensive codebreaking service, and for the British, who were late to militarize at all for World War II. Though the Polish were acting in their own immediate interest in trying to break ENIGMA, it seems better to have strong codebreaking and intelligence agencies even during peacetime, so as to be ready for war.

In 1939, the Poles meet with the French and British to reveal their fully functional recreated ENIGMA machine. The only problem that remained was getting the daily key. Had this meeting occurred five weeks later, the Allies might have never gotten this secret as a result of the German invasion of Poland (Kahn, Codebreakers 975).

After this, the British took on the major role in breaking German codes. At Bletchley Park, British code headquarters, Alan Turing, one of the greatest mathematicians at the time and the first person to conceive of a modern digital computer, had amazing insight into codebreaking and problem solving in general. Ian Fleming (future creator of James Bond) realized that the most efficient way to get the daily codes would be to simply steal the monthly codebooks from German ships. Thus, at the beginning of every month, a small German ship was raided. Though Britain worked on other codes, many based on ENIGMA, she prioritized her naval security and superiority (Kahn, Codebreakers 975-978).

Analysis and Conclusion
An important principle common to codebreaking in general is the delicate balance between keeping the broken code secret, and using the information gained from the code. These opposing objectives were demonstrated in Nimitz's decision to assassinate Yamamoto. Further, in Europe, Allies would consistently fly a scout ship over a German convoy before attacking it, as if they just "happened" to come across it. In one instance, the British learned while attacking a convoy that it contained British POWs. Churchill decided to continue the bombing, prioritizing the secrecy of the Ultra project to conceal ENIGMA over the lives of his POWs. This was a no-win situation, because compromising Ultra would also cost British lives in prolonging the war. It is unfortunate that war can produce such atrocious ethical dilemmas ("Codebreakers").

Perhaps if peacetime cryptography had been more extensive and better funded, World War II could have been avoided. If European nations had known Hitler's true intentions, they may have been less likely to appease him with the occupation of Czechoslovakia and the remilitarization of the Rhineland. Following World War II, US Congress decided that as a result of Pearl Harbor, Army and Navy intelligence services should be combined. As a result, the Central Intelligence Agency and the National Security Agency were formed, the former to gather foreign intelligence information, and the latter to secure national information and decrypt foreign information (Kahn, Codebreakers 674).

Allied cryptanalysts were generally successful in World War II. But what role did they play in ending the war? Though cryptography was not crucial to the outcome, it was very successful in shortening the war. Even excellent cryptographical services cannot protect against force, as evidenced by Poland (Kahn, Codebreakers 975). Weapons and soldiers still win wars; cryptographers only help bring them home a little faster. Breaking the Japanese and German codes allowed the Allies to gain an advantage in both theatres, shortening the war. It proved that without cryptography, especially during peacetime, one can never know the true intentions of any government ("Secrets of War").

Illustrations
Figure 1:
German Enigma encryption
This figure represents the design of the Enigma machine. Rather than the full 26 letters, only six are shown to simplify the depiction. If the letter "b" is pressed on the keyboard, the signal travels through the three rotors, the reflector board, then back through the rotors to illuminate the letter "d" on the lampboard. After that, the first rotor would rotate, so that if the letter "b" were typed again, it would result in a different ciphertext letter on the lampboard. Though the reflector does not increase the strength of the encryption, it aids the receiver in decrypting the message.

Source: Singh, Simon. The Code Book. New York: Doubleday, 1999. Page 132, Figure 36.

Works Cited
"Codebreakers". Nova. Videocassette. WGBH Educational Foundation, 1994. 55 min.
"Cryptography FAQ Index" (accessed 2 Jan 2000): Internet, World Wide Web: http://www.faqs.org/faqs/cryptography-faq/
Kahn, David. The Codebreakers. New York: Scribner, 1996 ed.
- - Seizing the Enigma. New York: Barnes and Noble Books, 1998.
Komatsu, Keiichiro. Origins of the Pacific War and the Importance of "Magic". New York: St. Martin's Press, 1999.
Parrish, Thomas. The Ultra Americans. New York: Stein and Day Inc., 1986.
Prados, John. Combined Fleet Decoded. New York: Random House, 1995.
"Secrets of War: Breaking the Japanese Code". Sworn to Secrecy. The Documedia Group, 1999. 60 min.
Singh, Simon. The Code Book. New York: Doubleday, 1999.
Stephenson, Neal. Cryptonimicon. New York: Avon Books, 1999.

← Previously: The Allegory of the Cave | All posts | Next: Welcome back Aaron Wow. I →