How it works
The Vigenere cipher uses a keyword to choose a different Caesar-style shift for each letter. Write the plaintext on one line and repeat the keyword beneath it until both lines have the same length. A keyword letter A means a shift of zero, B means one, and Z means twenty-five. The first key letter controls the first plaintext letter, the second controls the second, and the pattern repeats.
Encoding adds the alphabet position of each key letter to the matching plaintext position. Decoding subtracts it. Both operations wrap around after Z, so a value beyond twenty-five starts again at A. Unlike a Caesar cipher, repeated plaintext letters can produce different ciphertext letters when they align with different parts of the keyword.
The keyword must contain at least one alphabetic character. This tool removes accents, converts letters to uppercase, and ignores nonletters in the keyword. By default, the message is reduced to A–Z. Turn on Preserve spaces and punctuation to keep the sentence layout; preserved characters do not consume a keyword position.
When you select Decode without entering a keyword, the page estimates a likely key length from the index of coincidence. That estimate is only a clue: it cannot discover the actual keyword by itself, and short ciphertexts rarely contain enough evidence. A real decode still requires the key or additional cryptanalysis.
Worked example
Encode ATTACKATDAWN with the repeating keyword LEMON. Convert A through Z to values 0 through 25, add the key value, and convert the result back to a letter.
| Plain | Key | Plain value | Key value | Cipher |
|---|---|---|---|---|
| A | L | 0 | 11 | L |
| T | E | 19 | 4 | X |
| T | M | 19 | 12 | F |
| A | O | 0 | 14 | O |
| C | N | 2 | 13 | P |
| K | L | 10 | 11 | V |
| A | E | 0 | 4 | E |
| T | M | 19 | 12 | F |
| D | O | 3 | 14 | R |
| A | N | 0 | 13 | N |
| W | L | 22 | 11 | H |
| N | E | 13 | 4 | R |
- Repeat the keyword: Write LEMONLEMONLE beneath ATTACKATDAWN.
- Convert letters to values: Use A as 0 through Z as 25 for both rows.
- Add each pair: Add each plaintext value to its matching key value and wrap modulo 26.
- Read the ciphertext: The resulting letters form LXFOPVEFRNHR.
The repeated key is LEMONLEMONLE, and the completed ciphertext is LXFOPVEFRNHR. Decoding subtracts the same sequence of key values and returns ATTACKATDAWN.
History and origin
Polyalphabetic substitution developed gradually during the European Renaissance. Leon Battista Alberti described a cipher disk in the fifteenth century, Johannes Trithemius published changing alphabets in the early sixteenth century, and Giovan Battista Bellaso described a practical keyword system in 1553. The familiar repeating-key method was later attributed to Blaise de Vigenère even though his own work included a stronger autokey idea.
For centuries, changing alphabets made this family appear much harder to attack than a single substitution. It was sometimes called an indecipherable cipher. Military officers, diplomats, writers, and puzzle makers used related tabula recta systems until statistical attacks and mechanical methods made their weaknesses clear.
How to break it
The Vigenere cipher is not secure by modern standards. A repeating keyword creates a periodic structure. Analysts first estimate the period with repeated-sequence distances or the index of coincidence, then separate the ciphertext into columns. Every column was shifted by one keyword letter and can be attacked like an ordinary Caesar cipher.
Friedrich Kasiski published a systematic repeated-sequence attack in the nineteenth century. Charles Babbage had independently found a related solution earlier. Once the likely key length is known, frequency analysis on each column suggests the individual shifts. Longer messages and short repeated keys make this process much easier.
A long random key used exactly once produces a different system, the one-time pad, but that requires strict key generation and handling rules that this educational page does not implement. Use Vigenere for historical study, games, and puzzles only. Do not use it to protect accounts, files, or private communication.
Related ciphers
Frequently asked questions
How do I decode a Vigenere cipher?
Repeat the keyword to the ciphertext length, convert each key letter to a shift from 0 to 25, and subtract those shifts from the ciphertext letters.
What keyword should I use for a Vigenere cipher?
Any alphabetic word can define the shifts, but historical security improves only when the key is long, unpredictable, and not reused. This tool accepts one or more letters.
Why does the same letter encrypt differently in Vigenere?
Its output depends on both the plaintext letter and the keyword position. The same plaintext letter aligned with different key letters receives different shifts.
Can I decode Vigenere without the keyword?
Sometimes, if the message is long enough. Estimate the key length, split the text into periodic columns, and apply frequency analysis to each column.
Is the Vigenere cipher secure today?
No. Repeated keys create detectable periods, and computers can test periods and column shifts quickly. It is educational, not modern encryption.
What is the index of coincidence hint?
It measures how often two selected letters match. Averaging the value across candidate columns can suggest a repeating-key length, but it does not reveal the key itself.
Privacy note
All processing happens in your browser. Your text never leaves your device and is never transmitted to ToolPlex.