Hill Cipher (2×2)

Encrypt or decrypt using a 2×2 matrix over the alphabet (mod 26).

Client-side only. Data never leaves your device.
Input is normalized to A–Z and padded with X if needed to make even length.

How to use Hill Cipher (2×2)

1

Enter a 2×2 key matrix (a b c d).

2

Make sure the matrix is invertible mod 26.

3

Choose Encrypt or Decrypt and type your text.

4

Copy the output.

Frequently Asked Questions

Why does the key need to be invertible?

Decryption requires the modular inverse of the key matrix. If it doesn’t exist, you cannot decrypt.

What alphabet is used?

A–Z mapped to 0–25, with all other characters removed for the transformation.

Is Hill Cipher secure?

No. It’s educational and can be broken with modern methods.

Why use Kitbase Hill Cipher (2×2)?

Matrix validation

Warns when the key matrix is not invertible mod 26.

Classic linear algebra cipher

Demonstrates how matrices can encrypt digraphs.

Demo included

Load a working key and sample input instantly.

Privacy-first

Runs locally in your browser.

ToolsPDFImageDevText