HELP
HIAT
Classic Hill cipher example with an invertible 2x2 key matrix. Text is encrypted in pairs of letters.
Encrypt and decrypt text with the Hill cipher using an invertible numeric key matrix. Learn how classical matrix-based polygraphic substitution works modulo the alphabet size.
HELP
HIAT
Classic Hill cipher example with an invertible 2x2 key matrix. Text is encrypted in pairs of letters.
HIAT
HELP
The same key matrix is inverted modulo 26 to restore the plaintext.
MATRIX
KYETPB
A 2x2 key matrix processes the message as letter pairs: MA, TR, and IX.
ACT
POH
Classic 3x3 Hill cipher example. The plaintext block ACT is multiplied by the key matrix modulo 26.
The Hill cipher is a classical polygraphic substitution cipher based on linear algebra. Instead of encrypting one letter at a time, it groups letters into fixed-size blocks and treats each block as a vector of numbers.
The key is a square numeric matrix. During encryption, each plaintext vector is multiplied by the key matrix, and the result is reduced modulo the alphabet size. For the English alphabet, this usually means modulo 26.
For example, a 2x2 key matrix encrypts text in pairs of letters, while a 3x3 matrix encrypts text in groups of three. Decryption uses the inverse of the key matrix modulo the same alphabet size.
The key matrix can be entered directly in the matrix editor. The matrix size determines how many letters are processed together during encryption.
The tool automatically validates whether the matrix is invertible modulo the selected alphabet size and shows the determinant status before encryption.
The Hill cipher depends on reversible matrix multiplication. To decrypt a message, the tool must calculate the inverse of the key matrix modulo the alphabet size.
A matrix is usable only when its determinant is coprime with the alphabet size. For modulo 26, this means the determinant must not share a common factor with 26. If this condition fails, different plaintext blocks may produce the same ciphertext block, making reliable decryption impossible.
The Hill cipher was an important step in classical cryptography because it introduced matrix operations and encrypted multiple letters at once. This made it more resistant to simple frequency analysis than many monoalphabetic substitution ciphers.
However, the Hill cipher is not secure by modern standards. If enough plaintext and ciphertext pairs are known, the key matrix can often be recovered. Today it is mainly used for education, mathematics, puzzles, and demonstrations of linear algebra in cryptography.
Classic letter-shift cipher with custom shift values.
Classic digraph substitution cipher with keyword matrix encryption.
Classical reciprocal cipher based on a keyword.
Vigenere-style classical cipher that uses a numeric key.
Keyword-based polyalphabetic encryption and decryption.
XOR-based Vernam encryption with Base64 output.