 Hello, is that all right? Thank you. Hi, great to see you all. Yes, apologies. This has never happened to me before, but there's a first time for everything. Just as I was about to come on, I accidentally accepted an update, and so my laptop is currently updating, which is great. But thankfully I had another copy of the slides. Ignore the fact that this says, hey festival, that's where I was last week, but it's effectively the same talk. So hope you can bear with me on that. Unfortunately, the PowerPoint I had, which has videos in, also is not able to run on this machine. So I'm going to just describe what you would be seeing in the videos, and hopefully you can use your imaginations. So yeah, this talk is about something I did when I got really bored in lockdown. I've been locked away in my home during COVID-19, and I wanted to do something not just looking at the computer screen, but something I could build myself, but it had to be something I could put together in my living room because we were kind of trapped and couldn't go to a workshop or anything. So I wanted to build my own enigma machine. So the enigma machine is a type of mechanical computer. You can think about mechanical computers from ancient civilizations. This is the Antikythera mechanism that the ancient Greeks used to predict the movement of the stars. This is a very simple mechanical computer. It adds one. You can think of it as a type of computer in that sense. There are also more sophisticated mechanical calculators and so on. But the kind of mechanical computers that I'm super interested in, because my research is all about privacy and security and surveillance, is the cipher machines that were used to encrypt communications in the world wars and right up until quite late on in the 20th century. Most famous of them is probably the enigma machine. So this was a mechanical cipher machine that was used... It was invented at the end of the First World War and it was used heavily in the Second World War, notably by the German army. So what's important about the enigma machine is that it enabled a different type of cipher than was historically used by military. So if you go back to the Caesar cipher, which was supposedly used by Julius Caesar, this was what's called a substitution cipher. So you take each letter in the alphabet and you substitute it with another letter in the alphabet. Now this kind of cipher has an important weakness which is that you can count the occurrence of different letters. There was a Muslim philosopher, a mathematician called Al Kindi, who noticed in I think the 12th century that if you look at any language, there will be some letters that are more frequent than others. So in English the letter E is very common. So if you take any cipher text and you know that it was originally written, the plain text, the message that was being sent was originally written in English, then you look for the most common substitution letter in the cipher text and that's probably going to be an E. So using that method you can actually decipher what the text is. So that's a weakness of substitution ciphers and one way around that is to use a polyalphabetic cipher. So polyalphabetic means that every time you use a letter, it will come out as a different encryption. Now it's very difficult to do this using pen and paper, using your brain. It's very difficult to keep track of how many times have I used E because the recipient of your message also needs to keep track of how many times they've used E and if you make a mistake in counting you're going to end up messing up that signal. So an Italian architect, Alberti, in the 15th century came up with this polyalphabetic cipher method where you'd have a mechanism that was effectively two disks that could spin around and this basically told you which letter to substitute. So A could be G, but then you'd move the inside disk around one place and the next time you use A it would be something different. So that was the polyalphabetic cipher disk that Alberti invented. The enigma machine runs on a very similar principle but it uses electronic components or electrical components alongside the wheel-rotor turning mechanism. So it's an electromechanical computer. Inside each of the rotors there are a series of contact pins on each side and then wires in the middle that take the input from one of the contact pins which represents one of the letters in the alphabet and scrambles that to another letter in the alphabet so that the current that comes in that might represent a letter A will come out as a different letter at the other side of the rotor and you don't just have one rotor but you have many of these rotors so these rotors are stacked together and so what comes in from the keyboard of the enigma machine as a letter A might come out as a letter G and then at least one of the rotors would move by one position so if you type AA the next time you get A it's going to come out as something different like a C. The Germans also added another layer of security which was the plug port so this basically allows you to add an additional layer of encryption by changing any letter to any other letter so that was the plug port to add an additional layer of security and if you think about it you've got three rotors that can be in any one of 26 positions letters of the alphabet that's 26 times 26 times 26 for the three rotors so I think that comes out at 17,000-ish possible states you also have to take into account that those three rotors could be in different positions there's six different ways you could put those together so that takes it to somewhere around 17,000 states and then the plug board adds even more possible states onto that so as I said it's an electromechanical device I thought I'd start off by looking at the mechanical part at the heart of the machine so that's the rotors I wanted to just first of all just try and understand how the rotor mechanism worked so I wanted to build something that would do that now how the mechanism works is that as I said before every time you type one letter the rotors have to move at least one of the rotors has to move by one position so normally that's the first rotor moves by one position every time but once the first rotor has done a full rotation in order to actually make any advantage of the other rotors those rotors need to turn by one position so once rotor one has gone round once rotor two moves round one position and so on for rotor three so I decided to build my own rotor mechanism stepping mechanism so I used old bits of MDF that I had left over from my kitchen I've made these little rotors that turn with a little ratchet and pull mechanism that's what that looked like now you could kind of use this as a sort of enigma machine by tracing the positions of the rotors relative to each other and sort of reading off the numbers I've got a video here which won't play because unfortunately I don't have the power point working but this is effectively you press down on the paddle at the back which is like imagining what the key pressing mechanism would do and that rotates the rotors by one position each time there's a little sort of pull underneath that stops the rotor from going too far around so that was my first attempt at understanding part of the enigma machine but what I learnt is that I just wasn't able to cut anything precisely enough not only was my cutting skills not up to the scratch but I think using old MDF is probably not the best material to be using for this kind of thing so that was sort of my first experiment I thought I need to get out of the world of pen and pencil which is how I've been measuring things even out of the world of just drawing stuff which is what you get when you have raster graphics but I needed to get into the world of vectors where you can mathematically define the shapes that you want to create so by designing my new parts on the computer I could get to the perfect world of vectors and that would give me hopefully the precision that I needed so I started designing my new design for the rotors on the computer this was the design for the keyboard, the lamp board and the plug board so by designing these things on the computer I could then transition to printing them out or cutting them out using a laser cutter now this video just shows you the laser cutter in operation this video is another one angle of the laser cutter cutting out the lamp board again apologies the videos aren't working what you get out of that, you take out of the laser cutter is a sheet of cut 3mm MDF so these are all the parts that I needed to put together my system this is one of the rotors after I've put it together so you've got these parts just slot together like an air fix set so that was nice I could just work on that in my living room you see these little springs with contact pins on the end that's to make sure that when I push the rotors together there's a nice firm contact so that the current can pass from one rotor to the next so that's the sort of mechanism in the middle the mechanical mechanism what about the keyboard and the plug board so I allowed myself to make use of modern components I was kind of cheating here compared to the original Enigma creators I was able to use these kinds of modern components that are very cheap and still available during the global chip shortage that we were experiencing for recent years so I also made use of breadboards so these are very easy to prototype things on I haven't really done any electronics before so it was very useful to be able to play around with these things so this is an example of what the keyboard and lamp board aspect of the machine looks like as I was building it so how do these things fit together so once you press one of the letters on the keyboard that needs to send the current through to the series of rotors so this is the entry wheel so this is each one of these little wires that looks like jellyfish tendons or whatever you call the jellyfish's feet arms is sending current through into the rotor then rotors in the middle look like this before you put them together so these wires are scrambling the signal coming in from one end and out the other this is how the rotors slot together so I made them so that they would fit together nicely so that when it's locked into one position it's not going to move around this is called the reflector so once the current's gone through all three rotors it then needs to be sent back down into the machine to light up one of the lamps to show you what the ciphertext letter is so this is the reflector which sends the signal back down into the same rotors now as I mentioned before the German model of the enigma machine had this plug board at the front so initially I decided I was going to build my own plug board as well and so the idea was that you'd be able to just reconfigure the plug board as you like using these jumper cables in between the keyboard and the lamp board so that's a video that shows how that works so you're swapping around A and B this is another video of showing you how it operates maybe if you want to at the end I can show you I've got the machine here so I can show you how it works so this is effectively the first prototype you type in your message and it lights up one of the lamps under these letters so that was version one it worked, it was a bit cumbersome it was a bit fragile it didn't move around very well and you can see all these wires are exposed so that was a kind of partial success but I wasn't quite happy because as you can see it's a bit of a mess so I wanted to redesign it make it simpler, make it more robust I realised that I'd violated two of Kirchhoff's principles so Kirchhoff was a Dutch cryptographer who said, amongst other things he said that in order for a cryptographic scheme or cryptographic protocol to be usable it has to be portable so it shouldn't require several people to handle or operate I realised I'd kind of messed that up because it was required more than three hands to carry it around and also it should be easy to use and shouldn't be stressful and I was getting stressed out and realised that I'd violated this principle as well so in fact this was one of the things that caused the... that sort of enabled the German military to be exploited the fact that these things were quite difficult to use human error led to various vulnerabilities that the folks at Bletchley Park could exploit when they were trying to crack the enigma code so as I said before this plug board was also not very usable so in different ways that you could use this plug board the Germans opted for not this design which was more theoretically secure 403 septillion different ways that you could have your enigma machine with this design they also rejected this one which was slightly less secure but a little bit easier to use and they ended up going with this one which was the least theoretically secure but the easiest to use where you have a reciprocal plug so A goes into B, B goes into A so they ended up going for the more usable and less theoretically secure option and I realised you know to wire this plug board together and the wiring underneath was just a complete mess so I gave up on that and I thought I'm going to return to the simplicity of the original commercial enigma machine so this didn't have a plug board at the front so that was my version two so this is the one I've got with me today it's a lot more robust easier to put together and much better from that perspective so this is another video that doesn't work but effectively what happens in this video is I type the plain text hello and you'll see the ciphertext so these letters in the middle light up and tell you what the ciphertext is and in this case the ciphertext is j-m-a-e-k you'll notice that A and E are different even though the input letter L is the same and that's because you've rotated the rotor by one position as you type those letters so this is a talk that I gave last week so these are not the correct slides I go into some of the history of the breaking of the enigma machine this is the Polish cipher bureaus machines that they built to break the enigma machine this is a reconstruction from the University of Cambridge another reconstruction of the bomber machine that was a precursor to the Bletchley Park bomb that's that machine there, the Bletchley Park bomb this then led to the creation of the Colossus machine which broke the Lorenz cipher which was a successor to the enigma and fascinatingly for me these electromechanical cipher machines were still in use despite being invented in 1923 they were still in use right up until the late 1960s in the US and even the 1990s by the USSR despite the fact that at this point modern electronic digital computers were available that could simulate all these millions of combinations of wireings of the enigma machine and break it very easily we were still using these quite late on so that's really testament to how powerful these electromechanical machines could be obviously they were used to hide some quite horrible atrocities this is the halfall telegram which was sent to Eichmann by one of the German generals who was responsible for organising the concentration camps today we see that cryptography is still used to hide government atrocities this is the faces of people detained in Uiga detention camps in China this was obtained by a hacker who managed to break into the Chinese systems but also governments are actively trying to break encryption at the same time so the encryption that we all rely on to communicate with each other safely and securely governments are trying to break that partly to try and catch terrorists and criminals five minutes oh I'm finished, okay good but also to clamp down on dissidents and so on so I'm going to end there and if anyone wants to come and have a look at my machine and maybe try encrypting some messages please come and see me at the end of the talk thank you thank you ribbon