b2KIT

Vigenere Cipher Encoder / Decoder

Encode and decode messages using the Vigenere polyalphabetic cipher with frequency analysis and key-length detection.

Tested tool guide Tested browser tools Checked August 16, 2026

What Vigenere Cipher Encoder / Decoder does, with a checked example

The Vigenere cipher is a polyalphabetic substitution. Each plaintext letter is shifted by a letter of the key, and the key repeats across the whole message, so the same plaintext letter encodes differently depending on its position. This tool encodes and decodes with the key you supply, and it can also attack ciphertext when the key is unknown: it estimates the key length with Kasiski's examination and the index of coincidence, then recovers the key by frequency analysis. The surprise for most users is that the cipher offers no real security. It is a historical and educational cipher, fully breakable by the analysis this page runs.

Worked example

A concrete input and expected output from the current implementation.

Input

plaintext 'meetme', key 'key'

Expected output

WICDQC

Each plaintext letter is shifted by the corresponding repeating key letter (K=10, E=4, Y=24): m+10=W, e+4=I, e+24 wraps past Z to C, t+10=D, m+4=Q, e+24=C. This follows the standard convention where A is a shift of 0; implementations that give A a shift of 1 return different output.

How the result is produced

1

Encryption and decryption

Number the alphabet A=0 through Z=25. Each plaintext letter is added to its key letter's value, wrapping around the alphabet; key letters repeat, K-E-Y-K-E-Y..., across the whole message. Decryption subtracts the key letter instead of adding. Because the shift changes at every position, repeated plaintext letters produce different ciphertext letters, which is what makes the cipher look stronger than it is.

2

Key recovery

When no key is given, the tool estimates key length. Kasiski's examination finds repeated letter sequences in the ciphertext; distances between repeats are usually multiples of the key length, and the greatest common divisor gives a candidate. The index of coincidence confirms: English text scores about 0.0667, random text about 0.0385. Each key-length column forms a Caesar cipher, and the shift is recovered by matching letter frequencies to English.

Good uses

  • Break a Vigenere message when the key is lost: paste the ciphertext and let the key-length detection and frequency analysis suggest the key and the plaintext.
  • Encode clues for a puzzle, escape room, or scavenger hunt, then decode them from the key on the other side.
  • Demonstrate classical cryptanalysis in a lesson: repeated sequences expose the key length, and letter frequencies peel off each key letter.

Limits and checks

  • It is not a security tool. A Vigenere cipher with a repeating key falls to exactly these techniques, and the frequency analysis here runs in seconds, recovering the key without any guessing. Never use it to protect real data.
  • Conventions change the result. Some implementations give the key letter A a shift of 1 instead of 0, and some count spaces and punctuation as key positions while others skip them. The same key and message can produce different ciphertext on different tools.
  • The cryptanalysis is heuristic. Short ciphertext, unusual plaintext, or keys whose letters repeat can fool Kasiski's examination and the index of coincidence, producing a wrong key length or wrong key letters; expect to adjust the suggested key by hand.

Common questions

Why is my decrypted text still gibberish?

Usually one of three things: the suggested key length or key letters are wrong, the key you typed does not match the one used to encrypt, or the tool's letter convention differs from the encoder's (A shifting 0 or 1, spaces counted or skipped). Decrypt a short phrase you know first, like 'meetme' with key 'key', to see which convention this tool uses.

Is the Vigenere cipher secure enough for real communication?

No. With a repeating key it is fully breakable: the analysis here recovers the key and plaintext from ciphertext alone, a weakness Kasiski exposed in 1863 and Friedman formalized with the index of coincidence. Only a one-time pad - a truly random key never reused - resists this, and that is a different cipher with different requirements.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools