Hill Cipher

Explore matrix-based classical encryption.

Nothing is sent or saved
INPUT
Only A–Z is used. Everything else is ignored.0 / 5,000
Key matrix

Whole numbers, reduced mod 26.
Negative values work, too.

Padded with x when needed

How it works

Six small steps
  1. 01

    Keep the letters

    A–Z → a–z

  2. 02

    Assign numbers

    a = 0 … z = 25

  3. 03

    Group & pad

    Fill with x

  4. 04

    Multiply

    K × p

  5. 05

    Take modulo

    mod 26

  6. 06

    Back to letters

    Your ciphertext

Each block is a column vector: c = Kp mod 26. Encryption works even with a matrix that cannot be reversed; recovering the original text requires an invertible key.