Vigenère Cipher
Encrypt and decrypt text using the Vigenère keyword cipher with advanced options like autokey, case control, and non‑letter preservation.
Updated
What is the Vigenère Cipher?
The Vigenère Cipher is a classic method of encrypting alphabetic text by using a keyword to apply a series of Caesar shifts. Unlike the simple Caesar cipher that shifts every letter by the same amount, the Vigenère cipher uses a keyword to determine a different shift for each letter, making it much more resistant to frequency analysis.
Our online Vigenère Cipher tool brings this historical cipher into the modern age with a clean, responsive interface and powerful options. Whether you need to quickly encrypt a message, decrypt a ciphertext, or explore the inner workings of polyalphabetic ciphers, this tool provides everything you need—all running 100% client‑side, so your data never leaves your browser.
Key Features
- Encrypt / Decrypt – Switch instantly between cipher modes.
- Custom Keyword – Use any alphabetic string as your key.
- Repeating Key & Autokey – Choose the classic repeating‑key method or the more advanced autokey variant that extends the key with the plaintext.
- Preserve Non‑Letters – Keep spaces, punctuation, and numbers unchanged in the output.
- Case Control – Preserve original case, force all uppercase, or force all lowercase.
- Live Results – See the output update instantly as you type.
- Copy & Swap – Copy results to your clipboard or swap the output back into the input for quick iterative work.
Whether you're a student learning cryptography, a writer encoding secret messages, or just curious about historical ciphers, this tool offers a robust and educational experience. No sign‑up, no server calls – just pure client‑side computation.
How it works
The Vigenère cipher is built on a simple arithmetic formula that combines each plaintext letter with a corresponding letter from the keyword.
The Formula
For encryption, each letter (P) (plaintext) is shifted forward by the shift value of the key letter (K):
[ C = (P + K) \bmod 26 ]
For decryption, the process is reversed:
[ P = (C - K) \bmod 26 ]
Here, (A = 0, B = 1, \dots, Z = 25). The key letter determines the shift: for example, the key letter 'C' has a shift of 2.
Repeating Key vs. Autokey
- Repeating key: The keyword is repeated over and over to match the length of the plaintext. This is the classical Vigenère cipher.
- Autokey: The keyword is used only for the first (n) letters (where (n) is the length of the keyword). After that, the plaintext itself is used as the key. This makes the cipher more resistant to frequency analysis and avoids the repetitive weakness of the repeating key.
Non‑Letter Preservation
The cipher only acts on alphabetic characters (A–Z and a–z). When Preserve Non‑Letters is enabled, all other characters (spaces, digits, punctuation) are left untouched in the output. If disabled, non‑alphabetic characters are simply omitted from the output.
Case Handling
- Preserve case: The case of each input letter is retained in the output (e.g., 'Hello' becomes 'Rijvs' with the same case pattern).
- Force uppercase: All output letters are uppercase.
- Force lowercase: All output letters are lowercase.
The Vigenère Table (Tabula Recta)
The cipher can also be visualised using the Tabula Recta – a grid where the top row is the alphabet, and each subsequent row is shifted one letter to the left. To encrypt, find the plaintext letter in the top row, move down to the row indicated by the key letter, and read the resulting ciphertext letter.
All calculations are performed in‑memory using simple modular arithmetic, ensuring instant feedback and zero latency.
Examples
Encrypt 'HELLO' with key 'KEY'
Encrypt the plaintext 'HELLO' using the keyword 'KEY' to produce the ciphertext 'RIJVS'.
Decrypt 'RIJVS' with key 'KEY'
Decrypt the ciphertext 'RIJVS' back to the original plaintext using the same keyword.
Frequently asked questions
What is the Vigenère cipher?
What is the Vigenère cipher?
The Vigenère cipher is a polyalphabetic substitution cipher that uses a keyword to apply multiple Caesar shifts to the letters of a plaintext. It was invented by the French cryptographer Blaise de Vigenère in the 16th century and remained unbroken for centuries.
How do I choose between repeating key and autokey?
How do I choose between repeating key and autokey?
The repeating key method is simpler and more common; it repeats your keyword over and over to match the text length. Autokey uses the plaintext itself to extend the key after the initial keyword, which makes the cipher stronger against attacks because the key stream doesn't repeat. Choose autokey if you need higher security, but be aware that decryption requires the same keyword and knowledge of the autokey method.
Is the Vigenère cipher secure today?
Is the Vigenère cipher secure today?
While it was historically considered “le chiffre indéchiffrable” (the unbreakable cipher), modern cryptanalysis has cracked it using frequency analysis and the Kasiski examination. Today, it is not considered secure for serious applications, but it remains a fascinating educational tool and a fun way to encode messages for puzzles and games.
What does “preserve non‑letters” do?
What does “preserve non‑letters” do?
When enabled, the cipher leaves spaces, punctuation, digits, and other non‑alphabetic characters exactly as they are in the input. When disabled, those characters are simply removed from the output, giving you a continuous string of letters only.
Can I decrypt a message if I don't have the key?
Can I decrypt a message if I don't have the key?
No, the Vigenère cipher requires the exact keyword to decrypt. Without it, you would have to perform a cryptanalysis attack (like Kasiski examination) to try to recover the key, which is a complex and time‑consuming process.
How does the case handling work?
How does the case handling work?
The tool gives you three options:
- Preserve case: The output keeps the original letter casing (e.g., 'Hello' → 'Rijvs').
- Force uppercase: All output letters become uppercase (e.g., 'Hello' → 'RIJVS').
- Force lowercase: All output letters become lowercase (e.g., 'Hello' → 'rijvs').
Does the tool store my text or key anywhere?
Does the tool store my text or key anywhere?
No. The entire calculation runs in your browser using JavaScript. No data is sent to any server, and nothing is stored in cookies or localStorage. Your input stays private and is never logged or recorded.
Related tools
More utilities you might find handy.
Atbash Cipher
Encode and decode text using the Atbash cipher.
Caesar Cipher
Encrypt text with a custom Caesar shift cipher or decrypt unknown messages instantly.
One-Time Pad Generator
Generate cryptographically random one-time pads and encrypt or decrypt messages with modular or XOR cipher modes entirely in your browser.