 In this lesson, we're going to learn about a nice way to use the tabular recta, combined with a keyword, to create a really strong cipher known as the visioner cipher. Now, the visioner cipher is somebody's name, but you'll notice it was not invented by somebody named visioner. This idea was actually created by Giovanni Battista Bellasso, which is an Italian person, and visioner is French. But we'll see this idea came around in about 1553 in this booklet. You can find this copy in the original Italian online if you wanted to give it a look. And as the system was described, in which the tabular recta was used with the repeating counter sign or keyword, that would switch the cipher alphabet mapping after every single letter in the message. So it had a couple of benefits over the ones that we've seen so far with the tabular recta, in that we can change the key very frequently, which will be helpful. We'll see for crypt analysis purposes. And it's also just really easy to remember a long keyword and that you can agree upon with somebody ahead of time. So easy to implement, easy to remember the key, and a very secure. Now, why is it called the visioner cipher if it was invented by Bellasso? And that's because Blaise Divisioner had a kind of an improved version of it that we'll learn later on in this course called the auto key cipher, which is just a kind of a variation on this one. And that's the one that got to be better known. And as a result, the original was misattributed to visioner as well, when it was really Bellasso's. This was really kind of the encryption of its day back in the 1500s. And because it was so secure and easy to implement, it was called le chiff in des chiffres, which pardon my poor French, but basically just means the unbreakable cipher. And it wasn't until almost the late 1800s or 1863 when Friedrich Kassiski was the first to publish a successful general attack on the visioner cipher, even though Charles Babbage, which might be a name that you're familiar with for computing history, had been known to have broken the cipher on occasion earlier than that date. Kassiski was the first one who really published the method that you could use on any message that you had found. So let's take a look at the visioner cipher. We're gonna start with a key word of unicorn for NCSSM unicorns here. And our plain text is a quote from Blaise Divisioner. I saw Michelangelo at work. He had passed his 60th year and although he was not very strong, yet in a quarter of an hour, he caused more splinters to fall from a very hard block of marble than three young masons in three or four times as long. So we're gonna focus on just that first sentence. I saw Michelangelo at work. And let's see how we'll use that with the visioner cipher. So we start by writing out our plain text with the keyword over the top. Clearly the keyword is not long enough to go over the top of the entire message. So we'll just repeat that keyword as many times as necessary to fill it up. And just like we saw with the tabular recta, the reason why we need those letters over each other is that we can now use that table to identify the plain text letter or the keyword letter and find the intersection to get our cipher text. Or if you prefer, you could do essentially a Caesar cipher by taking your plain text numerical value and adding on the keyword numerical value and then modding by 26 to get to your cipher text letter. And if you do that repeatedly, you'll get your cipher text. And that is it. That is the visioner cipher. Everything about this is the same as our tabular recta method. It's really more about the keyword process that is unique. So we'll see it's that aspect of the keyword and that changing the key every single letter is what gives this cipher such strong security. So let's take a look at why it actually does that right now. All right, so we have a similar setup here. We've got our plain text message and we have a key. The key is only three letters long and repeats over and over. And to help us understand how this message is going to appear in the cipher text, specifically the frequency of those characters, we're going to focus on just looking at certain groupings of characters at a time. So for example, let's look at all of the plain text letters that get encrypted when you is the letter above them. So if we were to encrypt all of those, we'd get this group CMLB, CLF and so on. And if you focus on just those letters of the cipher text and create a bar chart to take a visual inspection of the frequencies, we'll see that this frequency is a chart looks very similar to the English language. In fact, it looks like the English language shifted over such that A is over U and E is over Y, which makes sense if we think about just those letters, even though they are not English, CMLB. And even if you were to just take the plain text corresponding, it would not create English words with a large enough sample of our plain text or cipher text, it will follow this kind of normal English distribution. And if we're looking at the cipher text, it will be shifted as a result. And again, that should also make sense because if we think about, well, how did we encrypt all of those plain text letters? We're basically just doing a Caesar cipher on each of those letters. So it shouldn't be surprising that the bar chart of those encrypted letters looks just like the bar chart that we saw when we're working with a Caesar cipher. We get the same thing if we just focus on the characters that were encrypted using the key letter N. Those letters show up. And if we look at just those letters, look at that. Their distribution looks just like an English distribution, just shifted such that A is over N and E is over R. And probably not surprising that the last group here does the exact same thing for the letter I. However, if we take all of these letters and group them together, so we're not looking at just little subsets of the cipher text, but the whole thing, its bar chart for the frequency is very different. You'll see that we don't have any of those spikes that we saw in the previous bar charts. They're all pretty uniform. Couple letters are still lower and couple letters a little bit higher, but really everything is below 8% and most letters are above 2%. We've kind of flattened out the bar chart here, which kind of makes sense. If you think about those three previous bar charts, they had their dips and valleys and the spikes in different letters. So when we put all of those groupings together, they're gonna kind of average each other out a little bit. Let's take a look at just one more to really drive this home. So here we've extended out the keyword to you knees with an S on the end, same plain text. So we'll go ahead and do the first group of characters, the ones that were encrypted with U. It has this bar chart again, Caesar A is now over U. And then we have our second grouping of characters, Caesar A is over N. Third grouping looks like Caesar with an A over the I. And our last grouping, Caesar with the A over the S. So each of those kind of subgroups of characters, each have a recognizable histogram, or bar chart rather, but when we group them all together, combine all the letters of the cipher text, things are even more evened out. Look at this, all of them are below 6% and almost all of them just save one or two letters, maybe are above 2%. We've truly flattened this out. And it turns out as we lengthen the key to more and more letters, the more and more uniform the distribution of our cipher text is going to become. So this is where all that security is gonna come in play, is that our frequency analysis that we've been using to crack messages really seems to be at a loss here. We can't pick up frequent characters in the cipher text because they're all about as frequent, which for keeping your message secure, that's great. But as for us trying to break messages, that's gonna make things a little bit more challenging. And there's a reason why this one stuck around for a couple hundred years as the cipher of the day is that it requires a little bit more sophistication mathematically to help us figure out how to crack that message. So that's it for the vision air cipher. We're gonna learn a little bit of some twists we can put on the vision air to strengthen it even more than what we've seen. And then we'll actually see an example where we could make this cipher 100% uncrackable using something what's called a one-time pad. We'll see there's some drawbacks to that method, but it is mathematically secure.