Generators

Vigenère Cipher

Encode and decode text using the Vigenère polyalphabetic substitution cipher with any keyword.

Loading interactive tool…

Embed this tool on your site

About this tool

The Vigenère Cipher tool encodes and decodes text using the Vigenère polyalphabetic substitution cipher, in which the shift for each character is determined by the corresponding letter of a repeating keyword. For example, with keyword 'KEY': A is shifted by K (10), the next letter by E (4), the next by Y (24), and so on cyclically. Unlike the single-shift Caesar cipher, the Vigenère cipher uses multiple shifts, making frequency analysis harder. Only letters in the key count, so 'my key!' becomes MYKEY. Under the output the tool shows the cleaned key, its length and the index of coincidence of the result with a short interpretation (English-like, Mixed or Uniform). By default case, spaces and punctuation are kept and the key advances only on letters; untick Preserve non-letter characters to strip everything except letters and get uppercase output.

Why use it

  • Handles encoding and decoding with any alphabetic keyword of any length.

  • An index of coincidence readout hints whether the output looks like English or like well-mixed ciphertext.

  • Preserves case and passes through non-alpha characters unchanged, or strips them with one checkbox.

  • Educational tool for teaching polyalphabetic substitution cryptography.

How to use

  1. Enter the plaintext or ciphertext in the Input text field.
  2. Enter the key in the Key field — letters only and case-insensitive; other characters are ignored.
  3. Select Encode or Decode from the Mode dropdown.
  4. Untick Preserve non-letter characters if you want spaces and punctuation removed and the output in uppercase.
  5. The output updates instantly; use Copy output, or Swap to move the output back into the input.

When it helps

  • Learning how polyalphabetic ciphers work and why they are stronger than Caesar.
  • Encoding messages as puzzles or cipher challenges for escape rooms, ARGs, or CTFs.
  • Cryptography coursework requiring Vigenère cipher examples.
  • Demonstrating historical cipher evolution from simple to polyalphabetic.
  • Learning how polyalphabetic ciphers work and why they were stronger than the simple Caesar cipher.

Examples

Encoding with keyword KEY

Input

Plaintext: HELLO WORLD Keyword: KEY Mode: Encode

Expected result

Ciphertext: RIJVS UYVJN (H+K=R, E+E=I, L+Y=J, L+K=V, O+E=S; space preserved; W+Y=U, O+K=Y, R+E=V, L+Y=J, D+K=N)

Decoding with the same keyword

Input

Ciphertext: RIJVS UYVJN Keyword: KEY Mode: Decode

Expected result

Plaintext: HELLO WORLD (Reverses the encoding by subtracting key letter values instead of adding.)

Long plaintext, short keyword (vulnerable)

Input

Plaintext: ATTACKATDAWN Keyword: LEMON Mode: Encode

Expected result

Ciphertext: LXFOPVEFRNHR (Keyword cycles: LEMONLEMONLE; key repetition is what Kasiski examination exploits.)

Keyword same length as plaintext (one-time pad)

Input

Plaintext: HELLO Keyword: XMCKL Mode: Encode

Expected result

Ciphertext: EQNVZ (When keyword length equals plaintext length and keyword is random, this is a one-time pad — provably unbreakable.)

Tips

  • A long, random keyword improves security (a one-time pad with key length equal to message length is unbreakable).
  • If keyword length is short relative to ciphertext length, repeated patterns reveal the key length via Kasiski examination.
  • Watch the index of coincidence: encoded output that still scores above 0.065 usually means the key is too short for the text.
  • Vigenère with keyword 'A' is identity (no shift); with a single letter keyword it degenerates to Caesar cipher.
  • Case is preserved in output but the keyword is case-insensitive — 'KEY', 'key', and 'Key' produce identical results.
  • For CTF puzzles, try common short English words (LOVE, KEY, HACK) as the keyword if it's not given.
  • Never use Vigenère for actual confidentiality — modern attacks crack it in milliseconds with a few hundred ciphertext characters.

Frequently Asked Questions

What is the Vigenère cipher?
The Vigenère cipher uses a keyword to determine the shift for each character of the plaintext. The keyword cycles and each letter determines a different Caesar shift, making it polyalphabetic.
Is the Vigenère cipher secure?
Not by modern standards. The Kasiski examination and Friedman test can determine the key length, after which frequency analysis breaks each shift. It is historical, not production-secure.
What is the Tabula Recta?
The Tabula Recta (Vigenère square) is a 26×26 grid where row A is the normal alphabet, row B is shifted by 1, etc. To encode, find the column for the plaintext letter and the row for the key letter; their intersection is the ciphertext letter.
Does the keyword need to be alphabetic only?
Yes. Only the letters A-Z in the key are used; other characters are skipped. Non-alpha characters in the plaintext are passed through without shifting, unless you untick Preserve non-letter characters, which removes them.
How is it different from a Caesar cipher?
Caesar cipher uses a single fixed shift. Vigenère uses multiple different shifts cycling through the keyword letters. This makes frequency analysis much harder.
What is the index of coincidence shown under the output?
The probability that two letters picked at random from the output are the same. English text scores about 0.066. The tool labels values above 0.065 English-like, 0.04 to 0.065 Mixed, and lower values Uniform; longer keys usually push ciphertext toward the uniform range.

Explore the category

Glossary

Polyalphabetic cipher
A substitution cipher that uses multiple substitution alphabets, switching between them according to a key. Vigenère is the classical example; it resists simple frequency analysis.
Tabula Recta
The 26x26 grid published by Vigenère in 1586 (and earlier by Trithemius) where row A is the standard alphabet, row B is shifted by 1, row C by 2, etc. Used to encode and decode by row/column lookup.
Kasiski examination
An attack discovered by Friedrich Kasiski in 1863 that finds repeated character sequences in ciphertext and uses the gaps between them to determine the keyword length. Once length is known, the cipher reduces to multiple Caesar ciphers.
Friedman index of coincidence
A statistical method by William Friedman (1920s) that estimates Vigenère keyword length by measuring the probability that two randomly chosen letters in the ciphertext are identical.
Keyword
The repeating string of letters used to determine each shift in a Vigenère cipher. Longer, more random keywords resist cryptanalysis better; reused short keywords are the weakness exploited by Kasiski.
Frequency analysis
Cryptanalysis based on the frequency of letters in a language. Vigenère foils a single-pass frequency analysis but reveals the underlying frequencies once the keyword length is known.
One-time pad
A cipher where the keyword is truly random and exactly as long as the plaintext, never reused. Information-theoretically unbreakable, but key distribution makes it impractical for general use.
Le chiffre indéchiffrable
French for 'the indecipherable cipher' — the nickname Vigenère earned during its three-century run as the gold standard of European diplomatic cryptography before Kasiski cracked it in 1863.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities