YTread Logo
YTread Logo

Cracking Enigma in 2021 - Computerphile

Jun 13, 2024
To go a lot deeper into this, today we're going to look at five because again, I don't want to be here all day, it gets harder to solve and we'll talk about that, so it's a lot of combinations, it's too many combinations. for me to go ahead with even this little industrial match, although when I get it exactly right, I'll just pull out the plain text and it will have a very nice disease match and maybe I can find it, so what do I do? If we do it right, the weakness of the puzzle is that if we do some of these things right, even if the others are wrong, we usually get a little closer to the answer, so for example, if you get the three rotors right in the positions correct and you get your starting positions are more or less correct   if your ring settings are wrong, all it will do is alter the notches so that you get correct plaintext fragments and then ciphertext fragments and then plaintext fragments and   you will get these kind of bags of valid characters coming out of the decryption, you will still get a better score on ioc or any other metric, so that's what we're going to do and this is the same thing with the sockets if we get the rotors and the positions initials. and the ring configuration is correct then we can start guessing the sockets and generally speaking if we guess one correctly the result will be better and then we can move towards a solution.
cracking enigma in 2021   computerphile
There are many variations possible, but the fact is that we can handle some of them at the same time. A moment makes this practical. If we were to brute force through all the different variations, it wouldn't be possible. That's the idea, so I wrote some code to do this. If you want to try it, I will create my code. available but there's also a really good online tool called crypto that allows you to do this in a visual way uh we'll put a link to that in the description but I've written some pretty simple code here.
cracking enigma in 2021   computerphile

More Interesting Facts About,

cracking enigma in 2021 computerphile...

I implemented a puzzle machine because it was fun, and then I implemented a series of different fitness functions, which is how good is our decryption on the question index? Also, maybe we can talk about others another time, so you were kind enough to send me some ciphertext. I don't know what it is and it has been encrypted using some

enigma

configuration with I think five sockets. The first thing I do is go through all the different rotor configurations and find the one that has the highest match rate when I figure it out. that message, then it's five different rotors, each tested in each position and in each starting position, so it's 26 for each, so that's quite a few combinations, about 17,000, but 17,000 for a computer laptop in

2021

is no big deal, right?
cracking enigma in 2021   computerphile
Somewhere around 10 seconds or something, so you can see what it's doing now: it's going through the different rotors, so one, two, three, one, two, four, one, two five, and that's it. we've done about 10 or 15 setups for each of these. It's going through all the different starting positions, but we're not looking at the ring setup or the plug board because that's just going to multiply this astronomically by the number of things we have to do, so we're already on rotation 3. in the left side we continue, this same thing works exactly the same for eight rotors, it doesn't really change anything, it just takes a little more time and I'm a little lazy, so I've coded the other motors as Well, um, interestingly, some of the rotors Later ones have two notches on the right, which doesn't mean there's no difference in terms of

cracking

because, um, that just means you spin the next one twice as well, yeah, twice, often, yeah, um only. it really affects the first two rotors, the last one never spins as often and has no other motor to spin so here what we have is a list of the highest performing rotor configurations so 2 5 3 is the configuration of best performing rotor with starting positions of 21 3 and 25.
cracking enigma in 2021   computerphile
I am using zero indexing correctly, which is not how you would normally do it in Enigma, but it was easier for my array indexing to do this correctly and that has a matching index of 0.043, which is much higher than 3 8. I say it's much higher, it's a little bit higher, good enough, so that suggests to me that I actually listed the top 10 here because sometimes you may not you get the right one. at the top you could get the next rotor configuration or something like this, maybe it's worth it if you were really trying to pay attention to this what you would do maybe is start doing more attacks on the three main rotor configurations alone to keep your options. open so we're going to fix it to two five and three because you know it saves time so given the rotors two five three from left to right and their initial positions, what we can now do is start brute forcing through the settings From the ring. so we can find the best possible ring configuration at the moment, this is almost instantaneous because there are only about 600 of the ones on the right now.
We don't need to test the left rotor because it doesn't really spin, so we do it. and it already happened and the best positions of the rings were 0 3 23 right now we ignore the zero because it is not the ring you have, remember that it affects where the notch is and the left rotor does not rotate at all, so it has no effect . since this is the ciphertext we got, this was our original ciphertext and this is our slightly better ciphertext now it still looks like total nonsense, but it has a much higher match score rate than the original, which means that in a sense it's less random, so if you look you might start to see groups of letters that could be a real word, maybe not, I don't know for sure, but some of the real letters will appear here, it's possible that We cannot see what they are. are, so given this, we can finally start to address this really problematic socket board situation.
Remember that there are too many socket ball combinations to realistically test them all, but again we have this wonderful benefit that if we get one of the sockets right, the result will probably be better than if none of them were right, so What we do is go through each of the first 300 or so different possible plugs, one at a time, and see which one is the best, then we fix it and do the next thing. next to the next and it's two sockets and then we go to next to the next and it's three sockets, and so on and so on and if we do that, we quickly get some sets of sockets and our ciphertext starts to look a lot better, right, so this It's our ciphertext here, the first letter doesn't make sense, but then you have to consider the mission they consider the mission, can machines think?
Ah, I see, now I'm starting to guess what this could be, oh, I see what you're saying. I have done here, this is Alan Turing's paper, so some of the letters are wrong, so I propose to consider it and it is j brapos to consider it correct and we are almost there, but that is because when we optimize the engine configuration we fix the sounds at zero zero zero so I was never going to find exactly the right thing so essentially the rotation is a little bit wrong it's all a little bit off but it's still pretty good now if we go back to our original question about how sure is the riddle, the answer is not very sure right, and the reason is not because it is trivial to break it, this took me a bit of effort, and for short messages where these fitness functions start to fail because you don't have enough information, they are actually very solid, right? for a 50 character message it's very, very difficult to decipher using something like a matching index because even if some of the letters start to appear right, there aren't many, the index is just noise in the war, they limited or tried to limit. messages to something like 200 250 characters for this reason because the match rate was already known correctly and now there are more powerful metrics like trigram and quadrant scores which I have also implemented and which often work better, especially for the socket board, so if you have a short message you don't get much information about the different frequencies of the different groups of letters, so there's really no way to know what's going on and you're either very lucky or not, and most likely No.
Well, the other problem is of course the number of sockets. I've only done five plugs here, so I cheated a little as most of the German messages were sent using 10 plugs. You will need between 1200 and 1500 characters before the fitness features are activated. I'm going to start giving you something well if you know what the text playing could be, this becomes a lot easier, because if you can fix these characters they have to be exactly like this, your fitness function is a lot less noisy, right? I have actually implemented it. that too and just start breaking it no no like it's nobody's business right then it can be decrypted right if you know if you can guess what plaintext is and of course modern cryptography assumes you know what is the correct plain text for at least some of the message, for example whenever you send an http message to a web server the leading bit always says http get or something similar but there is a well known structure for these things , you can start to guess what they would be, we can't assume you would.
I don't know what the plain text was, but even if we don't know, you can see that these match indices and trigram scores and whatnot can start to extract some information, so going back to the initial puzzle is actually harder to decrypt that I thought people always talk about how hard it was to decrypt during the war and that's absolutely fine, but you just assume that now that it's

2021

, laptops should be able to just click Go to find all the settings, the ciphertext doesn't really work that way, you have to try to find your way to it and often it doesn't work and there is noise in the output, so you have to try to determine if what you are seeing is actually an improvement or not, etc Which I think is pretty interesting.
Modern ciphers do not have this problem. If you have a 128-bit key, you can't brute force the first bit because different bits like zero or one won't give you better or worse reproduction of the text. it's just going to be nonsense every time and that's true in any amount, so you can't do like the first half of the key and then the second half of the key, which is pretty much what we're doing here so that the ciphers moderns don't do it. we have this problem and so on, we can't do many interesting things with this image after just one set of convolutions, but we're getting to that point, so this one is starting to transform, some of them are noisier than others, the paint associated with it. showing what the proper configuration was with one on top and one against the paint spot AUTOCAPS MANUALLY PUBLISHED

If you have any copyright issue, please Contact