Skip to main content

Hill Cipher

Matrix-based polygraphic substitution cipher.

The Hill cipher is a polygraphic substitution cipher based on linear algebra. Invented by Lester Hill in 1929, it encrypts blocks of letters using matrix multiplication with the standard A-Z alphabet. Wikipedia has an excellent example of how the algorithm works. This implementation uses a 2 by 2 matrix key (4 numbers).