Vigenere Cipher Converter
Encrypt or decrypt text with a repeating keyword using modulo 26 shifts.
What it does
The Vigenere cipher is a polyalphabetic substitution that uses a keyword to choose a different Caesar shift for each letter. It was considered unbreakable for centuries because it hides the frequency pattern of a single alphabet substitution.
This tool takes a message and a keyword, then encrypts or decrypts by adding or subtracting the key letter value modulo 26. Non letter characters are kept in place and do not advance the keyword.
The page opens with the classic example ATTACKATDAWN and the keyword LEMON. The ciphertext is LXFOPVEFRNHR, and using decrypt mode with the same key recovers the original text.
The strength of the cipher depends on the keyword. A short key repeats often and leaves patterns that can be exploited once the key length is guessed. A key as long as the message and never reused gives much stronger protection.
This converter assumes the Latin alphabet only. It is useful for learning classical cryptography but is not suitable for protecting real information.
How to use
- Type the message to encrypt or decrypt.
- Enter a keyword made of letters.
- Choose encrypt or decrypt.
- Read the converted message as the main result.
- Check the keyword length to understand how often shifts repeat.
- Decrypt the output with the same keyword to verify the round trip.
Formula
- M(i)
- Plaintext letter at position i, with A mapped to 0.
- K(i)
- Keyword letter at that position, repeated as needed.
- C(i)
- Ciphertext letter at position i.
The keyword letter value is its alphabet index from 0 to 25. Non letter characters are copied without consuming a keyword position, which is a practical convention for modern text. Traditional treatments often strip punctuation entirely.
Worked example
Example: ATTACKATDAWN with key LEMON
The page opens with message ATTACKATDAWN and keyword LEMON in encrypt mode.
- Repeat the keyword to get LEMONLEMONLE.
- The first plaintext letter A has key letter L, whose value is 11, giving L.
- The second letter T has key E, value 4, giving X.
- Continuing with the repeated key produces the stream LXFOPVEFRNHR.
- Switch to decrypt mode with the same key to recover ATTACKATDAWN.
- The tool reports result LXFOPVEFRNHR and keyword length 5.
Reference table
| Message | Keyword | Operation | Result |
|---|---|---|---|
| ATTACKATDAWN | LEMON | Encrypt | LXFOPVEFRNHR |
| LXFOPVEFRNHR | LEMON | Decrypt | ATTACKATDAWN |
Limits
- Messages are limited to 200 characters and keywords to 50 letters.
- Only Latin letters are transformed.
- The cipher provides no modern security.
- Uppercase and lowercase are preserved independently.
Common mistakes
- Using a different keyword to decrypt than to encrypt.
- Assuming the cipher cannot be broken.
- Forgetting that a short keyword repeats.
- Including digits or spaces in the keyword.
- Expecting non letter characters to be removed rather than preserved.
Try it yourself
Quick checks. Answers sit tucked under each question.
Decrypt LXFOPVEFRNHR with keyword LEMON.
ATTACKATDAWN.
How long is the repeated key in the default example?
Five letters, LEMON.
Why is Vigenere stronger than Caesar?
It uses several alphabets, which masks single letter frequency patterns.
Questions
What is a Vigenere cipher?
A substitution cipher that applies a different Caesar shift for each letter based on a keyword.
How do I decrypt?
Subtract the repeated keyword letter value from each ciphertext letter.
Is it the same as ROT13?
No. ROT13 uses one fixed shift, while Vigenere changes shift with the key.
What makes the key strong?
Length and unpredictability. A long key that is never reused is much stronger.
Can punctuation be included?
It passes through unchanged in this tool and does not advance the key.
Is this secure today?
No. It is a classical teaching cipher.
Sources
- Michigan Technological University, Vigenere cipher tutorial
- Trinity College, Vigenere cipher and tableau
- Arizona State University, Vigenere cipher explanation