 So an improved version of the single substitution cypher emerged from the politics of the 16th century and is known as the visionaire cypher. And the basic idea is that a statistical attack can be used for a single substitution cypher, and one way we can defeat it is to use a polyalphabetic cypher where one letter is encrypted using many different letters. And the problem here is we need some sort of regular way of shifting which cypher we're using. The problem with this type of approach is we have to remember which table we're using, and there has to be a convenient way of writing this down or of remembering this because, again, any time you require something to be written down, you run the risk that somebody's just going to steal the codebook. So in 1553, Javan Bellasso suggested the following approach to this problem. And what he did is he said, all right, well, suppose I take an openly known set of substitution tables, and these are either openly known or the generation rule is simple enough that anybody can figure them out. And Bellasso himself gave as an example the following starting set of tables. So what he did is he, these tables are indexed by two letters, A, B, C, D, E, F. And there's more tables. I just haven't copied them down. And the tables have a particular setup. So you'll notice here that in this first table I have the letters A through M. And actually in all these tables I have the letters A through M in the top row. And in the bottom row I have the remaining letters in the alphabet, except what I'll do from table to table is I'll shift this bottom row only over one place. And because the generation rule is simple enough, all I have to do is remember the generation rule and then I can reproduce this entire set of tables without any difficulty. So how do we use this method of encryption? Well, what we'll do is we'll pick a keyword, which doesn't have to be a word. It can just be any easily rememberable set of letters. But we'll take the actual word beaded. And in this particular case I chose the word beaded because the letters of this keyword correspond to the letters in the index here. Now again, if I had the full set of 13 tables I could pick any word or set of letters that I wanted to for illustrative purposes, we'll pick something that's short and something where we have all the tables available. So if I want to encrypt a message what I'm going to do is I'm going to take that keyword and copy it first of all repeatedly over the plain text. So we'll use our basic plain text message, attack and done. We'll copy our keyword over and over again above the message. And if the message is longer than the keyword or the keyword is longer than the message then I'll just drop a few of the letters off at the end. And I'll repeat the keyword as many times as necessary. Now what I'm going to do is I'm going to use the letters of the keyword to be an index that refers to which of these tables I'm going to use to encrypt the corresponding plain text letter. So for example, this first letter, the index is going to be B. So I'll look at the B table. Now the plain text letter is A. So that A is going to correspond to N in the ciphertext. So what we're doing here with these indices and what we're doing here with these tables is that any letter is going to be encrypted as the letter that's below it or if it's on the bottom row, the letter that's above it. So I'll do that encryption. Table B letter A goes to F. Our next letter, that's going to be the table E, that's this EF table. The plain text letter is T. T is going to be encrypted as E. The next letter, index A, plain text letter T, is going to be encrypted as G and so on. So again next letter, index D, letter A. Table D, A gets encrypted as O. And I can encrypt the remaining letters of the ciphertext. I can produce the remaining letters of the ciphertext in this fashion. And this works very nicely. It allows us to produce a polyalphabetic cipher where I have a very easy way of remembering what the substitution tables are going to be. Now in 1586, the letters de visioner, a French cryptographer, introduced several changes. One would say that they're improvements on Balasso's cipher. And so instead of using the substitution tables, what he did is he used the letters of the keyword themselves to determine the shift of the cipher that we'll be using. And the easiest way to think about this is that the letter of the keyword is the ciphertext version of the plain text A. So that first letter of the keyword tells us what our letter is going to be sent to. The other thing that visioner suggested is that rather than repeating the keyword, which causes a particular periodicity to the encryption alphabet, he suggested, well, you can use the text itself to help encrypt the message. And this is the first appearance of what has come to be known as an auto key cipher. Well, let's see how that works. So again, we'll choose a keyword. And again, we'll choose our keyword, beaded. And we'll put down our plain text in the keyword. So here's our plain text. Again, attack at dawn. Our index is going to be beaded, except we need an encryption for the last few letters. And so visioner's suggestion is to use the message itself to determine what those next few letters are going to be. So the message begins attack. And so my index will continue using those letters. And again, the first letter of the plain text is A, the first index is B. And again, what this suggests is that I want to use a shift cipher where my plain text letter A is going to be sent to B. That's a shift one cipher. So A gets encrypted as B. My next letter is E. And that suggests that the shift cipher I'm using sends A to E. That's a shift four. So this letter T will be sent to uvwx. The next letter is going to be A. And here's an interesting case that says that I'm sending A to A itself. And that's a shift zero. My next index letter is D. So again, A is being sent to D. That's a shift three. So that A gets sent to D. And I can encrypt the rest of the plain text in this fashion. Now there's some interesting features about the visionary cipher. One is that as described, it's actually a little bit harder to break using the method that we'll describe in the next video. But the other thing that is a little bit of a problem with the visionary cipher is that when I'm encrypting it, I know what the message is. So I have no problem recreating this index with perfect fidelity. When I'm decrypting it, well I know the first portion of the key. And so that means I can take this first portion of the cipher text and get the first part of the message. The problem is if I make a mistake, any place in this decryption, if I make any sort of mistake here, because I'm then using this to form the next part of the key, then the next portion is going to have errors in it. And these errors tend to propagate along the message. And one of the primary difficulties with using the visionary cipher is that if you make a mistake decrypting the plain text at any point, from that point forward, you're going to be getting a lot of gibberish. And as a result, what most books will describe as a visionary cipher will actually be a combination of the ciphers of belasso and visionare. So as belasso did, we're going to take our keyword and repeat it over and over again to form the index. The keyword itself identifies a particular shift that we'll be using. So again, if I use my keyword, beat it. I'm going to take my plain text, attack it done. I'm going to take my keyword. I'm going to repeat it over and over again as many times as necessary. And as in the visionary cipher, this index is going to identify the shift that I'll be using. And again, the easy way to remember it is that the letter of the keyword corresponds to what A is going to be encrypted as. So this says A will be encrypted as B, a shift 1. A will be encrypted as E, a shift 4, and so on. And I can encrypt the cipher in that fashion.