Hello, everyone! Today I'm in Bletchley Park museum. And Bletchley Park is famous as the home of the British code breakers in World War II. You might have heard of the Enigma machine before. That's the code machine that the German soldiers were using in World War II to send each other secret coded messages. But I'm not going to talk about the Engima machine today. Today I want to talk about this machine. And this is called the Lorenz machine. And this is the code machine used by Adolf Hitler, and the top level of the Nazi party to send their secret messages. If we can break this code, we'll be able to read secret messages from Adolf Hitler himself. And that's exactly what we did! Now, this machine isn't as famous as Enigma, which I think is a shame, so I'm going to tell you about it. I'm going to tell you all about this machine, I want to talk about the code breakers who broke this code, people like John Tiltman, Bill Tutte, and Tommy Flowers. And I want to show you how they broke this code. And they did all this without ever seeing the machine itself. So in the 1940's, a teleprinter would transmit letters of the alphabet using electrical impulses. A pulse could either be on or off. If it was on, it was written as a cross [x], and if it was off, it would be written as a dot [•]. It's a bit like how Morse code uses dots and dashes, or ASCII on the internet uses 1's and 0's. So let's say I want to send the letter 'C'-- then that would be a dot, cross, cross, cross, dot [•xxx•]. Now, what the machine would do is it would add on a random letter. Let's say it generates the letter 'M'-- so there's the letter 'M' here, which is dot-dot-cross-cross-cross [••xxx]. And they're going to add together, and the rule is if two symbols are the same, it becomes a dot [•], if two symbols are different, it becomes a cross [x]. So let's try this out. I'm going to add the first two symbols together, and because they are the same, they become a dot [•]. So I'm going to draw that in. Now if we do the second symbols, we add them together, you can see they are different, we have a cross and a dot, so that makes a cross [x]. The third symbols are actually the same, they're both crosses, so that becomes a dot [•]. So I write that one in as well. The fourth symbol are both crosses, so again, it becomes a dot [•]. And the fifth symbol, in this case, are different--we have a dot and a cross, so if we add them together, we actually get a cross [x]. So the final answer is dot-cross-dot-dot-cross [•x••x], and in this language, this is the letter 'L,' and that's your code letter. So the reason this is clever is because if you add the key letter again, you actually get back to where you started. So if I take my example from before, we have the code letter 'L'--if I add on the key letter 'M' again, it actually becomes the original letter--the letter 'C.' You can check that out for yourself. So adding the key twice actually cancels itself out, and you get back to where you started. And that's the point. The Lorenz machine would generate a key and add it to the message. But at the other end, you would have another machine, it would generate the same key, and it would cancel itself out, and you would get the original message back again. So the machine actually made two keys. On the right, you've got five wheels that make your five dots and crosses, which are then added to your message. Those are called the Chi wheels. Then on the other side, on the left, you've got another five wheels making another five dots and crosses, and those are called your Psi wheels. And so all together, you've got key one plus key two. And then that is added to your message. Now, the Chi wheels actually move after every letter. The Psi wheels don't move after every letter. They move about half the time. They don't move with any regular pattern, though. That movement is actually controlled by these two extra wheels in the middle. And those are called the motor wheels, or the Mu wheels. And so all together, you've got twelve wheels in the machine. So how many ways are there to set the machine? Well, on the outside of each wheel, you have a number of pins, and those pins can either be set to 'on' or 'off,' which means it's either generating a pulse or not. Now, how many ways can you set these pins? Well, there's 501 pins all together, so the total number of ways to set them is two to the power 501 [2^501], which is a huge number! It's bigger than a googol, and a googol has a hundred zeroes This number would have 150 zeroes. So if you like, that would be like 100 trillion, trillion, trillion, trillion googol, which is a lot of googols. Now, each wheel has a different number of starting positions. This wheel here on the right has 23 starting positions. This next wheel has 26 starting positions. And the next one after that has 29 starting positions, and so on. If you want to find out the total number of starting positions, you would have to multiply those together, and that's another huge number. The number of starting positions is 16 million, million, million. Now, how did you know how to set up the machine? Well, you would have instructions that told you how to set the pins on the outsides of the wheels. And the wheel position-- well, that would change for every message. so that would have to be sent, one way or another, at the start of the message. So how do you break this code? Well, it was all due to one terrible mistake! You see, one day a operator was sending a message from Athens to Vienna, and it was quite a long message-- it was about 4,000 letters long. But unfortunately, the guy at the other end didn't receive the message. So he sent a message back, saying "What? Pardon? Could you send it again?" Now the first guy was so annoyed that he had to send the message again, he reset his machine, started to type out the message, but this time he just started to abbreviate a few words-- just to make it a little bit shorter. What that meant was that at Bletchley Park, they had two copies of the same message, but with a few differences. And the fatal mistake was they were both sent using the same key. So, if you add these two codes together, the keys would actually cancel out, and what you get--the result-- is the two original messages added together. If you're clever, you can then start to work out what the two original messages were. And that's what John Tiltman did. John Tiltman was a experienced code breaker and over a period of ten days, he was able to piece together the original messages. And not only that, he was then able to work out the key that sent the message. So they gave the key to a young mathematician called Bill Tutte. Now, Bill Tutte was only 24 years old at the time. He had just graduated from Cambridge University. But he liked puzzles, and they gave him this key to see if he could work out any patterns in it. Now, Bill Tutte remembered something that he was told in code breaker training, which was if you have a key that repeats or has a pattern to it, then if you write the code out in rows, and if you can notice any patterns in the code, you can actually work out the length of the key. So that's what Bill Tutte did. He took the first symbol, from each letter of this key, he wrote it out in rows. Now, his first few attempts were not successful. You can imagine people looking over at him, wondering what he was up to. But when he wrote it in rows of 41, he started to notice a pattern, which meant that this first wheel here on the right actually has a period of 41. But the pattern wasn't perfect, which meant that he could also deduce that there is another wheel on the left that only moved sometimes. And this was the breakthrough! Once Bill Tutte had shown that it could be done, the other code breakers got stuck in, and together they were able to completely work out the Lorenz machine. And remember, they did that without ever seeing the machine! Now, once you've worked out the machine, the next problem is how do you work out the settings? Now, the famous mathematician and code breaker Alan Turing he had worked out a method to get those pin settings on the outsides of the wheels. And at that time, they changed about once a month. But what about the wheel positions? They changed for every message. Well, it was Bill Tutte again who thought of a way to work this out. Tutte's procedure was to take two consecutive letters of the code, and two consecutive letters of the Chi key. And then he would add together the first two symbols from each. So if I do that with this example, If I add all these symbols together, the end result would be a dot. What Bill Tutte realized was if the Chi wheels are in the correct position, then you actually get a dot about 55% of the time. And this is a clue. If your first two Chi wheels are in the right place, then you should be getting more dots than crosses. And you can actually apply that same technique to the other wheels, and work out their positions. And not only that, but Tutte's procedure could also be used to work out the pin settings, as well. The problem was you would have to do that procedure for every letter of the code, and for every position of the first two Chi wheels, which is far too much to do by hand. So they automated the process. And in the end, they built a machine called Colossus. And Colossus is arguably the world's first computer. Colossus was designed by a post office engineer called Tommy Flowers, and it was designed to run Bill Tutte's procedure, and then to count up the dots. And Colossus could then work out the positions of the Chi wheels! And then, a little bit later, they could use it to work out the positions of the Psi wheels, as well. And eventually, they built Colossus 2. Colossus 2 could do all that, and it could work out the pin settings of the wheels. Anything that couldn't be done by Colossus still had to be done by hand. So that would be using good, old-fashioned pencil and paper methods, and language skills. But, all together, and using all these methods, you could work out the settings for the machine, and then you could read all those secret messages from people like Adolf Hitler. There were less than 50 of these Lorenz machines dotted around Europe. But they were used to send the most important messages-- and by the end of the war, Bletchley Park could actually decode about 90% of messages sent in this way. And so they had vital information about the German defenses. And they could use that information, and by doing so, they shortened the war. Now, this machine isn't as famous as Enigma, but it is my hope that one day it can be as famous as Enigma, and those code breakers-- people like Bill Tutte and Tommy Flowers-- will one day get an equal amount of recognition. And if you have been, thanks for watching.