Vigenere Cipher Calculator
The Vigenere cipher strengthens the simple Caesar shift by using a repeating keyword, so each position in the message gets a different shift. For three centuries it resisted attack, until Kasiski showed how a repeating key leaks the key length. It remains a superb teaching example of polyalphabetic encryption. Enter your text and a keyword, choose encode or decode, and the calculator ciphers only the letters, preserving case and leaving digits, spaces and punctuation untouched. It also reports the key length and letters enciphered.
Vigenere cipher formula
key letters k0, k1, ... repeat over the letters of the text
for plaintext index p and aligned key shift k:
encode: c = (p + k) mod 26
decode: c = (p - k + 26) mod 26
non-letters pass through and do not advance the key
Each letter shift is the alphabetical value of the aligned keyword letter (A=0). The keyword cycles only over enciphered letters. Encoding and decoding use the same keyword in opposite directions.
Vigenere cipher context
- It is polyalphabetic: the same plaintext letter can map to different ciphertext letters.
- The repeating key is the weakness; Kasiski (1863) used it to find the key length.
- Once key length is known, each position reduces to a Caesar cipher solvable by frequency analysis.
- A random key as long as the message (one-time pad) is the only unbreakable variant.
- For real security use a modern standard such as AES, not Vigenere.
Vigenere cipher: frequently asked questions
What is the Vigenere cipher?
The Vigenere cipher is a polyalphabetic substitution cipher that uses a repeating keyword. Each letter of the keyword gives a Caesar-style shift for the corresponding plaintext letter, cycling through the keyword. It was long considered unbreakable and was historically called le chiffre indechiffrable.
How does the keyword work?
The keyword repeats over the message. Each plaintext letter is shifted by the alphabetical position (A=0, B=1) of the aligned keyword letter. So with key KEY, the first letter shifts by 10, the second by 4, the third by 24, then it repeats. Only letters consume keyword positions.
How do I decode a Vigenere cipher?
Decoding subtracts the keyword shift instead of adding it, using the same keyword. Select decode mode and enter the same key used to encode. Without the keyword, the cipher must be broken by techniques like the Kasiski examination or index of coincidence.
Is the Vigenere cipher secure?
No. Although stronger than a single Caesar shift, it falls to frequency analysis once the key length is found (Kasiski, 1863). A short repeating key is the weakness. Only a truly random key as long as the message (a one-time pad) is unbreakable. Use modern ciphers like AES for real security.
What happens to spaces, digits and punctuation?
They pass through unchanged and do not advance the keyword. Only the 26 letters A to Z are enciphered, and letter case is preserved. The keyword itself must contain at least one letter; non-letters in the key are ignored.
Official sources
- NIST: Computer Security Resource Center, cryptographic standards.
- NIST glossary: polyalphabetic and substitution cipher definitions.
Reviewed by the CalculatorHub team, edited by James Graham, 17 June 2026. See our methodology.