Ciphers · VigenèreVigenère cipher — encode, decode and crack KEY

The Vigenère cipher shifts every letter by its own amount, following the letters of a keyword: “attack at dawn” with the key “lemon” becomes “lxfopv ef rnhr”. Encode and decode with English or Russian letters, follow the step table for a lesson, and if there is no key we find it from the text.

Everything runs in your browser — the text goes nowhere

01Encode02Step by step03Key length04Square05How it works06Questions07Related
01

Encode

Variant
the keyword repeats over the letters of the text
Alphabet
Plain text
Result
English (26)
lxfopv ef rnhr
The link will contain the text (up to 500 characters), the key and the alphabet — share it deliberately.

A one-letter key is the Caesar cipher · Open Caesar →

02

Step by step

for a lesson: text letter, key letter, shift, result
03

Key length

index of coincidence and repeated trigrams (Kasiski)

Turn on “I don’t know the key — find it” on the Decode tab — likely key lengths will appear here.

The search relies on letter frequencies and a dictionary — reliable from 100 letters, it may be wrong on short texts.

04

Vigenère square

row — key letter, column — text letter, intersection — cipher
Hover a row of the step table or a cell — we highlight its row and column. · A4 landscape, black and white: the full square of the chosen alphabet.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
AABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZA
CCDEFGHIJKLMNOPQRSTUVWXYZAB
DDEFGHIJKLMNOPQRSTUVWXYZABC
EEFGHIJKLMNOPQRSTUVWXYZABCD
FFGHIJKLMNOPQRSTUVWXYZABCDE
GGHIJKLMNOPQRSTUVWXYZABCDEF
HHIJKLMNOPQRSTUVWXYZABCDEFG
IIJKLMNOPQRSTUVWXYZABCDEFGH
JJKLMNOPQRSTUVWXYZABCDEFGHI
KKLMNOPQRSTUVWXYZABCDEFGHIJ
LLMNOPQRSTUVWXYZABCDEFGHIJK
MMNOPQRSTUVWXYZABCDEFGHIJKL
NNOPQRSTUVWXYZABCDEFGHIJKLM
OOPQRSTUVWXYZABCDEFGHIJKLMN
PPQRSTUVWXYZABCDEFGHIJKLMNO
QQRSTUVWXYZABCDEFGHIJKLMNOP
RRSTUVWXYZABCDEFGHIJKLMNOPQ
SSTUVWXYZABCDEFGHIJKLMNOPQR
TTUVWXYZABCDEFGHIJKLMNOPQRS
UUVWXYZABCDEFGHIJKLMNOPQRST
VVWXYZABCDEFGHIJKLMNOPQRSTU
WWXYZABCDEFGHIJKLMNOPQRSTUV
XXYZABCDEFGHIJKLMNOPQRSTUVW
YYZABCDEFGHIJKLMNOPQRSTUVWX
ZZABCDEFGHIJKLMNOPQRSTUVWXY
05

How it works

Shift by the key

a + l → l · t + e → x

Each key letter is its own shift: “a” is 0, “l” is 11. The key repeats over the letters of the text; spaces and punctuation do not move it.

Gronsfeld and autokey

2015 · key + text

In Gronsfeld the key is digits, shifts from 0 to 9. In autokey, after the keyword the shifts come from the letters of the plaintext itself.

How it is cracked

length → columns → frequencies

Find the key length by the index of coincidence and repeated trigrams, cut the text into columns and pick each shift by letter frequencies.

06

Frequently asked questions

Each letter of the text is shifted along the alphabet by the position of the next key letter: “a” shifts by 0, “b” by 1, “l” by 11. The key repeats until the text runs out. So “attack at dawn” with the key “lemon” becomes “lxfopv ef rnhr”: “a” shifted by 11 is “l”, “t” shifted by 4 is “x”. Decoding applies the same shifts backwards.

Updated