Keyword Cipher (Vigenère)
Pick a secret keyword and the cipher walks through it letter-by-letter as it shifts your message — repeating from the start of the key when it runs out. Numbers, spaces, and punctuation pass through unchanged.
What is the Keyword (Vigenère) Cipher?
The keyword cipher — also known as the Vigenère cipher — is a classical encryption method that uses a secret keyword to shift each letter of your message by a different amount. Where the simpler Caesar cipher shifts every letter by the same amount, the Vigenère cipher rotates through the letters of your keyword to vary the shift. This makes it dramatically harder to break by hand. Invented in the 16th century, it was famously called le chiffre indéchiffrable ("the indecipherable cipher") and resisted serious attack for nearly 300 years before Friedrich Kasiski published a successful method in 1863.
How the Keyword Walk Works
Suppose your keyword is soup. The cipher walks through your message one letter at a time, and at each letter it uses the next letter of the keyword as the shift amount:
- The 1st letter of your message is shifted by
s(so plaintextabecomess). - The 2nd letter is shifted by
o(so plaintextabecomeso). - The 3rd letter is shifted by
u(so plaintextabecomesu). - The 4th letter is shifted by
p(so plaintextabecomesp). - On the 5th letter the keyword repeats — back to
s— and the walk continues for the rest of the message.
Spaces, numbers, and punctuation are passed through unchanged and do not consume a keyword letter. Capitalization in your message is preserved.
How to Use This Tool
- Pick a mode — Encode to scramble a plaintext, Decode to reverse a previously encoded message using the same keyword.
- Type a keyword — letters only, any length, case is ignored. Longer and less-predictable keywords are stronger.
- Type your message — paste or type into the message box. Letters are shifted per the keyword walk; everything else passes through.
- Click Convert — the result appears instantly and can be copied or downloaded.
Example
With keyword soup, encoding the message:
Attack at dawn!
produces:
Shnpuy ui voqc!
To recover the original message, switch to Decode and use the same keyword soup.
Common Use Cases
- Build escape-room or scavenger-hunt clues that require a secret keyword to solve
- Teach polyalphabetic substitution and the history of cryptography in classrooms
- Create encrypted journals, letters, and props for TTRPG campaigns and LARPs
- Send playful "secret notes" to friends who share the keyword
- Solve Vigenère puzzles in adventure games, ARGs, and puzzle books
Tips for Choosing a Strong Keyword
- Make it long. Short keywords repeat often, leaving patterns frequency analysis can lock onto.
- Avoid dictionary words if you want better resistance — the classical Kasiski attack relies on them.
- Mix unusual letter combinations rather than common phrases, but remember: even a great keyword does not make Vigenère secure for real secrets.
Frequently Asked Questions
Is the Vigenère cipher secure?
No. While much stronger than a Caesar cipher, the Vigenère cipher has been breakable since the 19th century. It is fun and instructive — but never use it to protect real secrets. For genuine encryption, use a modern algorithm like AES via a trusted password manager or encrypted messenger.
What characters are allowed in the keyword?
Letters only (A–Z, case-insensitive). Spaces, numbers, and punctuation are not valid keyword characters and the tool will warn you.
What happens to numbers, spaces, and punctuation in the message?
They pass through unchanged and do not advance the keyword. Only alphabetic characters are shifted, which is the standard Vigenère behavior and keeps the output readable.
Does the keyword need to match the message length?
No — the keyword automatically repeats from the start once it has been used up. A 4-letter keyword can encode a paragraph just fine.
Does this tool send my message to a server?
No. All encryption happens entirely in your browser using local JavaScript. Nothing is uploaded, logged, or stored.