 Alright, so let's talk about the first real mathematical cipher, which is known as the Hill cipher. Now, this was actually invented by Lester Hill, who was actually a faculty member at the City University of New York. And he invented this in the 1930s, and the Hill cipher works as follows. So what I'm going to do is I'm going to pick some n by n matrix that's invertible mod n. So the determinant has to be something that is relatively prime to n, otherwise I won't be able to find the inverse. And what I'm going to do next is I'm going to break the plain text into length n blocks, and each block is going to form an n by one vector, which we'll call p for plain text. And as necessary, we may have to pad p to make it of the appropriate length. Alright, well, how's my encryption going to work? Well, it's actually going to be pretty easy because I know how to multiply a matrix by a vector. My encrypted text is going to be the matrix product, my Hill vector, times whatever the plain text vector is, all done mod n. And because h is an invertible matrix, I can recover the plain text by multiplying by the inverse of the matrix, and that gets me my plain text back. For example, let's pick a random matrix. How about this one? h equals 3, 2, 1, 5, and I'll encrypt math using a equals 0 and so on, and I'll work mod 36. Now, since there's only 26 letters to the alphabet, you might wonder what we're going to use 27 to 36 for, and 27 to 35 for, I should say. And, well, we'll use those to represent the digits from 0 through 9. Alright, so let's, first of all, determine that h is actually invertible because the hill cipher won't work if we don't have an invertible matrix. So we want to find the determinant, which is going to be 13, which is, conveniently enough, relatively prime to our modulus, so we know there is an inverse. Now, we'll next want to break the plain text into 2 by 1 vectors. So that's going to be ma, which will encode using our a equals 0 code. That's going to become 12, 0, and then th is going to become 19, 7. And I'm going to produce the encryption by evaluating h times p, mod 36. So I'll do the matrix multiplication there. That's going to become 0, 12, and do the matrix multiplication, 71, 54, all reduced, mod 36, gives me that. And if I really want to, I can convert that back into an encrypted text. I don't really need to, I can work with just the numbers, but just for appearances, let's do that. So 0 is a, 12 is m, 35 is 9, the digit, and 18 is s. And so my encrypted form of math, m, a, t, h, is going to be a, m, 9, s. Well, how about decrypting? Well, we do need to find the inverse of h. So we'll use the cofactor method. So again, I know what that original matrix is. I'll find the matrix of cofactors. I'll multiply by the reciprocal of the determinant of the original matrix, which is going to be 25, and then reducing, gives me 17, 22, 11, 3 as our inverse. So to decrypt the message, I'll take the encrypted factors and then multiply them by the reciprocal matrix. So first I get this, reduce mod 36. Next I get this, again reduce mod 36. And finally, converting everything back into place. Well, that's m, a, t, h, which is what we started with.