Hill Cipher
Encrypt letter blocks with square key matrices and modular arithmetic.
Input
Output
Using This Tool: Guide & Notes Show guide
The Hill cipher encrypts letter blocks by multiplying plaintext vectors by a key matrix modulo 26.
How to use it
- Choose the matrix size, then enter or adjust the key matrix values.
- Check that the matrix is valid before relying on decryption.
- Paste plaintext or ciphertext into the input box.
- Use the output and matrix status to confirm how blocks are being processed.
Options and settings
- Matrix size controls how many letters are processed together in each block.
- Key values define the matrix. The determinant must allow an inverse modulo 26.
- Padding fills incomplete final blocks so the matrix operation can run cleanly.
- Grouping formats the output for readability but does not change the mathematics.
Notes
- A non-invertible key matrix may encrypt but cannot decrypt reliably.
- Hill is useful for seeing linear algebra inside classical cryptography.
Related Article
Hill Cipher: The Day Classical Cryptography Became Mathematical
How Lester S. Hill's 1929 matrix cipher moved secret writing beyond alphabet tricks and toward the logic of modern cryptography.