Vigenere cipher guide

Vigenère Square Explained: How to Read and Use It

A Vigenère square is a grid of shifted alphabets used to perform Vigenère encryption and decryption by hand. It is also called a Vigenère table, Vigenère tableau, or tabula recta.

The grid can look complicated at first because it contains 26 versions of the alphabet. Its logic is much simpler than its appearance suggests. Each row is just the alphabet shifted one position farther than the row above it.

In the standard English version, the row beginning with A applies no shift, the row beginning with B applies a shift of one, and the process continues through Z, which represents a shift of 25.

That makes the square a lookup table for the same operation performed mathematically by the Vigenère cipher. If you would rather work with a message directly, the Vigenère Cipher Decoder and Encoder performs the operation automatically. The purpose here is to understand exactly what the table is doing.

What the Vigenère square actually represents

Start with the ordinary alphabet:

ABCDEFGHIJKLMNOPQRSTUVWXYZ

Move the first letter to the end and you get the next shifted alphabet:

BCDEFGHIJKLMNOPQRSTUVWXYZA

Shift once more:

CDEFGHIJKLMNOPQRSTUVWXYZAB

Continue until every possible shift has been represented. With a 26-letter alphabet, there are 26 rows.

Viewed this way, the square is not a collection of unrelated substitutions. It is an organized set of all 26 Caesar-style shifts of the alphabet.

A row → shift 0 B row → shift 1 C row → shift 2 … L row → shift 11 … Z row → shift 25

The Vigenère key determines which of those shifts is used for each position in a message. If the current key letter is L, for example, the corresponding shift is 11.

This relationship between a key letter and a shift is central to how the Vigenère cipher works .

The complete tabula recta

The standard square below uses the alphabet A–Z. The letters across the top identify columns, while the letters on the left identify rows.

For the convention used in this article, the key letter selects the row and the plaintext letter selects the column during encryption.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z B | B C D E F G H I J K L M N O P Q R S T U V W X Y Z A C | C D E F G H I J K L M N O P Q R S T U V W X Y Z A B D | D E F G H I J K L M N O P Q R S T U V W X Y Z A B C E | E F G H I J K L M N O P Q R S T U V W X Y Z A B C D F | F G H I J K L M N O P Q R S T U V W X Y Z A B C D E G | G H I J K L M N O P Q R S T U V W X Y Z A B C D E F H | H I J K L M N O P Q R S T U V W X Y Z A B C D E F G I | I J K L M N O P Q R S T U V W X Y Z A B C D E F G H J | J K L M N O P Q R S T U V W X Y Z A B C D E F G H I K | K L M N O P Q R S T U V W X Y Z A B C D E F G H I J L | L M N O P Q R S T U V W X Y Z A B C D E F G H I J K M | M N O P Q R S T U V W X Y Z A B C D E F G H I J K L N | N O P Q R S T U V W X Y Z A B C D E F G H I J K L M O | O P Q R S T U V W X Y Z A B C D E F G H I J K L M N P | P Q R S T U V W X Y Z A B C D E F G H I J K L M N O Q | Q R S T U V W X Y Z A B C D E F G H I J K L M N O P R | R S T U V W X Y Z A B C D E F G H I J K L M N O P Q S | S T U V W X Y Z A B C D E F G H I J K L M N O P Q R T | T U V W X Y Z A B C D E F G H I J K L M N O P Q R S U | U V W X Y Z A B C D E F G H I J K L M N O P Q R S T V | V W X Y Z A B C D E F G H I J K L M N O P Q R S T U W | W X Y Z A B C D E F G H I J K L M N O P Q R S T U V X | X Y Z A B C D E F G H I J K L M N O P Q R S T U V W Y | Y Z A B C D E F G H I J K L M N O P Q R S T U V W X Z | Z A B C D E F G H I J K L M N O P Q R S T U V W X Y

The important pattern is easier to see in the first few rows. Moving one row downward increases the shift by one. Moving across a row progresses through that shifted alphabet.

Once you understand that pattern, you do not need to memorize any cells in the square.

Vigenère square diagram showing key letter L row and plaintext letter M column intersecting at ciphertext letter X
How a Vigenère square lookup works: the key letter selects a shifted row, the plaintext letter selects a column, and their intersection gives the ciphertext letter.

How to find one encrypted letter

Suppose the plaintext letter is M and the corresponding key letter is L.

Using the convention above:

1. Find L on the left side of the square. 2. Follow the L row horizontally. 3. Find M at the top of the square. 4. Follow the M column downward. 5. The row and column meet at X.

Therefore:

Plaintext: M Key: L Ciphertext: X

There is a useful way to verify this without the table.

If A=0, B=1, and so on, then M=12 and L=11.

12 + 11 = 23 23 = X

The table lookup and the numerical calculation give the same result because they are two representations of the same operation.

How to encrypt a message with the square

A complete message requires one additional step: the key must be aligned with the plaintext.

Take the plaintext:

MEETME

and the key:

LAMP

The key is shorter than the message, so the traditional repeating-key Vigenère method starts it again from the beginning:

Plaintext: M E E T M E Key: L A M P L A

Now perform one square lookup for each column.

Position Plaintext Key Shift Ciphertext
1 M L 11 X
2 E A 0 E
3 E M 12 Q
4 T P 15 I
5 M L 11 X
6 E A 0 E

The resulting ciphertext is:

XEQIXE

Notice what happens to the two early E characters. The first is paired with A and remains E. The next is paired with M and becomes Q.

The plaintext letter itself did not determine the output. The plaintext and key letter together determined it. This changing substitution is why Vigenère is polyalphabetic rather than a single fixed substitution.

The complete message-level procedure, including key alignment and worked calculations, is covered separately in How to Encrypt and Decrypt With the Vigenère Cipher .

How to decrypt with the Vigenère square

Decryption uses the same square, but the lookup changes because the ciphertext is now known and the plaintext is the value you are trying to recover.

Suppose the first ciphertext letter is X and the key letter is L.

1. Select the L row because the key letter is L. 2. Scan across that row until you find X. 3. Move straight upward from X to the column heading. 4. The column heading is M. 5. M is the recovered plaintext letter.

So:

Ciphertext: X Key: L Plaintext: M

Continue in the same way for each ciphertext-key pair and the example above reverses cleanly:

Ciphertext: X E Q I X E Key: L A M P L A Plaintext: M E E T M E

A common beginner mistake is to treat decryption as another ordinary intersection lookup. During encryption, plaintext and key identify the cell containing the ciphertext. During decryption, the key identifies a row, the ciphertext identifies a cell within that row, and the column heading reveals the plaintext.

Why some Vigenère squares appear to reverse the row and column

One source may tell you to place the key on the left and the plaintext across the top. Another may tell you to do the opposite.

For the ordinary Vigenère square shown above, both conventions produce the same encryption result.

The reason is mathematical. Each cell represents the sum of two letter values modulo 26:

Ciphertext = (Plaintext + Key) mod 26

Addition can be reversed without changing the result:

Plaintext + Key = Key + Plaintext

For example, plaintext F and key K lead to P whether you locate row K and column F or row F and column K.

This symmetry explains why apparently different instructions can both be correct.

What matters is that you understand how the particular table is labeled. Do not blindly transfer instructions from one diagram to another, especially when working with a modified alphabet or a related cipher whose table may not behave in exactly the same way.

The square is really modular arithmetic written out

The most useful insight about the Vigenère square is that it does not perform a separate kind of encryption. It makes the arithmetic visible.

Number the alphabet from 0 to 25:

A=0 B=1 C=2 D=3 E=4 … Z=25

Encryption is:

C = (P + K) mod 26

where:

P = plaintext letter value K = key letter value C = ciphertext letter value

Consider plaintext T with key P.

T = 19 P = 15 19 + 15 = 34 34 mod 26 = 8 8 = I

In the square, row P and column T intersect at I.

The apparent wrap from the end of the alphabet back to the beginning is simply the visible effect of arithmetic modulo 26.

Decryption reverses the calculation:

P = (C – K) mod 26

Understanding this equivalence is useful because it removes much of the mystery from the table. The square is convenient for hand work; the arithmetic is usually more convenient for software.

Why A represents a shift of zero

The first row is sometimes a source of confusion.

If the key letter is A, the plaintext does not change:

A + A = A B + A = B C + A = C … Z + A = Z

That is because A represents the numerical value 0, not 1.

The row beginning with B is the first actual shift:

A → B B → C C → D … Z → A

Treating A as a shift of one moves every result by one position and produces an incompatible ciphertext. This is one of the easiest off-by-one errors to make when constructing a Vigenère table manually or implementing the cipher in code.

Spaces and punctuation are not part of the standard 26-letter square

The traditional table above contains only the letters A–Z. It therefore does not tell you what to do with spaces, punctuation, digits, accented characters, or other symbols.

A manual convention might remove non-letter characters before encryption:

MEET ME AT NINE ↓ MEETMEATNINE

Another implementation might preserve spaces and punctuation in their original positions while applying the key only to alphabetic characters.

Those choices do not change the basic Vigenère operation, but they can change key alignment if two systems handle non-letter characters differently.

For example, if one program advances the key when it encounters a space and another does not, the two implementations will stop producing the same ciphertext after that point.

When reproducing ciphertext from a book, challenge, website, or piece of software, check its alphabet and character-handling rules before assuming that your table calculation is wrong.

Five mistakes that cause wrong Vigenère table results

Most errors with the square are procedural rather than mathematical. The table itself is deterministic: the same correctly aligned plaintext and key always produce the same result.

Mistake What goes wrong What to check
Counting A as shift 1 Every substitution is displaced by one. Use A=0 through Z=25.
Misaligning the repeated key Correct lookups are performed with the wrong key letters. Write plaintext and keystream on aligned lines first.
Using encryption logic for decryption The ciphertext is combined with the key instead of reversed. During decryption, find the ciphertext within the key row and read the column heading.
Handling spaces differently The key can move out of alignment partway through the message. Confirm whether non-letters consume a key position.
Ignoring the table labels A different row/column convention may appear contradictory. Identify what the top and left labels represent before starting.

Writing the plaintext, repeated key, and result on separate aligned lines prevents several of these errors at once.

Vigenère square and tabula recta: are they the same thing?

In modern explanations of the standard Vigenère cipher, the terms Vigenère square and tabula recta are commonly used for the same shifted-alphabet grid.

Historically, however, the table itself predates the cipher now called Vigenère. Johannes Trithemius described a tabula recta in Polygraphia, which was published in the early sixteenth century. Later polyalphabetic systems used shifted alphabets in different ways.

That distinction matters because the table is a cryptographic structure, not a cipher by itself. Instructions for choosing rows and columns, generating the key stream, and reversing the transformation determine how the structure is used.

The Vigenère cipher uses the table according to its keying rule. Other historical systems can use related alphabet tables differently.

When the square is useful and when it is not

For manual encryption, the square removes the need to convert letters into numbers and calculate modular sums for every character. You can work directly with letters.

It is also useful for learning because the rows make the changing shifts visible. You can see immediately that a key letter selects one of many substitution alphabets rather than one fixed alphabet being used throughout the message.

For software, constructing a literal 26-by-26 table is usually unnecessary. The same output can be calculated directly from letter values.

Vigenère square ↓ visual lookup of shifted alphabets Modular arithmetic ↓ numerical calculation of the same relationship

Neither method is more “correct.” They are different representations of the same standard operation.

The simplest way to remember the Vigenère square

You do not need to memorize 676 cells.

Remember three ideas instead.

First, each row is the alphabet shifted one position farther than the previous row.

Second, the key letter determines the shift used at that position.

Third, the cell at the plaintext-key intersection is simply the result of adding those two letter values modulo 26.

Key letter → choose a shift Plaintext letter → choose a position Intersection → ciphertext letter

Once those relationships are clear, the Vigenère square stops being a large table to memorize and becomes what it really is: a visual map of the cipher’s letter arithmetic.

If the square itself now makes sense and you want to follow the entire algorithm from key preparation through the final ciphertext, continue with the Vigenère encryption and decryption process .

Written by Marcus Hale

Editorially reviewed by VigenereDecoder.com editorial team

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *