CalcDomain

Hill Cipher Hill Cipher Encoder/Decoder Enter a 2×2 key matrix (mod 26), check invertibility, then encrypt or decrypt text. We strip non-letters and pad with X if needed. 1. Key matrix (2×2) Values are integers mod 26 (0–25). A common demo key is [[3, 3], [2, 5]]. Check key invertibility 2. Text Input text (we keep letters A–Z, uppercase, pad with X) ATTACKATDAWN For decryption, paste ciphertext here and click “Decrypt”. 3. Actions Encrypt Decrypt 4. Output Result — Numeric vector (A=0 … Z=25) — How the Hill cipher works (2×2) 1. Choose a 2×2 key matrix K with entries mod 26. 2. Convert text to numbers using A=0, B=1, …, Z=25, and group into 2-element column vectors. 3. For each vector P , compute C = K · P mod 26 . Convert back to letters. K = [a b; c d], det(K) = ad − bc. K is invertible mod 26 if gcd(det(K), 26) = 1. To decrypt, we need the inverse matrix K⁻¹ mod 26 so that P = K⁻¹ · C mod 26 . This page computes that for you. Related cryptography tools RSA Encryption/Decryption Baconian Cipher Encoder/Decoder Checksum Calculator Big Number Calculator Tips If your key is not invertible mod 26, tweak one entry or pick a different key. A determinant with gcd(det, 26)=1 is required.

Calculators in Hill Cipher Hill Cipher Encoder/Decoder Enter a 2×2 key matrix (mod 26), check invertibility, then encrypt or decrypt text. We strip non-letters and pad with X if needed. 1. Key matrix (2×2) Values are integers mod 26 (0–25). A common demo key is [[3, 3], [2, 5]]. Check key invertibility 2. Text Input text (we keep letters A–Z, uppercase, pad with X) ATTACKATDAWN For decryption, paste ciphertext here and click “Decrypt”. 3. Actions Encrypt Decrypt 4. Output Result — Numeric vector (A=0 … Z=25) — How the Hill cipher works (2×2) 1. Choose a 2×2 key matrix K with entries mod 26. 2. Convert text to numbers using A=0, B=1, …, Z=25, and group into 2-element column vectors. 3. For each vector P , compute C = K · P mod 26 . Convert back to letters. K = [a b; c d], det(K) = ad − bc. K is invertible mod 26 if gcd(det(K), 26) = 1. To decrypt, we need the inverse matrix K⁻¹ mod 26 so that P = K⁻¹ · C mod 26 . This page computes that for you. Related cryptography tools RSA Encryption/Decryption Baconian Cipher Encoder/Decoder Checksum Calculator Big Number Calculator Tips If your key is not invertible mod 26, tweak one entry or pick a different key. A determinant with gcd(det, 26)=1 is required..

Hill Cipher Calculator
/hill-cipher