 Mathematics didn't play an important role in cryptography until the 20th century. Then in 1929, Lester Hill of Hunter College invented the first encryption method to use mathematics in a substantive fashion. Not only did Hill write a paper about it, he and a colleague also applied for and received a patent for an encryption machine. The Hill cipher uses matrix algebra to encrypt blocks of data, and it operates as follows. Choose an N by N invertible matrix H, break the message into blocks P1, P2, P3, and so on of length N, padding as necessary, then encrypt each block using matrix multiplication. Hill's patent was based around a 6 by 6 invertible matrix, but we'll use a 2 by 2 to illustrate the point. Let's use the matrix 3, 7, 2, 5 to encrypt 3, 1, 9, 8, 1, 4. Since we have a 2 by 2 matrix, we'll break our message into blocks of length 2, so that's 3, 1, 9, 8, 1, 4. These become column vectors, so we can then multiply them by the matrix, and so they become the column vectors 3, 1, 9, 8, 1, 4. And if we multiply them by our Hill matrix, we get... Now in practice we need to operate mod N, and this raises a new problem. In order to decrypt a message, we have to be able to invert the matrix. Now in Bung the Real Numbers, a matrix is invertible if and only if its determinant is not equal to 0. But if we're working mod N, we have to be a little bit more careful, and so we have the key theorem. Let H be an N by N matrix. H is invertible mod N if and only if the determinant of H and N are relatively prime. In other words, that greatest common divisor is equal to 1. So for example, suppose we're working mod 100, let's find if it exists the inverse of the matrix 1, 5, 2, 3. So first we should check to see what the determinant is. So we'll find the determinant of our matrix, which will be... And since the greatest common divisor of minus 7 and 100 is 1, the matrix is invertible. Now since this is a 2 by 2 matrix, the adjoint method is relatively fast and easy and painless, but we will need the multiplicative inverse of the determinant of minus 7. Which works out to be 57. And now we can apply the adjoint method. So the inverse of a matrix is the multiplicative inverse of its determinant times the transpose of the matrix of cofactors. And so that will be... And since we're working mod 100, we need to reduce these numbers. And so our inverse is the matrix 71, 15, 86, 57. And so now let's try to decrypt a ciphertext. So we received the ciphertext. And we know it was encrypted using the matrix 1, 5, 2, 3, working mod 100. Let's recover the plaintext. So we already found the inverse of the encryption matrix. That's this matrix. And we know that our ciphertext was produced by left multiplying by the encryption matrix. So we know that the first block, 1611, was 15, 2, 3 times the first block of the plaintext. If we left multiply by the inverse, we get the first block of the plaintext, 0103. And similarly, the second block of the plaintext was left multiplied to get the second blocks of the ciphertext, 8358. So we can left multiply by the inverse to get 6344. And the third block was left multiplied to get the third block of the ciphertext so we can recover it by using the inverse. And that gives us the third block of the plaintext. And so our original plaintext was 01, 03, 63, 44, 3120.