While battles raged across Europe and the oceans of the Pacific, a quieter conflict took place in the backrooms of intelligence agencies. This was a war of mathematicians, linguists and engineers, often described as the “wizard’s war.” It was a race to protect national secrets while stripping away the enemy’s.

Cryptography has long interested me because it marks a major shift in how we handle information. Beyond the classic tales of spies, the hardware itself is remarkable. This period saw the birth of modern computing, with technology moving from physical rotors and gears to electronic digital processors in only a few years. Seeing how these early efforts to scramble data led to the computers we use today makes the history worth revisiting. This overview looks at the people and machines that defined the era, beginning with the Polish team who proved that the Enigma machine could be defeated.

Early successes in Poland

If you ask who broke the German Enigma machine, most people will name Alan Turing. While he was a central figure, his work relied on an essential first chapter written in Poland. Without the work of three mathematicians in the 1930s, the efforts at Bletchley Park might never have started.

In the years before the war, Poland was in a difficult position between a rearming Germany and the Soviet Union. To gain an advantage, the Polish Cipher Bureau took the unusual step of hiring mathematicians rather than linguists to tackle German codes. This team included Marian Rejewski, Jerzy Różycki and Henryk Zygalski.

Their target was the military Enigma. It looked like a heavy typewriter but used a series of rotating wheels and a plugboard to scramble messages into billions of possible combinations. The Germans believed it was unbreakable, yet their own procedures provided a way in. At the time, operators typed a three-letter key twice at the start of a message. Rejewski used the patterns from this repetition to apply group theory to the problem. He managed to work out the internal wiring of the Enigma rotors without ever seeing a machine.

The Poles eventually built their own devices to speed up the process. They created cyclometers to map rotor positions and built the “Bomba,” a machine designed to test settings rapidly. By 1939, however, Germany added more rotors to the machine, making it too complex for Polish resources to handle. Just weeks before the invasion of Poland, they met with British and French agents near Warsaw and handed over reconstructed Enigma replicas and their research. This provided the British with the foundation they needed to begin their own work.

The work at Bletchley Park

When the war started, the cryptographic challenge grew. German U-boats were coordinating attacks on the supply ships Britain needed to survive. Breaking Enigma became a matter of national survival. The hub of the British effort was Bletchley Park, a Victorian estate that brought together an unusual mix of people. The staff included chess champions, mathematicians and even winners of newspaper crossword competitions.

Alan Turing realised that the Polish methods relied on German mistakes that could be fixed. He wanted a way to break the machine itself. He focused on a specific design trait: a letter in an Enigma message could never be encrypted as itself. If an operator typed an “A”, the result could be any letter except “A”.

Turing used this to his advantage. By guessing a common phrase in a message, such as a weather report, he could align his guess with the encrypted text. If a letter in the guess matched the letter in the cipher, he knew that alignment was wrong. These guessed phrases were known as “cribs.”

To test these possibilities, Turing and Gordon Welchman developed the British Bombe. These were large electromechanical machines that housed spinning drums mimicking the German Enigma rotors. They could cycle through thousands of settings, ruling out the ones that were impossible. By the middle of the war, Bletchley Park was an intelligence factory. The information they gathered, known as “Ultra,” allowed the Allies to steer convoys away from danger and played a part in the success of the D-Day landings.

The Pacific and the Midway bluff

In the Pacific, the Americans were fighting their own code war against Japan. Their efforts, known as “Magic,” focused on two main systems. The first was “Purple,” a machine used for diplomatic messages. A team led by William Friedman managed to build a replica of this machine before the war began.

The second was JN-25, the naval code. This was a complex system involving thousands of number groups and codebooks. Breaking it was a slow process of analysis led by Commander Joe Rochefort in a basement at Pearl Harbor. In early 1942, Rochefort’s team noticed frequent references to a target called “AF.” While some in Washington thought this might be Alaska, Rochefort believed it was Midway Atoll.

To prove his point, Rochefort used a trick. He told the commander at Midway to send a plain-language radio message saying that their water plant had broken down. A few days later, the Americans intercepted a Japanese message reporting that “AF” was short on water. This confirmed the target, allowing the US Navy to ambush the Japanese fleet and win a decisive victory.

The Navajo Code Talkers

While many countries relied on machines, one of the most effective codes used in the war was purely human. It used the Navajo language, which is unwritten and has a structure that is very different from European or Asian languages.

During the island-hopping campaigns in the Pacific, the US Marines needed a way to send messages quickly over the radio. Standard encryption was too slow for the middle of a battle. Philip Johnston, who grew up on a Navajo reservation, suggested using the language as a code.

The Code Talkers developed a system with two layers. They used Navajo words to stand for letters of the alphabet and created a dictionary for military terms. Since there were no Navajo words for modern weapons, they used names from nature. A submarine was called an “iron fish” and a fighter plane was a “hummingbird.” During the Battle of Iwo Jima, six Code Talkers sent hundreds of messages without a single mistake. Japanese intelligence never managed to break the code, making it one of the few systems to remain secure throughout the entire conflict.

The arrival of the computer

The final stage of the code war led to the creation of the first electronic computer. While Enigma was used for battlefield orders, the German High Command used a much more complex machine that the British called “Tunny.” It used 12 wheels and was far more difficult to crack than Enigma.

In 1941, a German mistake allowed mathematician Bill Tutte to work out the logic of the Tunny machine through statistical analysis. However, the sheer amount of data was too much for the mechanical machines at Bletchley Park. They needed a faster solution.

Tommy Flowers, an engineer with the Post Office, proposed building a machine using vacuum tubes. Many people thought the tubes would be too unreliable, but Flowers built “Colossus” anyway. It arrived at Bletchley Park in late 1943. Using 1,600 vacuum tubes, it could read paper tape at 5,000 characters per second. It was the first programmable, electronic digital computer in the world.

The Colossus machines helped confirm that the Germans expected the Allies to land at Calais rather than Normandy. Despite this success, the machines remained a secret for decades. After the war, Winston Churchill ordered them to be destroyed, and the people who built them were not allowed to talk about their work until the 1970s.

Sources for further reading

These books offer a more detailed look at the history of wartime cryptography:

  • The Code Book by Simon Singh: The most accessible introduction to the history of secrecy. It covers Enigma and the Navajo Code Talkers in detail.
  • Alan Turing: The Enigma by Andrew Hodges: A deeply researched biography of Turing.
  • Battle of Wits by Stephen Budiansky: A fantastic all-in-one history that balances the European and Pacific theatres, showing how codebreaking influenced specific battles.
  • Between Silk and Cyanide by Leo Marks: A memoir by the head of ciphers for the SOE. It’s a good resource for “low-tech” agent ciphers.

You can also find digitised documents and machines through the websites of the Bletchley Park Trust, The National Museum of Computing and the National Cryptologic Museum.