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
| Row | Value |
|---|---|
| Plaintext | ATTACKATDAWN |
| Key repeated | LEMONLEMONLE |
| Output | LXFOPVEFRNHR |
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
| Position | Plain letter / P | Key letter / K | P + K | mod 26 / output |
|---|---|---|---|---|
| 1 | A / 0 | L / 11 | 11 | 11 / L |
| 2 | T / 19 | E / 4 | 23 | 23 / X |
| 3 | T / 19 | M / 12 | 31 | 5 / F |
| 4 | A / 0 | O / 14 | 14 | 14 / O |
| 5 | C / 2 | N / 13 | 15 | 15 / P |
| 6 | K / 10 | L / 11 | 21 | 21 / V |
| 7 | A / 0 | E / 4 | 4 | 4 / E |
| 8 | T / 19 | M / 12 | 31 | 5 / F |
| 9 | D / 3 | O / 14 | 17 | 17 / R |
| 10 | A / 0 | N / 13 | 13 | 13 / N |
| 11 | W / 22 | L / 11 | 33 | 7 / H |
| 12 | N / 13 | E / 4 | 17 | 17 / R |
ATTACKATDAWN with key LEMON
ATTACKATDAWNKey LEMON; repeat over A–Z letters; A = 0LXFOPVEFRNHR3. 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.