Throughout history, the ability to intercept and decode enemy communications has often determined the outcome of battles, campaigns, and entire wars. The story of cryptography in warfare is one of brilliant minds working against seemingly insurmountable odds, racing against time to crack unbreakable codes while others fought to keep their secrets safe.
These efforts required not just mathematical genius, but perseverance, out-of-the-box thinking, and sometimes absolute secrecy. The codebreakers who worked in the shadows altered the course of history, saving lives and shortening devastating conflicts.
The Enigma Machine
No code-breaking story is more renowned than the cracking of Germany's Enigma machine during World War II. The Germans believed their encryption system, with its more than 150 trillion possible settings for each message, was mathematically impossible to breach.
The Enigma’s complexity lay in a series of rotating wheels, or rotors, that scrambled messages into unreadable gibberish. The first major breakthroughs came from a team of Polish mathematicians led by Marian Rejewski in the early 1930s. Rejewski and his colleagues reconstructed the Enigma machine and invented methods—like the use of the "Zygalski sheets"—to break its ciphers. Just before WWII, the Poles shared their findings with French and British intelligence, a pivotal move that laid crucial groundwork.
When wartime began and Germany increased the Enigma’s complexity, efforts to break it ramped up in Britain at Bletchley Park. Mathematicians—including Alan Turing—worked tirelessly, supported by linguists and chess champions. Many advances were possible because German operators made predictable errors, such as using the same plaintext for weather reports. Turing and his colleagues built electromechanical "bombes" that could analyze Enigma settings much faster than manual testing.
The impact was far-reaching: Allied commanders used decrypted Enigma messages to anticipate German operations, improve resource deployment, and avoid traps. Most historians agree that breaking Enigma shortened the war by two to four years and saved countless lives.
JN-25
While efforts in Europe focused on Enigma, the outcome of the Pacific War hinged on intercepting and breaking Japanese naval ciphers—most notably the code known as JN-25. This code was a two-step system: Japanese phrases were converted to five-digit numbers using a codebook, then mathematically altered using additive tables.
U.S. cryptanalysts had been working to break Japan's codes—including JN-25—since before the attack on Pearl Harbor in 1941. Much of the work was done at Station HYPO in Hawaii, directed by Joseph Rochefort. Progress was hard-won, built through incremental successes as cryptanalysts pieced together partial decrypts, coped with ever-changing Japanese procedures, and drew on expertise from code experts, native speakers, and radio operators.
The tipping point arrived in early 1942. Through careful analysis of intercepted messages, Rochefort’s team noticed that the Japanese were preparing a major operation targeting "AF." To test their theory that AF referred to Midway, U.S. forces on Midway Island sent a fake, unencrypted message about a water shortage. When Japanese communications soon repeated this "news," the suspicion was confirmed.
Armed with this knowledge, Admiral Chester Nimitz positioned his inferior fleet for a surprise ambush. The ensuing Battle of Midway in June 1942 destroyed four Japanese carriers and decisively shifted the balance in the Pacific.
The Zimmermann Telegram
Sometimes, the decryption of a single message can alter an entire war. In 1917, British cryptographers in Room 40 intercepted what became known as the Zimmermann Telegram—a message that would fundamentally shift U.S. opinion in World War I.
German Foreign Secretary Arthur Zimmermann’s telegram to Mexico proposed a military alliance: if Mexico joined Germany against the United States, Germany would assist Mexico in reclaiming Texas, New Mexico, and Arizona. Room 40 had been laboring over German diplomatic codes for months, but their efforts were given a massive boost when, in 1914, the Russian navy had recovered a German naval codebook from a sunken ship and shared it with the British, providing an invaluable starting point.
The British faced another challenge: how to reveal the telegram’s contents without exposing their intelligence methods. They cleverly procured a second copy of the telegram from Mexico, making it seem as though their information came from conventional espionage.
When American newspapers published the telegram in March 1917, public sentiment shifted dramatically. The U.S. entered the war soon after, changing the course of global history.
Navajo Code Talkers in WWII
Not every code story is about cracking enemy secrets. Sometimes it’s about making codes impenetrable. During WWII, the U.S. military struggled with Japanese eavesdropping and the vulnerabilities of conventional codes. Enter the Navajo Code Talkers: a solution proposed by Philip Johnston, who had grown up among the Navajo and realized the language’s suitability for secure military communication.
The Navajo language’s unwritten nature, complexity, and rarity (very few non-Navajos spoke it) made it an ideal foundation. About 400 Navajo men were recruited and trained to serve as Code Talkers. They developed an elaborate system mixing direct translation and code words. Military terms without Navajo equivalents were described using creative code-names, like "iron fish" for submarine and "buzzard" for bomber.
These Code Talkers could generate, transmit, and decode messages rapidly—much faster than previous methods—with the added bonus that the Japanese were never able to break the Navajo code. Importantly, there are no credible reports of Navajo Code Talkers being captured or tortured by the Japanese. Their code remained intact throughout the conflict.