Hill Cipher client-side
?
How to use Hill Cipher

The Hill cipher encrypts letters in blocks using linear algebra. This version uses a 2×2 matrix built from a four-letter key: each pair of letters from the text, converted to a vector of two numbers, is multiplied by the matrix modulo 26. Decryption applies the inverse matrix, which exists only if the matrix's determinant is invertible modulo 26 — the tool checks this and displays the matrix and its determinant. Entirely local processing.

2×2 matrix cipher modulo 26.

HillMatriceAlgèbre linéaireCryptographie

How to use Hill Cipher

The Hill cipher encrypts letters in blocks using linear algebra. This version uses a 2×2 matrix built from a four-letter key: each pair of letters from the text, converted to a vector of two numbers, is multiplied by the matrix modulo 26. Decryption applies the inverse matrix, which exists only if the matrix's determinant is invertible modulo 26 — the tool checks this and displays the matrix and its determinant. Entirely local processing.

Frequently asked questions

Why are some keys rejected?

A key is valid only if its matrix's determinant is coprime with 26. Otherwise the matrix has no inverse modulo 26 and decryption would be impossible.

What if the text has an odd number of letters?

A filler letter (often X) is added to complete the last block, since Hill encrypts letters two at a time.