Jeremy McCarthy, a volunteer at the National Museum of Computing and a guest speaker at a recent CCS meeting, shares his fascination with code breaking and how it led to him spending a year of his life recreating an example of a Polish Bomba.

Bletchley Park in Buckinghamshire is a museum dedicated to the code breakers of the Second World War. Outside the nineteenth century Gothic revival mansion, there is monument to a Polish team of code breakers. It commemorates... ‘the [pre-war] work of Marian Rejewski, Jerzy Różycki and Henryk Zygalski, mathematicians of the Polish intelligence service, in first breaking the Enigma code. Their work greatly assisted the Bletchley Park code breakers and contributed to the Allied victory in World War II.’

While the work of the British code breakers is widely known from books and films, what is not so widely known is the contribution played by the Polish Cipher Bureau. Between the First and Second World Wars, the Polish cryptologists Marian Rejewski, Jerzy Różycki and Henryk Zygalski created various systems to help with the decipherment of Enigma transmissions sent by the German army.

Realising the gravity of what was being transmitted in the summer of 1939 and anticipating the imminent invasion of Poland, the Polish Cipher Bureau met with French and British military intelligence at Pyry, south of Warsaw and shared their decryption methods, including a device they called a ‘Bomba’.

Rediscovering the Polish Bomba

Although no original Bombas exist, papers by co-inventor Marian Rejewski, published in 1967 and 1979, contain a sketch of how the original machine looked, with a description of how it worked. At the beginning of the war, the German army was using an Enigma with three rotors, with six possible ways of inserting them. Using six sets of Enigma rotors, the Bomba replicated every position the rotors could be in, to produce an outcome - sometimes taking up to two hours to determine the positions of the rotors.

Some 2,000 BTM (British Tabulating Machines) documents and drawings about the British designed Turing-Welchman Bombe were released by GCHQ 50 years after the end of the war. John Harper, a retired computer engineer, decided it was time to reconstruct the mammoth machine.

Recruiting volunteers and engineers who had worked on the original machine as well as receiving support from the British Computer Society, Quantel, Nortel, and other companies, he led a Computer Conservation Society team to work on the Bombe reconstruction, which was subsequently first demonstrated at Bletchley Park in 2006. In May 2018, the Bombe Rebuild was transferred to the National Museum of Computing.

The Polish Bomba rebuild

Following on from the Turing-Welchman Bombe reconstruction, a Polish Bomba reconstruction took place in 2019. Utilising his background in IT, Jeremy McCarthy, a volunteer at the National Museum of Computing at Bletchley Park and also at the Pilsudski Institute (Instytut Józefa Piłsudski) in Hammersmith, West London, recreated a Polish Bomba replica in a mixture of hardware and software: a version of the Bomba that could be touched and used for determining Enigma settings.

‘‘The Polish machines were all made using real mechanical rotors, which would have required a lot of serious engineering, along with hand-wiring... However, I cheated quite a lot by doing most of it in software. At the heart of my rebuild there is a laptop in which all the rotors are simulated. There’s a two-line retail display, sitting on top, so you can read the positions of the rotors without actually having to have real rotors.’

The machine works similarly to the original Polish Bomba, as first envisaged and realised by the Polish decryption team of Marian Rejewski, Jerzy Różycki and Henryk Zygalski between 1932-7 - but without so much of the engineering, so it is somewhat smaller than the likely size of the original machine. It may not look exactly like the original Bomba, but it replicates the Bomba's results.

The enigma - part of a family of machines

McCarthy explains: ‘There is no such thing as a single Enigma; there is an entire family of machines. I felt it was important to try to understand the challenge of the various systems and how the Polish mathematicians created what they did. Apart from the Bomba, the Poles created other decryption systems, one of which is called the Zygalski sheets.’

The Zygalski sheets, invented by cryptologist Henryk Zygalski, consisted of a series of perforated sheets, which, when superimposing received Enigma message headers, were able to determine how the ring settings were set on the rotors.

Fellow cryptologist, Różycki, created the Metoda Zegara (the clock method) in 1933-5 for determining the right-most rotor position in the 3-rotor German Enigma. The method was enhanced by Alan Turing to five and then to eight rotors as the German encryption became more complicated. Alan Turing called his system Banburismus.

McCarthy continues: ‘The Poles also created a machine called the cyclometer which did some analysis on a large group of messages by which you could produce a table that could possibly allow you to work out what the rotor settings were for a given series of messages.’

Breaking the enigma code

McCarthy has a collection of flow charts about how the software on his Bomba works; however, the basic premise is quite simple: ‘If you’ve got a rotor positioned at A and the ring set to A then that’s equivalent to having a rotor positioned at B and the ring set to B and its equivalent all the way down the alphabet as far as having a rotor set to Z and the ring set to Z, to a first approximation. So, I can create some messages, encrypt them, then, with sufficient females, run the Bomba to determine, approximately, the rotor positions and Ring Settings that I used in those messages. The Polish Bomba would take around two hours for a run. I can do a run in a few minutes and a simulated bell rings at the end.’

McCarthy continues: ‘While the Enigma was a German military machine in this context, it had been available for general use in the mid-1930s. Before they were used for military purposes, they were used for banking cryptography. In those days, you could go to a supplier and buy Enigma machines for non-military use. The main difference was that the commercial Enigma didn’t have a plugboard; that was added when the Enigma was militarised.’

The plugboard added another layer to the encryption problem. It is calculated that the Enigma machine had around ‘157 million million million ways to set up the machine’ and yet, the code was broken. So how did the Polish cryptologists get a ‘foot in the door’?

How the code was broken

McCarthy explains: ‘The German military would use the Enigma machine, sending an encrypted version of the three-letter message key twice at the beginning of a transmission. So, if there were two letters that were the same in the twice sequentially encrypted message key, that gave the code breakers an ‘in’ on to how to break it.

Something similar happened when they were studying the Lorenz cypher that Colossus was eventually created to break because a very long message was sent and it was not received properly at the far end and it was then resent using the same key. Now, if the exact same message had been resent using the exact same key, it wouldn't have mattered, but, instead, a somewhat modified version of the message was sent the second time. This enabled those listening in to say: “Well, there’s obviously something that’s changed here between these two letters and therefore we can probably work out how the machine was designed.” And so they did.’

The same was true of the Polish Bomba. It was the repetition that gave the cryptologists a clue as to how the code was put together. The Polish team noticed that when there was the same letter, three characters apart, it formed a pattern. McCarthy continues: ‘The Polish phrase ‘te same’ means ‘the same’. However, perhaps as a joke, this was corrupted to become ‘samica‘, which means ‘a female’. They’re also sometimes called ‘okulary’, or eyeglasses, because you have a string of characters and two identical letters gazing out at you, a bit like the lenses of a pair of eyeglasses.

‘The number of positions that the rotors can take is 17,576. If you’ve got females - or the two letters three positions apart encrypting to the same letter - then that’s reduced to only 676 positions. And then if you have three of these scattered around the code space then you end with up with only one or two settings which can be possible. So, given patterns like that, you can determine in which three positions the rotors may have been inserted, and their ring settings.’

Do Bombes and Bombas enjoy the same outcomes?

McCarthy adds: ‘I was curious to know if the Turing-Welchman Bombe could be used in the same way as a Polish Bomba. I determined eventually that the answer is, yes, you can - sometimes - the details of which may be of interest in due course to the Bombe Rebuild Team. At TNMOC, we have the reconstructed Bombe, but I’m not allowed to touch it because it’s a highly valuable artefact. However, simulators such as the Lysator Bombe Simulator are available online, and I was able to use this to test my theory.’

Apart from the Polish inventions mentioned above, there is a French version of a Polish-designed Enigma machine at the Instytut Józefa Piłsudski, in Hammersmith, West London. No one is too sure of where the machine actually came from, but it is one of the very few original machines left. ‘Even the people who are the curators of this museum aren’t entirely certain of its movements from somewhere in France to somewhere in London.’ says McCarthy.

So why didn’t we keep the originals?

At the National Museum of Computing, and at Bletchley Park, almost all of the exhibits have had to be recreated. So, why didn’t we preserve the machines that helped to win us the war? McCarthy explains: ‘They were destroyed under orders. They say Winston Churchill said, “all of this must be smashed.” And so it was.’

And what of the three Polish cryptologists who broke the Enigma code? McCarthy continues: ‘Marian Rejewski went to work at Bletchley Park and neighbouring outstations and then returned to Poland at the end of the war. Różycki didn’t survive the war; he was on a ship in the Mediterranean that was either torpedoed or sunk in bad weather in 1942. And Henryk Zygalski stayed in Britain after the war and became a maths lecturer at the University of Surrey. He remained in the UK, in obscurity, until his death in 1978.’