Hill

History

The Hill cipher was invented by Lester S. Hill who described its method in the article Cryptography in an algebraic alphabet published in the Jun-Jul 1929 edition of The American Mathematical Monthly. It is an example of a block cipher where groups of letters are enciphered together using a matrix.

Description

To encipher a message the plaintext is broken into blocks of n letters which are converted to numbers, where A=0, B=1, C=2 ... Y=24, Z=25, and enciphered by multiplying them with an n x n key matrix modulo 26. The result is converted back to text producing the cipher. For example using the key matrix {5 4 24 9} and the plaintext TH, or 19 7 when converted to numbers, gives:

5 4 X 19 (mod 26) = 5 x 19 + 4 x 7 (mod 26) = 123 (mod 26) = 19

24 9 7 24 x 19 + 9 x 7 519 25

When converted to letters this produces the ciphertext TZ.

Example

Encipher the Mark Twain quote "The man who does not read good books has no advantage over the man who cannot read them."

Key: 5 4

Key: 24 9

Plaintext: The man who does not read good books has no advantage over the man who cannot read them.

Ciphertext: TZQWA NITEZ IIMDQ NXCMB IKEZJ UGKOB UGRWM BBKLP YCYOR UFHZW ICXQN IKWNN QNXCM BTZQW

Solving

Solving method: Brute force search.

Select the size of the matrix used from the Matrix Size field in the Cipher Settings ribbon group. The cipher length must be a multiple of the matrix size. The best matches for each row are found then they are all tested against each other to find the best overall match for the cipher.