 Hey y'all, this is Mr. Gibson with your next lesson in cryptography and today we're going to be talking about the auto key cipher Which is basically just a strengthened version of the vision air cipher So we've previously talked about blaze division air who is miscredited with Creating the vision air cipher, but who actually created the auto key cipher that we're going to be talking about today So let's take a look The auto key cipher starts out pretty similarly to the vision air cipher. We need a keyword. We're gonna call it a primer We're gonna see that this keyword by itself will not be the running key stream, but It'll be part of it and it's gonna start the start the key stream Our plain text we're gonna use the accept the grader challenge the NC SSM school motto And we're gonna go ahead and encrypt that so here's how we do that We start by taking our primer and the way that we create our running key is by Taking the primer and putting the plain text on the end Let's think about that if you're creating the message you have access to both of those pieces of information You have the primer which is an agreed upon secret between you and the receiver and then you are the one that has the plain Text so you can also append that to the end of your primer to create the running key and Then we will take the running key and put that over the top of our plain text And now we can use our tabular recta to encrypt character by character to create the cipher text So this should be familiar by now We won't go through all the details, but you can verify that that cipher text message is correct using the tabular recta So that's not too bad, but we're gonna see this actually offers a lot of security We'll see that at the end of this lesson that this does a really good job of disguising individual character frequencies That we've seen are the weaknesses of our mono-alphabetic ciphers and we've not yet seen that other Poly-alphabetic ciphers are still discernible when we use Single character frequency analysis, but with the auto key It's actually a lot harder to crack this thing. We're gonna get a lot of trial and error a lot of manual work It's a lot harder to automate. So this is really why the auto key became kind of the standard encryption and vision error to a lesser extent Up until really the late 1800s and into the first world war So let's look at how deciphering is going to be a little bit different So if you think about when you're deciphering a message, you don't have the plain text That's the whole point. So you can't create the entire running key at the beginning But you can get started you've got your primer you've got your cipher text So we've got a new message here. We're working with and we'll take that to at least get the running key started So we've taken the primer and that's all we have on the running key But as we start to decipher a character at a time, we can move each plain text character that we create Onto the end of the running key as we learn more so we can see the first plain text character We knew is a we append that to the running key and then the next plain text character we get is T We append that to the running key then we get another T and then we get an A and then we get a C And now we have enough of the running key that we can decipher the entire cipher text So we can stop appending things and finish out the decryption and we can see that our message was the phrase attack at dawn So it's a little bit more complicated This is the first one and really the only one of our tabular recta base ciphers that we are not able to create the entire running key at the beginning of the Deciphering process we have to continually update the running key as we decrypt more and more characters and that's the auto key Encryption process. Let's take a look at how it has an impact on security So going back to our tried and true example text I've taken pride and prejudice with the primer of unicorn and use the auto key cipher to create it As a cipher text and this is what the distribution of characters look like. I've kind of zoomed in on it We can see that every single letter has a frequency of between two and a half and five percent Which is very different from what we've seen with Caesar or even our vision air cipher This is a lot more in uniform of a distribution And that's really the goal of these polyathletic ciphers is to get this distribution as flat as possible If every single character was equally represented it'd be around 3.8 percent and we can see we're kind of zeroing in on that as we've learned about Trithemious to vision air and now auto key these distributions just came to keep getting flatter and flatter every single character It seems to be approaching that 3.8 percent And that's the goal because if we can make every cipher text that are equally represented It becomes impossible for us to figure out what the plain text message was that created it So it's going to we're going to see it's really really difficult to do that with perfect security But this auto key cipher is going to get us as close as we can with these classical methods To really good security method until we introduce modern cryptography with computers So that's the auto key cipher. Thanks for watching. We'll catch you in the next one