Vigenere Cipher Encoder

The Vigenere cipher, first described by Giovan Battista Bellaso in 1553 and later misattributed to Blaise de Vigenere, shifts each letter by a different amount that depends on a repeating keyword. Despite being called “le chiffre indéchiffrable” for 300 years, it finally fell to Friedrich Kasiski’s statistical attack in 1863. This encoder lets you encode and decode with it for puzzles, CTF challenges and classroom cryptography.

How to use the Vigenere cipher

  1. 1

    Enter your message

    Letters A to Z are shifted; digits, spaces, punctuation and any non-Latin characters pass through unchanged.

  2. 2

    Set a keyword

    Pick any word or phrase. Only its letters count, and longer keywords are harder to break.

  3. 3

    Choose encode or decode

    The same tool handles both directions using the Vigenere square.

  4. 4

    Read the result

    Each letter moves by the matching keyword letter (A=0, B=1, and so on); upper and lower case are kept.

A worked example

The tool starts with Hello World and the key KEY. Encoding gives:

plaintext:  Hello World
key:        KEYKE YKEYK
ciphertext: Rijvs Uyvjn

Notice that case is preserved (H stays uppercase as R), the space is left alone, and the keyword pointer only advances on letters. Switch to decode with the same key and Rijvs Uyvjn turns back into Hello World.

The Vigenere square

Each plaintext letter and keyword letter pick a row and column in a 26x26 grid of Caesar shifts. If the plaintext letter is H and the key letter is K, the output is R, because H (7) + K (10) = 17 = R. The classic textbook example uses a repeating key:

plaintext:  ATTACKATDAWN
key:        LEMONLEMONLE
ciphertext: LXFOPVEFRNHR

Why it beat earlier ciphers

Monoalphabetic ciphers like Caesar and Atbash always encode E the same way, so the most common ciphertext letter betrays the most common plaintext letter. Vigenere rotates the shift, so E can become X one time and K the next, flattening the letter frequencies and defeating simple analysis.

Kasiski’s attack in one paragraph

Repeated groups of letters in the ciphertext, spaced a fixed distance apart, hint that the key length divides that distance. Collect a few such gaps, take their greatest common divisor, and you have the probable key length. Split the ciphertext into that many Caesar streams and run frequency analysis on each one.

Security note

Vigenere is a classical cipher with educational value only. It is not secure against any modern attack: a short English text with a six-letter key can be broken in seconds. For real confidentiality use AES-GCM or ChaCha20-Poly1305 from a vetted library, never a hand cipher.

Frequently Asked Questions

They pass through unchanged. Only the 26 letters A to Z are shifted, so accented letters and any non-Latin script are copied as they are, and the keyword pointer does not advance on them.

Yes. Lowercase text produces lowercase output and uppercase stays uppercase. The keyword itself is case-insensitive.

Absolutely. It is a staple of beginner CTFs. Hints often give the key length in the challenge text or leave a repeated group in the ciphertext.

Your text and key are sent to our server to compute the cipher, where they are processed and not stored or logged. Because Vigenere is not secure, never run a real secret through any classical cipher.

Related Tools

Tool available in other languages