What is an Enigma machine?

The Second World War cipher machine was crucial to the German war effort — yet cryptographers at Bletchley Park, led by Alan Turing, cracked its code. We look at the life of the mathematical genius and Enigma’s significance to modern computing

Words by Andrew Hodges
A four-rotor Enigma cipher machine, Heimsoeth and Rinke; November, 1941. One of the rarest Enigmas, and among the hardest to decrypt. Sold for $718,200 on 10 September 2024 at Christie's in New York

A four-rotor Enigma cipher machine, Heimsoeth & Rinke; November, 1941. One of the rarest Enigmas, and among the hardest to decrypt. Allied efforts to break the M4, under the leadership of Alan Turing and Joe Desch, led to the development of the first programmable computer. The machine’s use of four rotors, instead of the earlier three, and the operator’s ability to select these from a pool of eight interchangeable rotors, together with stricter operating procedures, gave the M4 Enigma a much higher level of encryption. Sold for $718,200 on 10 September 2024 at Christie’s in New York

The British mathematician Alan Turing led the Second World War struggle to break the German enciphering machine, the Enigma. This machine, used by all German armed services, encoded the 26 letters of the alphabet in complicated ways determined by the settings of its revolving rotors.

Turing’s name made headlines with the release of the 2014 film The Imitation Game. Amid the fanfare, it is easy to forget that the Enigma was part of the grim and grimy reality of warfare, as shown in the German film Das Boot (1981) and more recently the TV series of the same name.

The U-boat war depended on the radio messages that transmitted orders, positions and reports between the submarine fleet and its command structure. It was therefore the U-boat Enigma messages that were the most vital, and the special four-rotor M4 Enigma machine played a crucial part in this story.

The war, however, did not start with the M4. By 1939, the German armed forces all used the standard military Enigma, with just three rotors and an extra plugboard. This had been penetrated with remarkable speed by Polish cryptographers.

A three-rotor Enigma cipher machine, Heimsoeth & Rinke, circa 1937. Number A7762, with complete electrical wiring and three matching aluminium rotors. Sold for £93,750 on 27 April 2017 at Christie’s in London

In 1938, British Intelligence recruited Turing as its first mathematician. Until then, classicists and linguists had dominated. Turing came from Cambridge, where two years earlier he had laid out the theory of modern computing, but had also spent two years at Princeton. His PhD in logic was combined with a serious interest in new machinery. In 1939, Turing was to gain the important advantage of the brilliant mathematical work on the Enigma that the Polish cryptanalysts Marian Rejewski, Jerzy Różycki and Henryk Zygalski handed over to British Intelligence.

Working at Bletchley Park, the wartime centre of British codebreaking operations, Turing and his colleagues rapidly devised a completely new kind of machine. It was a search engine for Enigma settings that used electromagnetic relay technology and was known as the ‘Bombe’, a name derived from an earlier, less powerful Polish machine. Its inspired logic, a joint effort by Turing and fellow Cambridge mathematician Gordon Welchman, could overcome the complexity of the Enigma’s plugboard, provided about 25 letters of a message were correctly guessed. By May 1940, the first Bombe was decoding the Luftwaffe’s messages.

Alan Turing and colleagues working on the Ferranti Mark 1 Computer in 1951. This was based on a prototype known as the Manchester Mark I, built at Manchester University in 1946

Alan Turing (right) and colleagues working on the Ferranti Mark 1 Computer in 1951. This was based on a prototype known as the Manchester Mark I, built at Manchester University in 1946. Photo: The Granger Collection / TopFoto; SSPL / Getty Images

The German naval forces, however, used their Enigma machines more carefully than the air force. In particular, they added a further level of security through an extra ‘bigram table’, provided to the operators in special papers. In modern terms, it might be likened to an extra password that needed to be hacked.

Turing relished this challenge, although he recognised that success would be impossible without the capture of code books. In September 1940, Commander Ian Fleming, then of the Naval Intelligence Division, and later the creator of James Bond, was planning just such a capture. When that operation was cancelled, Turing was described as being ‘in a stew’ by Frank Birch, the intelligence officer who acted as a go-between.

In the event, Turing had to wait several more months. As Hugh Alexander (who took over from Turing in 1943) wrote, ‘the capture of the February 1941 keys changed the whole position’. By this time, Turing had recruited a high-level team of young mathematicians and champion chess-players. Heading ‘Hut 8’ at Bletchley, he developed a highly sophisticated statistical system called Banburismus in order to extend the breaking of the naval Enigma messages without requiring further captures.

In late 1941, as the United States was drawn into an undeclared Atlantic war, the resulting supply of deciphered Enigma material constituted a major component of what Britain had to offer the new alliance — an alliance that was ultimately sealed by the attack on Pearl Harbor.

Three of the four rotors from an M4 Enigma machine. The upgraded model defeated the efforts of Allied codebreakers for 10 months

This incredible level of success had all been achieved with the three-rotor Enigma. But this was abruptly terminated on 1 February 1942, when the Atlantic U-boats switched to the new M4 machines. The change was technically a minor upgrade, as the new fourth rotor was not fully independent. Yet even this small adjustment meant that Bombes would take weeks rather than hours to find the settings. Where before there was a supply of hundreds of messages a day, now there was a blank. Germany had regained the advantage.

The response to the M4 crisis involved further daring operations, which were fictionalised in another Hollywood film, U-571 (2000). But at Bletchley Park it also led to a desperate quest for extra speed. Electronic technology was tried for the first time, being potentially a thousand times faster; and although this did not result in electronic Bombes, the introduction of electronics to Bletchley had an unexpected impact.

Electronic technology was much better suited to the attack on quite a different type of cipher — the kind used by Hitler’s high command. So, indirectly, the challenge of the M4 stimulated the work that led to the development in 1944 of the famous Colossus, the world’s first large-scale digital electronic computer.

The M4 was issued with eight rotors: five of these were identical in internal wiring with the five rotors issued with the three-rotor Enigma. With the fourth special rotor in the ‘A’ position, the M4 could communicate with the three-rotor Enigmas in use by other branches of the military

The introduction of the M4 also spelt the end of British independence. Meeting its challenge required the industrial resources of the United States. A hundred American Bombes were built at Dayton, Ohio, where the National Cash Register plant had been taken over for the war effort. Turing himself crossed the Atlantic in November 1942 to establish top-level technical liaison. He thus set the scene for the BRUSA intelligence agreement, the origin of the NSA-GCHQ link of today.

Back at Bletchley, there were occasional breaks into U-boat Enigma messages, which developed more systematically after November 1942 thanks to captured papers and ingenious new methods. But it was only after June 1943 that regular, industrial-scale production resumed, on the basis of data-sharing with the Americans. The result was that, even as the German U-boat fleet grew, it was effectively neutralised.

Few M4 Enigmas survived the war, partly because they were produced in much smaller quantities than the three-rotor machines. In addition, each U-boat was equipped with multiple Enigma M4s, and the majority of these were lost when the vessels were sunk in combat or scuttled by their crews at the end of the war.

Alan Mathison Turing (1912-1954), ‘On Computable Numbers, with an Application to the Entscheidungsproblem’ in Proceedings of the London Mathematical Society, 30 November 1936 — 23 December 1936. London: C.F. Hodgson & Son, Ltd. for the London Mathematical Society. First edition of the foundation of modern digital computing, introducing the concept of a ‘universal machine’ for the first time. Sold for £200,000 on 15 December 2021 at Christie’s in London

Turing, meanwhile, had been captivated by the speed of digital electronics, and now looked to the future. On 6 June 1944, as the invasion of Europe benefitted from his Enigma work, Turing submitted a report on an advanced version of the electronic speech scrambler, the cumbersome American system that enabled Roosevelt and Churchill to converse securely. Turing’s own system, called the Delilah, was small and neat. But he had in mind something much greater: the design of an electronic computer, in the full modern sense. His approach to the Enigma problem had been enhanced by the familiarity he’d developed with relay technology in 1937.

The 1944 speech scrambler gave Turing hands-on experience with electronics, as a warm-up for his detailed computer plan of 1945. This, the Automatic Computing Engine (ACE), was what he called a ‘practical form’ of the concept of the ‘universal machine’ that he'd first discovered in his 1936 work.

It embodied an idea that is now taken for granted, namely that a computer allows the solution of new problems by the writing of new software, rather than the building of new hardware. This was a revolution, and Turing would have liked to mastermind it in the same way as he had attacked the Enigma.

The National Physical Laboratory backed Turing’s plan, but did not allow him to continue bridging the gap between abstract theory and engineering practice. The Pilot ACE was completed in 1950, but Turing had meanwhile found a different niche at Manchester University, where he pioneered not only the building of computers but their application, opening up fields of Artificial Intelligence and the theory of biological growth.

Sign up for Going Once, a weekly newsletter delivering our top stories and art market insights to your inbox

Turing was as unconventional in life as in science. As a homosexual, he was at odds not only with British criminal law as it then was (he was prosecuted in 1952) but also the post-war demands of national security (his work for GCHQ was terminated). The M4 had made him the living repository of top Anglo-American secrets, which meant that his subsequent sex-tourism in Norway and Greece could hardly have been better calculated to arouse the anxiety of security officials.

It is nevertheless a bitter irony that in the post-war world made possible by his conquest of the M4, Turing was not free to live as he chose. Against this background, his death in June 1954 is not such a surprise. In 2013, the computer pioneer and codebreaker was given a posthumous royal pardon for his 1952 conviction for homosexuality. In 2021, the Bank of England, in recognition of his immeasurable contribution to the war effort and to computing, released a £50 note featuring his portrait.

Andrew Hodges is the author of Alan Turing: The Enigma — The Book That Inspired the Film The Imitation Game (Updated Edition), Princeton University Press (2015)

Related departments

Related lots

Related auctions

Related content