Magic (cryptography) facts for kids
Magic was a top-secret project during World War II where the United States worked to break enemy codes. It involved smart people from the United States Army and the United States Navy. They teamed up to read secret messages from other countries.
Contents
Breaking Secret Codes
The Magic project brought together many experts from the Army and Navy. Later, even civilian scientists and technicians joined. Their main goal was to break secret codes and ciphers. They had big successes with three important Japanese codes: RED, BLUE, and PURPLE.
The RED Code
In 1923, a U.S. Navy officer got a copy of a secret codebook used by the Japanese Navy. This codebook was from World War I. Cryptanalysts (codebreakers) studied it. They kept the decoded messages in red folders, so they called this code "RED."
The BLUE Code
By 1930, the Japanese government created a new, more complex code called BLUE. Even though RED was still used for less important messages, BLUE was quickly broken by U.S. codebreakers by 1932. U.S. military listening stations then started to listen in on Japanese communications between ships and land.
The PURPLE Code
In 1939, after Japan became allies with Germany, Germany helped Japan improve its communication and coding machines. They sent special Enigma machines to Japan to secure their most important messages with Germany. This new code was called PURPLE, because it was like mixing RED and BLUE.
The PURPLE code was very difficult to break. Like the German Enigma, messages started clearly but then became a jumbled mess. Codebreakers tried to solve it by hand, but it was too hard. They soon realized it was a machine-generated code, not a simple substitution code like RED or BLUE.
In 1939, a team led by William Friedman and Frank Rowlett built a machine that could copy some of the settings of the Japanese Enigma machines. This helped them decrypt some PURPLE messages. By 1942, with more translators, they could decode and understand these messages much faster.
PURPLE Messages
The Japanese Foreign Office used the PURPLE machine to encrypt its diplomatic messages. When a message was typed into the machine, it was scrambled and sent to another identical machine. The receiving machine could only unscramble the message if it had the correct settings, or keys. American codebreakers built their own machine that could read these messages.
Japan started using the PURPLE machine in 1940. U.S. and British codebreakers were able to read some PURPLE messages even before the attack on Pearl Harbor. However, the PURPLE machines were only used by the Foreign Office for messages to their embassies. The Japanese Navy used a completely different code system called JN-25.
U.S. analysts found no hints in PURPLE messages about the upcoming Japanese attack on Pearl Harbor. This was because the Japanese military did not discuss their attack plans in messages sent through the Foreign Office. The military didn't fully trust the Foreign Office with such secret plans.
Even though the U.S. could read Japan's most secret diplomatic messages, this information was less useful for military plans. This was because military groups, not the Foreign Office, mostly controlled Japan's decisions before the war. Also, the Foreign Office often held back information from its own embassies. So, reading PURPLE messages didn't always give a full picture of Japan's military plans.
American codebreakers (like those at Station HYPO) decrypted and translated a 14-part Japanese diplomatic message on December 7, 1941. This message officially broke off talks with the U.S. They read it even before the Japanese Embassy in Washington could deliver it. When the Japanese diplomats finally delivered the note, U.S. Secretary of State Cordell Hull had to pretend to read it for the first time, even though he already knew about the attack on Pearl Harbor.
Throughout the war, the Allies regularly read both German and Japanese secret messages. For example, the Japanese Ambassador to Germany, General Hiroshi Ōshima, often sent valuable German military information to Tokyo. This information was regularly intercepted and read by leaders like Roosevelt, Churchill, and Eisenhower. The Japanese thought their PURPLE system was completely unbreakable.
Keeping Magic Secret
Even with all the information from Magic, it was handled in a very strict way. Many important leaders who needed the information didn't know about it. Those who did see the messages (especially before Pearl Harbor) saw each message only briefly. A courier would stand by to take it back, and no copies or notes were allowed. Before Pearl Harbor, only messages considered "important enough" by Army or Navy officers were shared.
Still, being able to read PURPLE messages gave the Allies a big advantage. For example, the Japanese ambassador to Germany, Baron Hiroshi Ōshima, sent long reports to Tokyo using the PURPLE machine. These reports included his talks with Adolf Hitler and a tour of the invasion defenses in Northern France (including the D-Day invasion beaches). General George Marshall said that Ōshima was "our main basis of... information regarding Hitler's intentions in Europe."
Dewey and Marshall
During the 1944 election, Thomas E. Dewey threatened to make the Pearl Harbor attack a campaign issue. But General Marshall sent him a personal letter. Marshall explained how important it was to keep Magic secret. He said that the Battle of Coral Sea and the Battle of Midway were won because they had read secret messages. This allowed their few ships to be in the right place at the right time. Dewey then promised not to bring up the issue, and he kept his word.
After the War
After World War II, there were hearings in Congress about who was to blame for the Pearl Harbor disaster. During these hearings, the Japanese learned for the first time that their PURPLE code system had been broken. They had continued to use it even after the war, with encouragement from the American Occupation Government.
There was a lot of confusion about who in Washington or Hawaii knew what and when. Some people thought that "someone in Washington" knew about the Pearl Harbor attack before it happened. They believed the "failure to warn Hawaii must have been deliberate." However, PURPLE was a diplomatic code, not a military one. This meant that only guesses could be made about specific Japanese military actions from these messages.
When the U.S. Army's Signals Intelligence Service (SIS) broke PURPLE, problems arose about how to share the decoded messages. Both the U.S. Navy and Army wanted to be the only ones to deliver the messages to top leaders. Eventually, they agreed to take turns: the Army would deliver messages one day, and the Navy the next.
The list of people who received the messages included some, but not all, military and civilian leaders in Washington. The process for sharing the messages was very strict:
- A duty officer (Army or Navy) would decide which decoded messages were important enough to share.
- These messages were put into a locked briefcase and given to a junior officer. This officer was not always allowed to read the messages themselves.
- The officer would visit the appropriate offices.
- No copies of the messages were left with anyone. The person receiving the message could read it while the officer waited, and had to return it immediately. Before December 1941, this was the only time anyone on the list saw that message.
The Decryption Process
Several steps were needed before a decoded message was ready to be shared:
- Interception: The Japanese Foreign Office used wireless radio and cables. Wireless messages were picked up by listening stations in places like Hawaii and Washington. The raw coded messages were sent to Washington, D.C. Cable messages were also copied and sent to Washington.
- Deciphering: The raw coded messages were then deciphered by either the Army or the Navy. This was usually successful because the code had been broken.
- Translation: Once the plain text was obtained, it was translated from Japanese. The Navy had more Japanese-speaking officers, so they did most of the translation. Japanese is a difficult language, so good translation needed not only fluent Japanese but also knowledge of the message's context.
- Evaluation: The translated message was then checked for its intelligence value. For example, was it a simple message, or part of a bigger power struggle? Was it part of a series of messages that together had a deeper meaning? Only after this evaluation could someone decide if it should be shared.
Before the attack on Pearl Harbor, these messages were handled slowly and sometimes inefficiently. But the experience of reading another government's most secret communications, sometimes even before the intended recipient, was amazing. It was so amazing that someone (possibly President Roosevelt) called it "magic." The name stuck.
Executive Order 9066
One part of Magic that is still debated today is how much the intercepted messages influenced Executive Order 9066, issued on February 19, 1942. This order, and a later one, led to the creation of the Wartime Relocation Authority (WRA). This is often confused with internment, which was handled by the Justice Department and affected all citizens of countries at war with the U.S., not just Japanese Americans.
The internment of "enemy aliens" by the U.S. government began on December 8, 1941, right after the Pearl Harbor attack. It included Germans and Italians, not just Japanese people living on the U.S. West Coast.
Some people, like David Lowman in his book MAGIC: the Untold Story, say that the main reason for relocating Japanese Americans was to protect against spying and sabotage. This was because Magic could not be mentioned during the war. Others, like Michelle Malkin, point to Magic intercepts as part of the reason for Executive Order 9066. Malkin mentions testimony from an Undersecretary who said Magic "was a very important factor."
Malkin's book In Defense of Internment cites documents that show Magic intercepts discussed Japanese consulates trying to create spy rings among Japanese Americans. These intercepts also showed the kind of espionage data being sent to Japan. This raised suspicions that many Japanese Americans might pose an espionage risk.
In 1988, Congress passed a law, signed by President Ronald Reagan, that apologized for the internment on behalf of the U.S. government. The law stated that the government's actions were based on "race prejudice, war hysteria, and a failure of political leadership." The hearings that led to this decision did not consider the Magic intercepts.
Here are some actual texts of Magic intercepts, translated into English, that were declassified in 1978:
Tokyo to Washington (January 30, 1941)
This message from Tokyo to Washington, dated January 30, 1941, was translated on February 7, 1941. It was message #44.
FROM: Tokyo (Matsuoka)
TO: Washington (Koshi)
(In two parts—complete). (Foreign Office secret).
(1) Set up a spy group in the Embassy that will work with private and semi-official spy groups. (2) Our main goal is to find out the total strength of the U.S. We will look at political, economic, and military information. (3) Find out about all people or groups who are openly or secretly against the U.S. joining the war. (4) Investigate anti-Jewish groups, communist groups, movements of Black people, and labor movements. (5) Using U.S. citizens of foreign backgrounds (not Japanese), foreigners (not Japanese), communists, Black people, labor union members, and anti-Jewish people would be best for these investigations. These people should be able to get into government buildings (like labs), government groups, factories, and transportation places. (6) Use our "Second Generations" (Japanese Americans born in the U.S.) and Japanese people living here. (Be very careful, because if anything goes wrong, our people in the U.S. will face serious problems.) (7) If the U.S. joins the war, our spy group will move to Mexico. Mexico will become the main center for our spy network. So, prepare for this by setting up ways to send information between the U.S. and Mexico. This network will also cover Brazil, Argentina, Chile, and Peru, all centered in Mexico. (8) We will work with German and Italian spy groups in the U.S. This has been agreed upon with the Germans and Italians in Tokyo.
Please get more details from Secretary Terasaki when he starts his job there.
Please send copies to the same offices that received message No. 43.
Japanese U.S. Consulates to Tokyo (May 1941)
Throughout 1941, some messages between Tokyo and its embassies and consulates continued to be intercepted.
Japanese consulates across the Western Hemisphere reported their information. They used regular diplomatic channels, but for urgent information, they used PURPLE coded messages. This gave important clues about their progress directly to the U.S. President and his top advisors.
Messages intercepted in May 1941 from the consulates in Los Angeles and Seattle showed that the Japanese were successfully getting information and cooperation from "second generation" Japanese Americans and others.
- Magic intercept LA to Tokyo #067 - May 9, 1941
This message from Los Angeles to Tokyo, dated May 9, 1941, was translated on May 19, 1941. It was message #067.
FROM: Los Angeles (Nakauchi)
TO: Tokyo (Gaimudaijin)
(In 2 parts—complete). Strictly Secret.
Regarding your message #180 to Washington.
We are doing everything to make outside contacts to gather intelligence. We have decided to use white people and Black people, through Japanese people we don't fully trust. (It would be very hard and expensive to hire U.S. military experts now.) We will also stay close with the Japanese Association, the Chamber of Commerce, and newspapers.
For airplane factories and other military places, we plan to work closely with various groups. In strict secrecy, we will have them watch these military places closely. This way, we hope to get accurate and detailed intelligence reports. We already have contacts with very reliable Japanese people in the San Pedro and San Diego areas. They will watch all shipments of airplanes and war materials and report amounts and destinations. We've done the same for traffic across the U.S.-Mexico border.
We will keep in touch with our second generations who are in the U.S. Army. They will keep us informed about Army developments. We also have contacts with our second generations working in airplane plants for intelligence.
For the Navy, we are working with our Naval Attache's office and sending reports as accurately and quickly as possible.
We are having Nakazawa investigate and summarize information from first-hand reports and newspapers about military movements, labor disputes, communist activities, and similar matters. For anti-Jewish movements, we are having investigations done by important Americans and Japanese connected with the movie industry here. We have already made contacts with very influential Black people to keep us informed about the Black movement.
- Magic intercept Seattle to Tokyo #45 - May 11, 1941
This message from Seattle to Tokyo, dated May 11, 1941, was translated on June 9, 1941. It was message #45.
FROM: Seattle (Sato)
TO: Tokyo
(3 parts—complete)
Regarding your #180 to Washington
1. Political Contacts We are collecting intelligence about political questions and about American involvement in the war, both nationwide and locally.
2. Economic Contacts We are using foreign company employees, as well as employees in our own companies here, to collect economic intelligence. This includes ship construction, the number and types of airplanes produced, copper, zinc, and aluminum production, tin yield for cans, and lumber. We are now working hard to get this information through skilled Americans. From an American we recently contacted, we received a private report on German machinists who are Communists and labor union members at the Bremerton Naval Yard and Boeing airplane factory. Second generation Japanese ----- ----- ----- [three words missing].
3. Military Contacts We are getting intelligence about warship concentrations at the Bremerton Naval Yard, information on merchant shipping and airplane manufacturing, military force movements, and troop maneuvers. Based on this, men are sent out to contact Lt. Comdr. OKADA, and this intelligence will be wired to you as before. KANEKO is in charge of this. Recently, we have twice investigated military places and concentration points in various areas. For the future, we have arranged to collect intelligence from second generation Japanese draftees about troops, as well as troop speech and behavior. ----- ---- -----. [three words missing]
4. Contacts with Labor Unions The local labor unions A.F. of L. and C.I.O. are very influential. The (Socialist?) Party has an office here (its influence covers twelve zones.) The C.I.O., especially, has been very active here. We had a first generation Japanese, who is a labor movement member and committee chairman, contact the organizer. We received a report, though it's a summary, on using American members of the (Socialist?) Party. ------ OKAMARU is in charge of this.
5. To contact Americans of foreign background and foreigners, as well as other people, to collect intelligence about anti-war groups and the anti-Jewish movement, we are using a second generation Japanese lawyer.
This intelligence ---- ----- -----.
Access by Roosevelt's Cabinet
These intercepted messages, along with reports from the FBI and Navy counter-espionage efforts, were only available to the most senior leaders in President Roosevelt's cabinet. Even J. Edgar Hoover, the Director of the FBI, did not know about the existence of Magic intelligence.
Opposing Viewpoint
Some people argue that Executive Order 9066 regarding Japanese American internment was not based on Magic intercepts. They point out:
- The commanding officer on the West Coast, Lt. Gen. J. L. DeWitt, was not on the Magic intercept list.
- His boss, Secretary of War Henry Stimson, was on the list.
- Stimson asked DeWitt for reasons to justify the relocation program.
- If Magic intercepts provided enough reasons, why would Stimson need more justification from DeWitt?
One idea is that Stimson wanted DeWitt to provide reasons that could be made public, because the Magic intercepts themselves had to remain secret.
Other Japanese Codes
PURPLE gave a fascinating, but limited, look into Japanese plans because of how Japan made decisions before the war. A more useful military code was the Japanese Fleet Code, called JN-25 by U.S. Navy codebreakers. Breaking the version used after December 7, 1941, gave enough information for U.S. naval victories in the battles of the Coral Sea and Midway. These wins stopped Japan's early advances and destroyed most of Japan's naval air power.
Later, decoded JN-25 messages revealed the flight schedule and route of Admiral Isoroku Yamamoto during an inspection tour. This allowed USAAF pilots to ambush the officer who planned the Pearl Harbor attack. Even later, access to Japanese Army messages helped plan the island-hopping campaign to the Philippines and beyond.
Another source of information was the Japanese Military Attaché code (JMA), introduced in 1941. This system was broken by John Tiltman at Bletchley Park in 1942.
How Secret Was Magic?
The public actually got a hint that Japanese codes were broken by the Chicago Tribune. The newspaper published a series of stories right after the Battle of Midway, starting on June 7, 1942. These stories correctly claimed that the U.S. victory was largely due to breaking Japanese code systems (in this case, JN-25).
However, neither the Japanese nor anyone who might have told them seemed to notice these newspaper stories. They also didn't notice similar announcements made in the United States Congress. There were no changes in Japanese cryptography because of these public reports.
Alvin Kernan, who served on aircraft carriers during the war, stated in his book Crossing the Line that before the Battle of Midway, the crew knew the Japanese code had been broken. He insists he "exactly remembers the occasion on which I was told, with full details about ships and dates," even though it was later claimed the code-breaking was kept secret.
U.S. Navy Commander Ignatius J. Galantin, who later became an Admiral, mentioned Magic several times in his 1988 book about his submarine patrols. He called Magic "Ultra," which was actually the name for breaking German codes. He wrote that all submarine captains knew about "Ultra" (Magic).
Also, Army Chief of Staff George Marshall found out early in the war that Magic documents were being widely read at the White House. He said that "at one time over 500 people were reading messages we had intercepted from the Japanese."
Fiction
Neal Stephenson's novel Cryptonomicon includes a fictional version of Magic, where the Japanese code is called "Indigo" instead of "PURPLE."
In the James Bond novel You Only Live Twice, James Bond is given information from a fictional "MAGIC 44" decryption program.
The W.E.B. Griffin series The Corps tells a fictional story of U.S. Navy and Marine Corps intelligence operations in the Pacific during World War II. Many characters in these novels, both made-up and historical, have access to and use intelligence from Magic.
See also
In Spanish: Magic (criptografía) para niños