How Did the U.S. Break Japanese Military Codes Before the Battle of Midway?

The best answer to any question.
Nov. 20 2013 12:40 PM

How Did the U.S. Break Japanese Military Codes Before the Battle of Midway?

This question originally appeared on Quora.

Answer by Andrew Warinner, code monkey, expat, utility infielder:

131120_quora_Rochefort
Capt. Joseph J. Rochefort led many of the key Station HYPO codebreakers who correctly deciphered Japanese messages about Midway.

Courtesy of U.S. Naval Historical Center/Wikimedia/Creative Commons

Advertisement

The U.S. had an excellent track record against Japanese codes and ciphers before World War II, and this experience, combined with a variety of other sources of intelligence, helped the U.S.—primarily the radio interception station and decryption center Station HYPO run by Capt. Joseph Rochefort at Pearl Harbor, Hawaii—deduce that an attack on Midway was in the offing.

Japanese naval codes were unlike German codes in World War II. They were primarily "book" ciphers, while German codes used mechanical encipherment—the famous Enigma and Lorenz machines.

Book ciphers work like this: The sender composes his message and then consults the code book. Common words and phrases are replaced with a group of numbers and letters, and any remaining text is encoded character by character. The result is transmitted. The receiver then looks up each group in the corresponding code book and reassembles the message. An additional level of security can be added by enciphering the code groups themselves; this is called superenciphering.

High-grade Japanese naval codes since the 1920s had relied on code books and superencipherment to protect their communications, and the U.S., Great Britain, Australia, and Holland all had had considerable success against them. The Imperial Japanese navy did regularly change their code books and the superencipherment technique, but the supherencipherment was generally weak and easily broken (Japanese characters were encoded as romaji for transmission, and this made them vulnerable to standard cryptological attacks such as frequency analysis). The code books themselves were also not radically changed (words and messages were organized alphabetically, and sections of code groups were incremented consecutively).

The main Japanese naval code, the Navy General Operational Code, dubbed JN25 by the U.S., had a code book of 90,000 words and phrases. Even when the superencipherment was stripped to reveal the code groups (nine character combinations in the case of JN25), the meaning of each code group had to be inferred.

Deducing the contents of the JN25 code book was essentially an exercise in puzzle-solving. The meaning of particular code group could be inference by context or by cross-referencing its use in other messages. Codebreakers at Station HYPO were known for their prodigious memories, but they also made extensive use of IBM punch-card sorting machines to find messages using specific code groups. The end result was a huge card catalog representing the inferences and deductions of code groups of the JN25 code book.

So in early 1942 when the U.S. began detecting signs of an impending attack, the target was encoded as "AF." Locations in the JN25 code book were represented by a code group, and AF was not definitively known by the U.S. Other intelligence methods such as traffic analysis pointed to a target in the Central Pacific, but other U.S. naval intelligence organizations, particularly OP-20-G in Washington, D.C., disagreed about the location and timing of the impending attack.

So the codebreakers at Station HYPO devised an ingenious experiment to confirm the identity of AF. Pearl Harbor and Midway Island were connected by an underwater cable that was invulnerable to Japanese interception. Station HYPO sent orders to Midway by cable to broadcast a radio message that the island's desalinization plant had broken down. The radio message was broadcast without encryption to ensure that Japan could read it if it was intercepted.

The radio message was duly intercepted by Japan and reported by a message encoded in JN25 stating that AF's desalinization plant was out of order. That message was intercepted by Station HYPO. AF was thus confirmed as Midway.

There remained the question of the timing of the attack. Station HYPO concluded that the attack would come in late May to early June 1942, while OP-20-G said late June. Station HYPO won out again because they had succeeded in cracking JN25's date encryption and OP-20-G had not.

Station HYPO's intelligence persuaded Chester Nimitz, commander of the U.S. Pacific Fleet, to risk the three remaining U.S. carriers in the Pacific in an attempt to ambush the Japanese attack on Midway. While Midway was a stunning victory for the U.S.—sinking four Japanese carriers for the loss of one U.S. carrier—that was enabled by intelligence and broke the uninterrupted string of defeats and draws the Imperial Japanese navy had inflicted on the U.S. Navy, much hard fighting remained and more stinging defeats awaited the U.S. in the Pacific.

The bureaucratic feuding between Station HYPO and OP-20-G continued for the remainder of the war. Rochefort became a victim of the infighting; he was never promoted beyond captain, never received the sea command he wanted, and received no decoration or award for his invaluable work at Station HYPO during his lifetime.

More questions on Military History and Wars:

TODAY IN SLATE

Politics

Meet the New Bosses

How the Republicans would run the Senate.

The Government Is Giving Millions of Dollars in Electric-Car Subsidies to the Wrong Drivers

Scotland Is Just the Beginning. Expect More Political Earthquakes in Europe.

Cheez-Its. Ritz. Triscuits.

Why all cracker names sound alike.

Friends Was the Last Purely Pleasurable Sitcom

The Eye

This Whimsical Driverless Car Imagines Transportation in 2059

Medical Examiner

Did America Get Fat by Drinking Diet Soda?  

A high-profile study points the finger at artificial sweeteners.

The Afghan Town With a Legitimately Good Tourism Pitch

A Futurama Writer on How the Vietnam War Shaped the Series

  News & Politics
Photography
Sept. 21 2014 11:34 PM People’s Climate March in Photos Hundreds of thousands of marchers took to the streets of NYC in the largest climate rally in history.
  Business
Business Insider
Sept. 20 2014 6:30 AM The Man Making Bill Gates Richer
  Life
Quora
Sept. 20 2014 7:27 AM How Do Plants Grow Aboard the International Space Station?
  Double X
The XX Factor
Sept. 19 2014 4:58 PM Steubenville Gets the Lifetime Treatment (And a Cheerleader Erupts Into Flames)
  Slate Plus
Tv Club
Sept. 21 2014 1:15 PM The Slate Doctor Who Podcast: Episode 5  A spoiler-filled discussion of "Time Heist."
  Arts
Television
Sept. 21 2014 9:00 PM Attractive People Being Funny While Doing Amusing and Sometimes Romantic Things Don’t dismiss it. Friends was a truly great show.
  Technology
Future Tense
Sept. 21 2014 11:38 PM “Welcome to the War of Tomorrow” How Futurama’s writers depicted asymmetrical warfare.
  Health & Science
The Good Word
Sept. 21 2014 11:44 PM Does This Name Make Me Sound High-Fat? Why it just seems so right to call a cracker “Cheez-It.”
  Sports
Sports Nut
Sept. 18 2014 11:42 AM Grandmaster Clash One of the most amazing feats in chess history just happened, and no one noticed.