Hill Cipher Encoder/Decoder
Enter text and a 2×2 key matrix to encode or decode with the Hill cipher.
Result
How to use
- Enter your values in the fields above.
- Press Calculate to see your result instantly.
- Use the Share button to copy a link to your result.
About this calculator
Invented by Lester Hill in 1929, the Hill cipher is a classical polygraphic substitution cipher that encrypts letters in blocks rather than one at a time using linear algebra: each pair of letters is mapped to a 2×1 number vector (A=0…Z=25), multiplied by a 2×2 key matrix, and reduced modulo 26 to produce the ciphertext pair. Decryption reverses the process using the key matrix's modular inverse, which only exists if the matrix's determinant is coprime with 26.
This tool encrypts or decrypts text with a Hill cipher given a 2×2 key matrix, handling the modular arithmetic and matrix inversion automatically. Cryptography students and computer science instructors use it to see how matrix multiplication produces diffusion across letter pairs, and to check by-hand homework against a working reference implementation.
Was this helpful?
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)