Calculator Hill Cipher: Encrypt & Decrypt Online

The Hill cipher is a polygraphic substitution cipher based on linear algebra. Invented by Lester S. Hill in 1929, it encrypts blocks of letters simultaneously using matrix multiplication.

Perfect for learning cryptography, testing matrices, or quickly encoding messages. All processing runs in your browser — no data is sent to any server.

How to use the Hill Cipher Calculator

  1. Select mode – choose either “Encrypt” or “Decrypt” from the dropdown menu.
  2. Enter the key matrix – provide a 2×2 (4 numbers) or 3×3 (9 numbers) matrix. Use comma separation, e.g., “3,10,20,9” for 2×2 or “1,2,3,4,5,6,7,8,10” for 3×3.
  3. Enter the input text – type or paste the text you want to encrypt or decrypt. Only letters A-Z are supported (spaces and other characters will be removed).
  4. Click “Process” to perform the encryption or decryption.
  5. Use the “Clear” button to reset all fields.

Note: The Hill cipher requires the key matrix to be invertible modulo 26. If the matrix is not invertible, you will be prompted to choose a different key. Text is automatically padded with “X” characters if needed.

Leave a Reply