So the Caesar Cipher very simple, and then we could have more elaborate substitution, but that could be attacked by a frequency analysis, so we need to get more sophisticated. So what are the properties of a valid encryption scheme? So number one, it's going to be relatively easy to encrypt. It should be easy to transmit the message. It should be easy to decode if you've got the key to decode. If it's intercepted, it should be really difficult to break. And number five, we haven't talked about much, but it will be important for blockchain technology, the source of the message should be validated. So let's move to the next type of Cipher, which is a substitution Cipher also, but it's not monoalphabetic, it's polyalphabetic. So this is the idea of a Vigenere square. So what I've done is I've created a square, which notice the way that it's set up. The first row is A through Z, and the second row starts with B and it goes all the way through the alphabet and then ends with an A. So notice what I've set up here. It is a grid that's 26 by 26, and let me tell you the mechanics on how it works. So the message that we want to transmit is the following, Cam Harvey guilty. I'm not sure of what, but that's the message. The key string that we're going to use is three letters, BTC. So I've created one row with the with the message. So the plain text message, Cam Harvey guilty. The next row I'll repeat the key stream, which is BTC, BTC, BTC, BTC, BTC. So now I'm going to encrypt, with this key stream, the actual plain text. So let's go through to see how this is actually done. So again, I've repeated the first line, which is the message, or part of the message, and then the second line I've got the key string. So the first letter I need to encrypt is C, and the key stream, the first letter, is B. So, what do I do? I go to the row that's associated with B, and then I go across to the column that's associated with C, and I read off the letter D, and that's my encrypted version of C. So the second letter is A, so C-A-M, so the second letter of the key stream is T. So again, I will go to the row that begins with T, the column is the first column, which is A, and I read off T. That's the second one, so the A becomes a T. The third is the M. So again, I will go to the row that begins with the third letter in the key string which is a C, and look under M, and I get the letter O, so I've successfully encrypted the first three letters of the plain text, and you can see how this works, and this is a technology that was invented centuries ago. You don't need a computer to do this. You simply need the grid, the 26 by 26 grid, to actually decode this message. Fortunately we've got a computer, so let's see how this actually works. So I do this in Excel, very simple. Again, the first line is the plaintext, the second line is the key stream that's repeated many times, and now what I'm going to do is to rewrite those lines in terms of numbers, so A is 0, B is ,1 and Z is 25. Notice there are 26 letters, but we're counting the 0 as the A. So I do that from my message. I do that for the key stream also, so Cam is 2, 0, 12. The keystream BTC is 1, 19, 2, and notice that 1, 19, 2 is repeated multiple times, and then all I do is add. So the C plus the B is 2+1 = 3. The A plus the t is 0+19=19, and that represents the T. So very simple to do this in Excel, but I've highlighted the modular aspect of this. Look at the entry 19. So we're adding two Ts together 19+19=38. But again, we're going around the modulus. So the modulus here is 26, so think of 38 divided by 26, what's the remainder? The remainder is 12. So it turns out it's very easy to go the other way too. So again, I've written the ciphertext now in the first line. The second line is the key stream, and what do you do is subtract. So the ciphertext D, subtract the key stream, which is a 1, 3-1=2, that is the C. So this is a very elegant way to actually do an encryption. It lasted for for hundreds of years. One of the issues, of course, is that the key stream is very short, and effectively there's a repeat that goes on. In this particular example, you can see that the B is repeated every four cell. So that is going to be a vulnerability of this particular technology, but there's a solution to that, and the solution has to do with having a very long key string. In the so-called one-time pad, is where you've got a key string that's the length of the message, and that makes it incredibly difficult to actually decrypt. So, for example, in our simple situation where we've got 26 letters in the alphabet, in let's say a 10-letter message, that would require 26^10 tries to Brute Force. That's 141 trillion tries, and maybe from this little calculation, you can figure out why people want your password to have upper and lowercase, because that 26 becomes a 52^10, and then you add special characters it's even greater, and the longer the password the more that you need to try. So this is going to be very useful in terms of what we do. The father of modern cryptography is Claude Shannon, and his insights led to the current encryption standards, which use substitution, just like we were doing. They also use transposition, so it's a little more complicated than what we did, but one issue here, as I pointed out right at the beginning, is we need to somehow communicate that the key. So that is a weakness of this type of encryption. So why is this relevant for a blockchain? We've already seen an example with JP Morgan's quorum where blockchain is encrypted. So essentially the entries of transactions include encrypted data. There's also some different cryptocurrencies that use encryption, like Z cash. So again, what we need to deal with fundamentally for the next step is how are we going to communicate the decryption key?