What is a Vigenère cipher?
The Vigenère cipher encrypts text with a keyword. Each key letter picks its own Caesar shift (A = 0, B = 1 … Z = 25) and the key repeats along the message, so the same letter encrypts differently each time. With the key LEMON, ATTACKATDAWN → LXFOPVEFRNHR.
Spaces, digits and punctuation stay unchanged and do not advance the key.
How to decode a Vigenère cipher
- Know the key? Choose Decrypt, type the keyword, and paste the message.
- No key? Choose Decrypt and paste it anyway. The Key Cracker finds the key length from the index of coincidence, then solves each column with English letter frequencies.
- Wrong result? Cracking is statistical. Give it more text; 100+ letters of English works reliably.
Use it in your code
Everything on this page is available as a free, MIT-licensed, zero-dependency npm package with TypeScript types.
npm install @gykh/vigenere-cipher
import { encryptString, crack } from "@gykh/vigenere-cipher";
encryptString("ATTACKATDAWN", "LEMON"); // "LXFOPVEFRNHR"
crack(secret).key; // "LEMON"
Frequently asked questions
How is Vigenère different from a Caesar cipher?
A Caesar cipher uses one shift for the whole message, so there are only 25 keys to try. Vigenère uses a different shift for each key letter, which hides single-letter frequencies. A one-letter Vigenère key is exactly a Caesar cipher. Try the Caesar cipher decoder too.
Is the Vigenère cipher secure?
No. It was called le chiffre indéchiffrable for three centuries, but as the cracker above shows, frequency analysis recovers the key in milliseconds. Use it for puzzles, CTFs, escape rooms and teaching, never for real secrets.
Is my text sent to a server?
No. All encryption, decryption and cracking runs locally in your browser. Challenge links carry only the encrypted text, inside the link itself.
How do I share a secret message?
Encrypt your text, press Share as a challenge, and send the link. Your friend sees only the scrambled text and has to crack the key. To get a short, tidy link and see how many people opened it, shorten it with MiniFyn.