📐

Hill Cipher

Matrix-based polygraphic cipher

substitution
Definition

The Hill cipher is a polygraphic substitution cipher based on linear algebra. It encrypts blocks of letters by treating them as vectors and multiplying by a key matrix. For a 2×2 matrix, it encrypts pairs of letters at a time.

History

Invented by mathematician Lester S. Hill in 1929. It was the first polygraphic cipher that was practical for more than three symbols at once. Used for military communications and influenced the development of modern block ciphers.

Real-World Usage

While not used for secure encryption today, the Hill cipher demonstrates important cryptographic concepts. Its mathematical foundation influenced modern ciphers like AES. Used in educational settings to teach linear algebra applications in cryptography.

Weaknesses

Vulnerable to known-plaintext attacks - with enough plaintext-ciphertext pairs, the key matrix can be solved. The key matrix must be invertible (determinant must be coprime with 26). Linear nature means it doesn't diffuse patterns well.

Hill Cipher Matrix Multiplication

Watch how each pair of letters is transformed by matrix multiplication

Key Matrix (det = 20)

624
116
HE
LP
Interactive Playground