Enter ATTACKATDAWN in the Vigenère tool with key LEMON. We will repeat the key over all twelve letters, add the matching letter positions, and decode the result. The example uses A = 0 and a repeating key, rather than autokey.

1. Repeat the key over letters

RowValue
PlaintextATTACKATDAWN
Key repeatedLEMONLEMONLE
OutputLXFOPVEFRNHR

The message has twelve letters and the key has five. After N meets the fifth message letter, start again with L at the sixth. Keep repeating until the last two message letters are paired with L and E.

2. Add the matching indices

PositionPlain letter / PKey letter / KP + Kmod 26 / output
1A / 0L / 111111 / L
2T / 19E / 42323 / X
3T / 19M / 12315 / F
4A / 0O / 141414 / O
5C / 2N / 131515 / P
6K / 10L / 112121 / V
7A / 0E / 444 / E
8T / 19M / 12315 / F
9D / 3O / 141717 / R
10A / 0N / 131313 / N
11W / 22L / 11337 / H
12N / 13E / 41717 / R

ATTACKATDAWN with key LEMON

InputATTACKATDAWN
SettingsKey LEMON; repeat over A–Z letters; A = 0
Expected resultLXFOPVEFRNHR
Try this method

3. Reverse with the same alignment

To decode the first L, subtract its key letter L: 11 − 11 = 0, or A. For the third letter F, subtract M: 5 − 12 = −7, which wraps to 19, or T. Continue with the same repeated key to recover ATTACKATDAWN.

4. Keep the key moving across spaces

Add spaces to make ATTACK AT DAWN and the output becomes LXFOPV EF RNHR. The spaces stay visible without taking a key letter. LEMON continues across each word boundary; it does not restart at the next word.

Your turn

The first A in ATTACK uses key L and becomes L. The second A, at position 4, uses key O. Predict its output.

Continue the lesson

Vigenère cipher toolPrint Vigenère practice with keysHow text conversion and preparation work