🔑 Vigenère Cipher
Encrypt and decrypt text using the Vigenère cipher with a custom keyword. A polyalphabetic cipher resistant to simple frequency analysis.
About the Vigenère Cipher
The Vigenère cipher is a polyalphabetic substitution cipher invented during the Renaissance and named after Blaise de Vigenère. Each letter of the plaintext is shifted by an amount determined by the corresponding letter of a repeating keyword, defeating simple frequency analysis. For three centuries it was known as "le chiffre indéchiffrable" — the indecipherable cipher. This tool runs entirely in your browser — nothing is uploaded.
How it works
- Encrypt — For each plaintext letter, shift it forward by the position (A=0...Z=25) of the corresponding key letter: Ci = (Pi + Ki) mod 26.
- Decrypt — Reverse the shift: Pi = (Ci - Ki + 26) mod 26.
- The keyword repeats cyclically to match the length of the plaintext letters.
- Non-letter characters in the input (digits, punctuation, spaces) are passed through and do not advance the key index.
- Letter case is preserved; the keyword is treated case-insensitively.
Use cases
- Teaching polyalphabetic ciphers and the limits of frequency analysis.
- Constructing puzzles that require a keyword to unlock.
- Light obfuscation of text where modern crypto is overkill.
- Historical demonstrations of pre-20th-century cryptography.
Frequently asked questions
Is the Vigenère cipher secure? No. If the key is short or reused, the Kasiski examination and Friedman test can recover both key length and content. Use AES or similar for real security.
What makes a good keyword? Longer keywords with no repeated words are stronger. A one-time pad (a random key as long as the message) is the only unbreakable variant.
Does the keyword have to be uppercase? No. The keyword is treated case-insensitively; only A-Z characters are used.
Does this tool upload my text? No. All encryption and decryption happens locally in your browser.