Classical Cryptography Workbench
CipherLab
Encrypt, decrypt, and inspect every step behind Caesar, Vigenere, Affine, Hill, and Playfair ciphers.
Session history
Recent operations
No encryption or decryption history yet.
C
Monoalphabetic shift
Caesar Cipher
Formula: E(x) = (x + k) mod 26, D(y) = (y - k) mod 26
Encrypted Output
Run Caesar to see the shift formula and character-by-character steps.
V
Polyalphabetic keyword
Vigenere Cipher
Formula: E(x) = (x + k_i) mod 26, D(y) = (y - k_i) mod 26
Encrypted Output
Run Vigenere to see keyword shifts aligned with each letter.
A
Linear substitution
Affine Cipher
Formula: E(x) = (ax + b) mod 26, D(y) = a^-1(y - b) mod 26
Valid a values: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25
Encrypted Output
Run Affine to see modular arithmetic for each transformed letter.
H
Matrix polygraphic cipher
Hill Cipher
Formula: C = K x P mod 26 for a 2x2 key matrix
det(K) = ad - bc must be coprime with 26.
Text is padded to a multiple of 3. The determinant must be coprime with 26.
Encrypted Output
Run Hill to see the key matrix, vectors, and multiplication modulo 26.
P
Digraph substitution
Playfair Cipher
Rules: same row shifts horizontally, same column shifts vertically, rectangle swaps columns.
Live 5x5 Key Square
Encrypted Output
Run Playfair to see the 5x5 table, letter pairs, and rule used per pair.