Vigenère Cipher

Polyalphabetic substitution with Kasiski key-length analysis and frequency-based key recovery.

Plaintext / Ciphertext
Examples
Click to load (input + key)
Classic: ATTACKATDAWN / LEMON → encrypt
Reverse: LXFOPVEFRNHR / LEMON → decrypt
Pangram with spaces / SECRET
Output
How Vigenère works

The Vigenère cipher is a polyalphabetic substitution cipher. Each letter of the plaintext is shifted by the corresponding letter of the repeating key (A=0, B=1, … Z=25). Non-alphabetic characters are passed through unchanged.

Encrypt: C = (P + K) mod 26  |  Decrypt: P = (C − K + 26) mod 26

Unlike Caesar, different key letters produce different shifts, making frequency analysis harder. However, the Kasiski test and Index of Coincidence can reveal the key length, after which each column reduces to a Caesar cipher.

Ciphertext for Analysis
Examples
Click to load a sample ciphertext
Repeating block (key length 5 should win)
Longer Kasiski demo (~250 chars)