This Is A Working Title

Subscribe
Archives
August 4, 2025

#13: The Enigma Edition

Happy birthday to this newsletter! I can’t believe I’ve been writing these for a whole year. To be honest, when I sent out the first email a year ago, I kind of expected to abandon the project within a few months. So it’s gratifying to celebrate a whole year! The curation of each newsletter provides a really wonderful opportunity to reflect on what has stood out in recent weeks, and to ask myself if I’ve been seeking adequate adventure and enrichment, and I’ve had a lot of fun sharing those adventures with you all. Here’s to another year!

I’ve been on a puzzle kick of late. After tearing through both Blue Prince and The Roottrees Are Dead, I was champing at the bit for a new puzzle to sink my teeth into. So when I had a few hours to kill on a plane in late June, The Imitation Game caught my eye.

The Imitation Game is a highly dramatized retelling of the process of breaking Enigma, the cipher machine that was used by the German military in World War II to encrypt many of their top secret messages. The British codebreaking team that eventually deciphered Enigma is credited with shortening the war by at least 2 years. Notably, this team was led by Alan Turing, who is widely regarded as the father of computer science.

The movie does a decent job sharing enough technical details to ground the story in reality while simplifying the mechanics of both Enigma and the machine that broke it to be accessible to a lay audience. Unfortunately, I’m a nerd, and I wasn’t satisfied with the movie’s handwaving of the cryptanalytic mechanics. I wanted all the gory details.

Thus began my descent down a rabbit hole.

I. Enigma

therapist: the evil typewriter that would take 20 million years to crack by manual brute force isn’t real, it can’t hurt you.
enigma:

One of the most basic forms of encryption is called a substitution cipher. A substitution cipher works by replacing each letter in the alphabet with a different letter. For instance, you might substitute the letter X for all instances of the letter A, the letter F for all instances of the letter B, the letter J for all instances of the letter C, etc.

To implement a substitution cipher, you first create a table assigning a substitution for each letter. Then you look up each letter of your original message in the cipher table and select the appropriate substitution. To see how this works in practice, try using the following cipher table to encrypt the message “HELLO”. What do you end up with?

Original

Substitution

E

X

H

K

L

C

O

D

At its core, Enigma is an extremely sophisticated substitution cipher. You put in one letter, and another letter comes out. In this way, comprehensible messages are encrypted into what looks like gibberish.

But substitution ciphers are not particularly secure. They’re susceptible to all different kinds of codebreaking algorithms and pattern analysis because the cipher tables are predetermined, and that makes them predictable. To avoid these pitfalls, Enigma added the following layers of complexity:

  1. Each letter actually goes through 9 substitution ciphers in a row. So if you put in an A, you might go through the substitution chain A —> R —> F —> K —> L —> O —> P —> D —> V —> C in order to get the output C.1
  2. After a letter gets encrypted, the machine automatically swaps out up to 6 of the 9 cipher tables, so that no letter ever uses the same series of cipher tables as another letter.

Taken together, these mechanics mean you could put the same letter into the machine twice and get 2 different letters out. In fact, if you put the same message into the machine twice, you would get 2 completely different outputs. This made it drastically less viable to use standard codebreaking algorithms that relied on identifying consistent patterns.

Enigma also couldn’t be brute-forced, at least by humans. If one specific order of 9 specific cipher tables constituted one Enigma setting, Enigma had a total of 159,000,000,000,000,000,000 possible settings. Even with hundreds of people testing 1 Enigma setting a second, it would take millions of years to test every single Enigma setting.

If you’d like to understand the inner workings of Enigma, I highly recommend this video by Jared Owen. He’s got great animations and a clear breakdown of the circuitry involved.

II. The Bombe: Breaking Enigma

For all its complexities, Enigma is relatively easy to understand. The machine that broke it is another matter entirely. The Imitation Game doesn’t even bother summarizing the codebreaking machine’s functionality; all we get is a bit at the end, when Turing has his climactic epiphany, where he mentions “scramblers” and “voltages” without further explanation.

Initially, I felt cheated. The movie took incredible pains to explain Enigma and Turing machines and the Turing test, so why did it falter when it came to the crux of the whole codebreaking process?

And then I started looking into it, and I rescinded my gripes immediately. Jared Owen jokes in his Enigma video that you might want to get a degree in electrical engineering before hitting play; I don’t think that’s quite necessary to understand Enigma, but it certainly would have helped in understanding the Bombe.

Before we can even talk about the Bombe (pronounced “bomb”) that was developed to break Enigma, we have to talk about Enigma’s fatal flaw: no letter, if put into Enigma, will ever return as itself. This means that you could take a piece of plaintext (ie, non-encrypted text) that you expected to appear in a ciphered message, and you could make an educated guess about which part of the ciphertext corresponded to the plaintext by eliminating all potential locations where a letter would have returned as itself.

This allowed codebreakers to eliminate any potential Enigma settings that resulted in impossible matchups. For instance, in the example above, any Enigma settings that turned plaintext K into ciphertext J at position 3 could be eliminated, because that would have been an invalid placement for the plaintext.

There was one other feature of Enigma that aided in breaking it. Remember that each letter went through 9 separate substitution ciphers in the Enigma machine, but only 6 of these ciphers were swapped out after each letter was encrypted. Importantly, once the initial Enigma settings were chosen each day, the first and the last cipher table in the sequence did not change for the rest of the day. Moreover, these tables were reciprocal, meaning if, say, an A became an N, then an N would also become an A, and this relationship would remain the same for the whole day. This allowed codebreakers to make deductions about the relationships between letters and Enigma settings that remained valid even between messages.

This is where the Bombe came in. The Bombe comprised two parts: the drums, which simulated 36 partial Enigma machines running side by side, and the diagonal board, which was a complicated bit of wiring that connected all the drums in one large circuit. The drums were fully automated and performed the role of brute forcing every possible setting for the middle 7 ciphers in the cipher sequence. The diagonal board modeled the reciprocal nature of the first and last cipher tables, and it had to be set up manually for each plaintext/ciphertext pairing.

Once the Bombe had been set up, it would run through all possible Enigma settings and eliminate any that didn’t produce the assumed plaintext. If the plaintext and the deductions it yielded were good, the Bombe could identify 1-3 potential Enigma solutions within about 20 minutes, which would then need to be confirmed by hand. But if the deductions were bad, or the plaintext was wrong, the Bombe would return hundreds of potential solutions, or no solutions at all, and the codebreakers would have to go back to the drawing board.

The front of the Bombe, with each vertical group of 3 circles constituting 1 partial Enigma machine. Where a human codebreaker would have to manually set each rotor, check them, and then change the settings, the Bombe utilized electric circuits to carry out this process instantaneously, thereby dramatically decreasing the amount of time it took to test all possible Enigma settings.

The Bombe was not the end-all-be-all of codebreaking—there were still plenty of days where no messages were decrypted. Nevertheless, the Bombe’s mechanization of codebreaking provided a marked improvement over human codebreaking efforts and gave the Allies the comprehensive edge in the war. The Bombe cracked its first messages in 1940; by 1943, Bombes were breaking 3,000 messages per day.2

III. Unsung Heroes

Snarky commenters online are fond of saying, “The Imitation Game gets exactly 2 things right: there was a war, and Alan’s last name was Turing.” And they’re not wrong, per se. Not only does the movie portray Turing as uncharacteristically arrogant and aloof, but it also entirely omits several key contributors to the codebreaking efforts during the war.

Marian Rejewski, Henryk Zygalski, and Jerzy Różycki: Perhaps the most overlooked codebreakers in this saga are the Polish codebreakers who spent nearly a decade cracking a slightly simpler precursor to Enigma. In the 1930s, Polish mathematician Marian Rejewski pioneered the use of mathematical techniques for cryptanalysis, revolutionizing the discipline and cementing his place as one of the greatest cryptanalysts in history. Rejewski’s insights allowed him to decipher and reconstruct the inner workings of Enigma’s predecessor without ever having seen the machine in person.

In the late 1930s, Rejewski was joined by Henryk Zygalski and Jerzy Różycki, and the team developed the bomba kryptologiczna (translation: cryptologic bomb), an electromechanical machine that simulated 6 Enigma machines running in aggregate. The bomba allowed Rejewski’s team to break Enigma codes in a matter of hours. Unfortunately, soon afterwards, the Germans increased the complexity of the Enigma machine (bringing it closer in line with the form that Turing and his team cracked), which in turn greatly decreased the efficacy of the bomba. Shortly after that, Germany invaded Poland, curtailing the Poles’ codebreaking efforts, and the Poles turned over their findings to the French and British, along with 2 Enigma machines that they had managed to capture from the Germans.

Rejewski’s learnings undeniably paved the way for Turing and his team’s accomplishments. In particular, the Polish bomba was foundational for the development of the English Bombe; the Bombe’s name was fittingly chosen to pay homage to its predecessor.

Gordon Welchman: One of The Imitation game’s greatest departures from historical accuracy is its attribution of the invention of the diagonal board to Hugh Alexander. In reality, the diagonal board was designed by Gordon Welchman, a mathematician who was recruited alongside Turing. Welchman was the first person to figure out how to exploit the reciprocal nature of the first and last ciphers in Enigma’s cipher sequence. The diagonal board allowed the Bombe to determine Enigma settings in a matter of hours instead of days.

John Tiltman and Bill Tutte: Although Enigma receives outsized attention, it wasn’t even the most difficult German code. That title goes to the Lorenz cipher,3 which was generated by machines that had several orders of magnitude more potential settings than Enigma. The Lorenz cipher was ultimately only broken due to a serendipitous human error where a German messenger sent a message twice using the exact same settings. This gave John Tiltman and Bill Tutte an unexpected foothold into the cipher, and ultimately enabled them to reverse engineer the workings of the Lorenz machines sight unseen in what has been termed “one of the greatest intellectual feats of World War II.”

Tommy Flowers: Even after the Lorenz machine had been reverse engineered, its vast number of settings made it impractical to decrypt the cipher by hand. Instead, Tommy Flowers proposed a design for an electronic machine that eventually came to be called Colossus. This design used about 1,800 vacuum tubes, a number 10 times greater than what even the most complicated electronic machines of the time used. This led to immense skepticism about whether the machine would work, and Flowers had to contribute his own funds to get the project off the ground. But Colossus quickly proved itself, not just as a capable codebreaking machine but also as proof of concept for the viability of high-speed electronic digital computing devices. In modern terms, Tommy Flowers had just invented the world’s very first programmable electronic computer.4

IV. You Can Run DOOM on Magic: The Gathering

At a certain point, the rabbit hole splintered, and I started reading about Turing’s other contributions to computer science, namely the Turing test and Turing machines.

The Turing test is a philosophical test that assesses a machine’s ability to convincingly mimic human intelligence. (Turing originally called this test “the imitation game,” which is where the movie gets its name.)

What really piqued my interest, though, was Turing machines. The Turing machine is an abstract precursor to the modern computer, with 4 components:

  1. An input tape divided into cells; cells can have a symbol written in them but can also be blank
  2. A machine head that can read symbols, write new symbols onto the tape, and move left and right, one cell at a time
  3. Some kind of memory that keeps track of what state the machine is currently in
  4. A finite state table that provides instructions on what to do and what state to enter given the machine’s current state and the symbol it is currently reading on the tape

Turing machines are an absurdly powerful concept. Despite their simplicity, they can run any computer algorithm. And vice versa—any modern computer algorithm can be rewritten to work on a Turing machine. This versatility is even more impressive when you consider that Turing devised the model nearly a decade before the first programmable computer, Colossus, even existed.

Because Turing machines can run any computer algorithm, they can be used as a benchmark for how robust a given machine, computer, or other system of data manipulation is. If a system can somehow be manipulated into running a Turing machine, then it’s considered Turing complete and is capable of running any finite computer algorithm.

To make a long story short, in 2019, some computer scientists at Cambridge showed that you can simulate a Turing machine within Magic: The Gathering. (I found this presentation by University of Queensland doctoral student Max Orchard extremely helpful in understanding the proof.5) They did this by replicating the halting problem, which is a paradox that proves that there are some computer programs whose outcomes are unknowable.6

Since the halting problem is run using a Turing machine, modeling it necessarily requires the ability to run a Turing machine. This makes Magic: The Gathering Turing complete, and therefore capable of running any finite computer algorithm. And DOOM is a finite computer algorithm.

Ergo, Magic: The Gathering can run DOOM.

What a fitting end to a month of unmitigated nerdery :)


  1. Technically, the first and last ciphers in the sequence use the same table, and the input letter goes through that table twice. But the outcome of transforming the input 9 times in total is the same. ↩

  2. This is, of course, a vast oversimplification of how the Bombe worked. I haven’t even mentioned steckers or menus or scramblers, much less how the circuitry actually worked. Graham Ellsbury has the the best detailed breakdown of the Bombe that I’ve been able to find online if you want to dive deeper. ↩

  3. Fun fact, the Brits codenamed the machine FISH and the ciphered message TUNNY, so that together, the whole thing was TUNAFISH :) ↩

  4. Computerphile on YouTube has a great playlist of videos about the Lorenz cipher. ↩

  5. This presentation was given as a talk in 2023 for the University of Queensland Mathematics Student Society. As an aside, I find it so indescribably beautiful that the right combination of words entered into DuckDuckGo led me to a whole archive documenting a completely random group of people’s love for, and expertise in, their shared interest. It’s amazing how much is out there, just waiting to be found, 50 DDG searches into a hyperfixation. ↩

  6. Tom Scott has a great video explaining what the halting problem is and how it proves the unknowability of computer programs. ↩

Don't miss what's next. Subscribe to This Is A Working Title:
Powered by Buttondown, the easiest way to start and grow your newsletter.