Vigenère Cipher

Polyalphabetic Caesar shift driven by a keyword.

Open tool

Overview

The Vigenère cipher is a polyalphabetic substitution cipher: it uses a keyword to vary the shift applied to each letter of the plaintext. Repeat the keyword over the message, treat each keyword letter as a Caesar-shift amount, and encrypt letter by letter. It was considered unbreakable for three centuries after its description in 1553.

Cryptography students learning their first non-trivial cipher, CTF players, ARG designers, and history buffs exploring 16th-century French cryptography all reach for it. While not secure by modern standards, Vigenère is a great teaching example for polyalphabetic substitution and the concept of a key.

How it works

Pick a keyword (any sequence of letters). Repeat it over the length of your plaintext, aligning each plaintext letter with one keyword letter. For each pair, shift the plaintext letter by the position of the keyword letter in the alphabet — A=0, B=1, C=2, ..., Z=25.

Worked example: encoding "ATTACK" with key "LEMON" — repeat LEMON to LEMONL, then shift A by L(11)=L, T by E(4)=X, T by M(12)=F, A by O(14)=O, C by N(13)=P, K by L(11)=V. Result: "LXFOPV".

Decryption is the same operation with negative shifts (or shift forward by 26 − N for each keyword letter).

Examples

Plaintext:  ATTACK AT DAWN
Key:        LEMON
Ciphertext: LXFOPV MI VMSR
Plaintext:  HELLO WORLD
Key:        KEY
Ciphertext: RIJVS UYVJN
Decode:  LXFOPV MI VMSR
Key:     LEMON
Plain:   ATTACK AT DAWN

FAQ

Is it really unbreakable?

No — it just took 300 years to break. The Kasiski examination (1863) and Friedman's Index of Coincidence (1922) provide practical attacks. Once you know the key length, Vigenère reduces to a stack of separate Caesar ciphers, each of which is trivial.

What makes a good Vigenère key?

Longer is better. The Kasiski attack works because repeated keyword segments cause repeated ciphertext patterns. A key as long as the message and never reused — a one-time pad — is provably unbreakable.

Does case matter?

The cipher operates on letters only, ignoring case during shifts. The tool typically preserves the original case in the output.

Try Vigenère Cipher

An unhandled error has occurred. Reload ×