Dr Mark Baldwin provides an authoritative introduction into the origins and working of the Enigma cipher machine, relied upon by the Germans to provide security for millions of wireless messages in WW2. Polish cryptanalysts first broke the ciphers in 1932, providing the basis for subsequent extensive codebreaking operations at Bletchley Park.
Enigma: The Machine Turing Mastered
Auto-generated transcript - may contain errors. Tap a timestamp to jump the video.
Thank you. Thank you very much. Thank you. I'm not sure I'll be able to tell you everything because I haven't got long enough, but I hope I will tell you some things that you haven't come across before. Some people might have wondered why the name of Alan Turing is attached to this particular event.
And obviously, the IT side of Alan Turing's life and history is extremely important. I'm going back a little bit earlier than that in the sense that we're going to look at the German cipher machine, the Enigma machine, and try to understand how it worked.
I'm trying to explain how it worked and thus give you some idea of the significance of the work that Alan Turing did at Bletchley Park as a code breaker during World War II. That is the standard Enigma machine with which all the German armed forces were equipped for something like ten years before the war started.
It looks a bit like an old fashioned typewriter, as you can see, because it has three rows of typewriter like keys along the bottom there. It's enclosed in a very old fashioned way in an oak case, and we're looking at a standard machine, a three rotor machine.
You can't see anything that looks like a rotor here, but we're looking at three lines, three vertical lines there and three little squares. Those three lines are the flanges, one flange attached to each rotor. So, that's a standard German Army Air Force or Navy Enigma machine with which they chose or sought to make secret every single wireless communication during World War II. Now, why did it get adopted at the time?
Well, to understand the rise of the Enigma machine, we have to go back to nineteen hundred and one when Marconi demonstrates for the first time the practicability of a new communication system. He had this crazy idea that you could send electromagnetic radiation through the air and make things happen at a distance, and thus use that as a basis of a communication system.
That he did, that he proved in nineteen hundred and one, but he was up against the vested interests of the people who had already created a worldwide network of cables, a high speed electrical communication system, and they were not very keen that a new guy comes on the field and says, look, I can do what you're doing and I can do it without the wires.
And that's why, of course, he called it wireless. So, he had a difficulty getting this accepted during the first years of the last century. But by the time we get into the first world war, the military men realized what a wonderful thing wireless was going to be.
Here we have an advert from nineteen fifteen, the latest model of science applied to warfare is wireless fitted too fast motor cars. Because wireless gave resender and receiver two people at the end of a communication link, even if they are moving around, they can now remain in contact, real time contact, using wireless.
It allows them to escape from the traditional techniques which required either that sender and receiver could hear each other or could see each other or be connected together by a wire or write down a message and give it to a man or a dog or a pigeon to take from one to the other.
Wireless allowed them to escape from all those limitations, but the mere adoption of wireless on a very large scale for military purposes during World War two sorry, during World War one demonstrated the need for yet another piece of equipment, and that is a piece of equipment which would disguise the message because the one feature that you must not forget with wireless is that it confers zero security.
So although the military men wanted to use wireless and appreciate its benefit, they needed some way of making the messages secure. You need something that will disguise or scramble or encode or encipher the message so that even though the enemy can detect the fact that you're sending a message, you hope he is not clever enough to work out what the content of that message is.
And therefore, the mere adoption of wireless created the demand, demonstrated demand for a new piece of equipment, a scrambling device, a high speed scrambling device because the messages travel at the speed of light therefore the pressure is on to process them quickly at the sender's end and to reverse the process at the receiver's end.
Various people in various countries realized that there was a need for such a machine, but the first man to take out a patent on a sophisticated machine to be used in conjunction with wireless was a German by the name of Arthur Sherbius, and he applies for his patent on the twenty third of February nineteen eighteen.
In other words, before the end of the first world war. So although the Enigma machine only comes to international significance because of its role during world war two, its origins actually lie very definitely in world war one. It's a rotor cipher machine. It creates a substitution cipher. That's all it does.
You put in one letter, you get another letter out. Your input section is the three rows of typewriter like keys here. It does make the machine look a bit like a typewriter, but remember there's no space bar, there's no numerals, there's no punctuation.
You press one of these keys here, you just have a choice of twenty six uppercase letters. Press a key on the keyboard and you will light a lamp on here on the lamp board. That's our output section. The machine does not transmit. It does not record, it does not remember or print out.
You press a letter on the keyboard, you might press key P, it might light up lamp bulb Q. Q is therefore the ciphertext at that moment, the ciphertext of P. And you, as German operator, must write down that Q with pencil and paper because once you've taken your finger off the P key, the Q goes out and it's lost.
If you press the key again, you will almost certainly get something else. You might get a Z. Press it a third time, you might get a P. Because it's a continually changing substitution cipher pattern and the change is executed by having the rotors.
They are called rotors because they go round during the operation and the wiring which links the keys to the lamps, the keyboard to lamp board, is inside the rotors. Therefore, if the rotors go round, they change the pattern of wiring inside the machine.
Every keystroke turns at least one rotor round, and if you turn the rotor around, you change the pattern of wiring. Hence, a very complicated cipher and a very difficult one to actually to break. To tell the operator what position, what rotational position the rotors are in, there are three little windows.
Those three little white squares are holes cut through that inner metal lid, and the operator can see a letter or a number depending on the type of machine, either one to twenty six or A to Z, and that tells the rotor right, I beg your pardon.
Tells the operator what rotational position the rotor is in. They are an it's an index ring and it tells the operator what rotational position it's in because he needs to know where to set those rotors at the beginning of encrypting a particular message.
If you press key p and it lights up q, you do not expect or need to see p's and q's up there. Those letters or numbers are important, but they are not part of the message itself. So, are the three main sections. Keyboard for input, lamp board for output, rotors which go around during the operation and provide the greater part of the cryptographic power of the machine, and down at the bottom, a plug board to which I shall return in a moment.
If we open that inner metal lid, we can now see the three rotors side by side. You see the notched flange of each rotor looking something like a bicycle sprocket and you see a lettered index ring attached to each one. And those three movable rotors are clamped between two stationary devices, Entry rotor over here, reflector rotor here.
Every time you press a key, a current flows through these rotors, through the wiring inside the rotors. It's turned around by the reflector rotor over here and it goes back through the rotors a second time and then out through the entry rotor on the right hand side and down to the main body of the machine.
And there's something which finally does look like a rotor. Not surprisingly, the two sides of the rotor look The left hand side, you can see there is a ring of twenty six brass contact studs there and on the right hand side, we've got a ring of twenty six little brass pins, sprung brass pins sticking out the face of the rotor, sticking out towards you.
And you will readily sense, think, that if I were take those two rotors and press them together, it's the sprung brass pins on one rotor coming up against the studs on the adjacent rotor that allow two essential things to happen. One, you can turn any one rotor ad infinitum without getting any wiring twisted because when the rotor goes round, it takes with it the pins and the studs and the wiring inside the core of the rotor.
That all goes round as a unit, so nothing gets twisted up. Secondly, when it stops, there's always a set of pins in contact with a set of studs on the adjacent rotor. So, electrical connectivity and infinite rotation is made possible by this spring and stud system.
The disassembled rotor at the top shows what looks like a rather messy set of wiring inside the rotors. But it's very simple in concept because on one face we have twenty six studs, on one face we have twenty six pins, Inside, we have twenty six pieces of wire, and each wire joins one pin uniquely to one stud.
And when you have soldered all twenty six wires into the rotor, then every pin and every stud has one wire and one wire only. And you will doubtless already have realized that the number of ways you could wire the rotor is twenty six factorial, roundly four hundred million million million million.
That means in essence that in the Enigma office, there isn't one just like that. But if you imagine a conceptual Enigma office in the office, they have as it were on the shelf four hundred million million million million different wiring patterns that they might invoke at any one time.
And of course, do not believe or understand that their enemies know what those wiring patterns in use actually are. And, of course, in the machine, there's not just one rotor, there's three together. And the effect of having three rotors together is that the number of wiring patterns in the set of three taken together is not four times ten to the twenty six, but sixty four times ten to the seventy eight.
So, you begin to see where the cryptographic power of this machine comes from. That's the plug board. The front of this old fashioned oak case will fold down exposing a vertical plug board. And you can see it has a number, twenty six, paired sockets, a larger diameter over a smaller diameter one, and a number of plugs and cables.
And if I were to take this plug here and plug it into the sockets labeled V and this one and put it into socket labeled T, then every time the machine would have given me as output on the lamp board a T, it will now show a V.
And every time it would have shown a V, it will now show a T instead. So, it's an extra stage of scrambling in addition to what is happening inside the rotors. The machine will work equally well with no plugs or one pair or two pairs up to thirteen pairs.
Thirteen pairs, the board is full. It will work with as long as you're plugging the letters together in pairs, it will work equally well with any number of pairs on the face of the board. And each arrangement will give you a different cipher pattern.
It'll give a different twist to the cipher pattern. And there are roughly five hundred million million ways you can arrange anything from zero pairs to thirteen pairs on the face of the board. Now, you might think that five hundred million million is a comparatively small number when you remember a single rotor is worth four times ten to the twenty six.
It does multiply the number of possibilities for the machine by another five hundred million million, but the real virtue of it is not that it makes the all up number bigger, but that you can change it easily. The you can't have the German operators in the field prising open the rotors and resoldering the connections from time to time.
You can have them move the plugs around. Indeed, the instructions which they are obliged to work to, which come down from on high, tell them every single day at midnight the plugs must be put into a different confirmation on the board, laid down from on high.
It's not left up to the operator to decide. And that means at Bletchley Park, it has serious repercussions. Bletchley Park where they are trying to break the ciphers generated by this Enigma machine, it means that every night at midnight they have to try to break a fresh cipher because the wiring pattern in every single Enigma throughout the German Armed Forces has been changed.
And it's even worse than that because there's not just one wiring pattern that is created each day at midnight. The German communications are divided into several dozen different networks and each network uses a different setup for its enigma machine which it changes every single twenty four hours.
So, at Bletchley, the problem is not breaking the enigma code. It's trying to break several dozen every day, every night starting at midnight. And that is a prodigious effort. It takes a prodigious effort. We did break a very large number, but not surprisingly, we did not break them all.
But certainly, we were breaking by the end of the war several thousand messages per day. The all up figure for wiring a three rotor machine is that one, three times ten to a hundred and fourteen. And I like to say to people it's unless you are an astronomer or a physicist or indeed a mathematician, that might very well be the biggest number you ever come across in your life with any real meaning to it.
Because we are told that the number of atoms in the observable universe is only ten to the eighty. And here, we've got ten to the hundred and fourteen. So, we've got a portable machine with a modest power requirement, an onboard battery. You can carry it around in one hand.
It's pretty well a hundred years old in concept, and yet it offers not just more cipher patterns than there are atoms in the observable universe, but millions of times more. And it gave the Germans every confidence in the security of this system. They were effectively dazzled by it.
They said and they were quite right to say that you cannot break enigma by trying three times ten to a hundred and fourteen possibilities one after the other. They said, we are going to use this machine to encipher, to disguise every single field radio message we send during the war.
And we know the British will listen in, but we hope they will not understand what the content is. They might, the British the Germans said, the British might guess that we are using a three rotor cipher machine. And that's not such a wild guess as you might imagine because the Enigma machine had been patented in Britain in the nineteen twenties.
Because its commercial maker could not sell it to the German government in the nineteen twenties. It wasn't until the end of the twenties that they realized its benefit and took it over to help them during their rearmament period. So it was quite sensible that the Germans might say that the British would know or would guess that they're using a three rotor cipher machine, but the Germans said, they will not know the wiring inside the rotors we are using and each one each rotor could be wired in four times ten to
the twenty six different ways. So they said, if the British were to build a giant test rig in which they could run through all the arrangements of the wiring links in that one at a time to go through three times ten to a hundred and fourteen different patterns to see which one turned an intercepted German wireless message back into German, the war would have finished long before the first test was complete.
And that is absolutely right. You cannot even now with modern computing power, you cannot break enigma by trying all those things one after the other. What the Germans seem to have failed to think is that it might be possible to get in by using mathematics.
And, it was three Polish mathematicians commemorated on this giant bronze book, three Polish mathematicians who actually broke Enigma first in nineteen thirty two. Poland had a border between them and Germany drawn up under the treaty of Versailles. The Poles were not optimistic to think it would last forever, and the Germans resented it.
It was imposed upon them. They did not like it, and Poland therefore realized that because Poland was militarily weak and would not be able to keep out an invading German army, that it did it would be a good idea if Poland gathered as much intelligence as they could about German intentions, not because that would enable them to defeat the German army, but it would enable them to minimize the damage that the invaders might otherwise bring about and inflict upon Poland.
So, right from the late nineteen twenties, they were monitoring German wireless traffic. They realized in the late twenties a new system had been adopted by Germany to encipher their wireless messages. And the Polish Cipher Bureau gave its three star mathematicians, Reevsky, Ozicki, and Zygalski, gave them the job of trying to break enigma.
And they did that by nineteen thirty two, and that is an extraordinary achievement because nobody else had done it and most people believed it was impossible. We must admire them for having done that. We must also be very grateful to them because before the war started, in July nineteen thirty nine, that's before the war started, realizing they were going to be invaded, they handed, the Poles handed to their two allies, Britain and France, everything they knew about Enigma code breaking, including a replica Enigma machine.
They did not know everything there was to know. They were not They hadn't got a long way down the road of breaking German naval Enigma, but nevertheless, they gave a big start to Bletchley Park, the British code breaking center. It would not have got going so quickly had the Poles not given us that information.
So, remember them with admiration for the intellectual feat of having broken Enigma in nineteen thirty two, and remember them with gratitude because they shared that with the British and the French before the war started. Now, you obviously gather that the enigma machine can substitute make a substitution cipher.
It can scramble a message in one of many hundreds of millions of different ways. How does the German intended receiver turn that back into original German? Well, the machine will act reciprocally. That is to say, provided the sender knows that his machine is set up exactly the same way as the sender's machine.
So, sender and receiver have to have their machine set up exactly the same point. If the sender were to encrypt a letter and send it by Morse code, if the receiver types that into his machine, it will the machine will automatically turn it back into the original plain text.
So, the machine acts reciprocally, but it's essential for sender and receiver to start from the same point. And to enable the Germans to do that, they issued this little red so called code book. It's a settings book which tells the operators different every day.
The book only lasts for a month, but it gives different instructions for every day. It tells the operators how to set up their machine. And, of course, it's essential on a German communication link for there to be firstly a wireless, at each sorry, an enigma machine at each end of the wireless link and also a red code book to enable them to break, to to decipher the incoming message.
This is Alan Turing. This is a figure you a photograph you'll be very familiar with. It was taken when he was elected as a fellow of the Royal Society. And his greatest or most visible, it's not the only, but his most visible contribution to the work of Bletchley Park, the British code breaking center during the war was the invention of this giant machine called the bomb.
It's not a computer. It's not a proto computer. It has no electronic power, and it has no computing power at all. It's a very ingenious electromechanical testing machine. The code breakers have to hypothesize that a particular message contains a particular digit string, and they can use this machine to check whether it has or not.
All those little disks on the front are purpose made rotors which emulate the wiring inside the German rotors, and we knew what the wiring inside the German rotors was because the Poles had worked it out and told us what it was before the war started.
In the film, The Imitation Game, which I'm sure some of you will have seen, Turing is very badly portrayed as also is the CEO of Bletchley Park, Denniston, as there's a kind of character clash there, a personality clash, as if Turing was foisted upon Denniston, an unwilling Denniston, and then Denniston tries to get rid of him.
As you remember, scenes with the military police and so on. Just look at this document from nineteen thirty nine, January nineteen thirty nine, Denniston starts to run crypto courses to train code breakers so that when the if and when the war comes, they can be taken straight to Bletchley to start work.
And, on that very first course that he runs in the first week of January nineteen thirty nine, eight months before the war started, you see Deniston giving the keynote address here, AGD, that's Deniston, and you see Turing given being given the job of looking at enigma.
So, the way he's portrayed, the way Deniston and Turing are portrayed in the film is a very very long way from the truth alas. So, the Turing's great achievement was to devise the bomb. It doesn't break Enigma, but it helps the codebreaker search for the settings of the Enigma machine. We did not have one bomb.
We had over two hundred by the end of the war. And to give you a final slide, to give you just some idea of the scale of the operation, look at the white band there. That's German naval messages encrypted on enigma, intercepted in UK and broken at Bletchley Park.
And you see some idea of the scale. Over a million and a half messages were intercepted. They're not all broken, but over a million messages were. And you can be absolutely certain that the high quality intelligence produced by breaking so many messages, thanks to Alan Turing, thanks to the bomb, made a material difference to the way in which the war was conducted.
Ladies and gentlemen, I'm at the end of my time. If anyone wishes to get a better understanding of the Enigma machine, we've got two Enigma machines out on the tables out with the stands there. Do come along and play with one of those if you want that final gloss of understanding because I perhaps rushed through some of the details too quickly.
Ladies and gentlemen, thank you very much for your attention. Thank you.