RSASHAAESKEYMOD0101LOCKDH
Classical Cryptography

Hill Cipher

The Hill Cipher is a matrix-based polygraphic substitution cipher. It encrypts blocks of letters using matrix multiplication modulo 26.

Algorithm Steps

  1. 1Choose a valid 2x2 key matrix.
  2. 2Convert plaintext letters to numbers.
  3. 3Divide text into pairs.
  4. 4Multiply each pair by the key matrix.
  5. 5Apply modulo 26.
  6. 6Convert numbers back to letters.

Formula

Encryption: C = K × P mod 26
Decryption: P = K⁻¹ × C mod 26

Example

Plaintext: HELP
Key Matrix: [[3, 3], [2, 5]]
Encrypted text: HIAT
Decrypted text: HELP