Hill cipher online
Hill cipher online. Enter text, choose settings and encrypt or decrypt immediately. Learn how it works, its history, an example and its limitations.
How does the Hill cipher work?
What is this method?
Transforms pairs of letters with an invertible matrix and arithmetic modulo 26.
How does it work step by step?
Convert letters to numbers, group them in pairs and multiply each vector by the key matrix modulo 26. Decryption needs the inverse matrix, so not every set of four numbers is a valid key.
Example and practical use
The default 2 × 2 matrix transforms the message in letter pairs. Decryption works only when the matrix is invertible modulo 26.
How to use the tool
Choose encryption or decryption, enter a message and set the parameters required by the Hill cipher. The result is calculated locally in your browser and can be copied or shared without sending the text to a server.
History of the cipher
Lester S. Hill published the cipher in 1929. It was among the first polygraphic ciphers designed explicitly around linear algebra.
Security and limitations
This tool is educational. Classical ciphers can usually be broken with frequency analysis, repetition patterns or a small search through possible keys, so they should not protect confidential information.