Skip to main content

Vigenère cipher

The Vigenère cipher is a Caesar cipher with a twist: instead of moving every letter the same number of places, each letter moves according to a letter of the keyword. With the key LEMON, the first letter of the message moves 11 places (as many as there are from A to L), the second 4 (from A to E), the third 12, and so on. When the key runs out, it starts again from its first letter.

A little history

Giovan Battista Bellaso described it in 1553, although it bears the name of Blaise de Vigenère, a French diplomat who published a similar cipher a few years later. For almost three centuries it was known as "the indecipherable cipher": since the same letter is encoded differently each time, frequency analysis does not work. In the 19th century, Charles Babbage and Friedrich Kasiski found how to break it by looking for the repetitions the key leaves behind.

Try it

Type a keyword and a message. Accents are dropped and the result is written in capitals. Spaces, digits and punctuation are copied as they are and use no key letter: the key only moves on with letters. With the 27-letter alphabet, Ñ is a letter like any other, in the key too, where it is worth 14.

The "Vigenère square" button shows the whole square: a row for each letter of the key and a column for each letter of the message.

Mode
Alphabet

Letters only, up to 40.

35 of 600 characters

Cipher text

ESYCECSI KR ZTQB GSI FFRLWGFR NLQGG

Create a lock from this

The key

Here are the rows of the Vigenère square your keyword uses, in its order. To encode, find the row of the key letter and the column of the message letter: where they meet is the cipher letter. To decode, find the cipher letter in the key letter's row and go up to the top of its column.

Key
ABCDEFGHIJKLMNOPQRSTUVWXYZ
LLMNOPQRSTUVWXYZABCDEFGHIJK
EEFGHIJKLMNOPQRSTUVWXYZABCD
MMNOPQRSTUVWXYZABCDEFGHIJKL
OOPQRSTUVWXYZABCDEFGHIJKLMN
NNOPQRSTUVWXYZABCDEFGHIJKLM

Classroom ideas

  • The key is in another puzzle. Hide the keyword in an earlier lock or in an object in the classroom: without it, the message cannot be read.
  • From Caesar to Vigenère. Start with a one-letter key, which is a Caesar cipher, and make it longer bit by bit so students see why it is harder to break.
  • Square in hand. Print the worksheet with the decoding aid: it includes the whole Vigenère square, which encodes and decodes with any key.
  • Codebreakers. With older students, encode a long text with a short key and ask them to look for repeated groups of letters: the distance between them gives clues to the key's length.

Tips

  • For the first puzzles, choose short keys (three to six letters) and words students can work out.
  • A does not move the letter: a key with many As leaves parts of the message unencoded.
  • If the message has no Ñ, you can use the 26-letter alphabet. If it does, use the 27-letter one to encode and to decode: with another alphabet, the letters do not match.

Printable worksheet

Practise this cipher on paper: a worksheet with the key and two exercises, ready to print or download with its answer key. Open the worksheet

Download PDFA4Letter

Last updated September 29, 2026