Hill Cipher (2×2)
Encrypt or decrypt using a 2×2 matrix over the alphabet (mod 26).
Cryptography
You might also like
Caesar Cipher
Encrypt or decrypt text using a classic shift cipher with adjustable rotation.
Vigenère Cipher
Encrypt or decrypt text using a keyword-based polyalphabetic substitution cipher.
Playfair Cipher
Encrypt or decrypt text using a 5×5 digraph cipher square built from a keyword.
How to use Hill Cipher (2×2)
Enter a 2×2 key matrix (a b c d).
Make sure the matrix is invertible mod 26.
Choose Encrypt or Decrypt and type your text.
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.