What is the Vigenère Cipher?

A Vigenère cipher is a type of cipher in which the characters of a plaintext are substituted with other characters. It is different because the same letter at different parts of the plaintext can be mapped to different letters in the ciphertext. It is done with the table below:

vigenere cipher square

For example, suppose that the plaintext to be encrypted is ATTACKATDAWN.

The person sending the message chooses a keyword and repeats it until it matches the length of the plaintext, for example, the keyword "LEMON": LEMONLEMONLE

Each row starts with a key letter. The rest of the row holds the letters A to Z (in shifted order). Although there are 26 key rows shown, a code will use only as many keys (different alphabets) as there are unique letters in the key string, here just 5 keys: {L, E, M, O, N}. For successive letters of the message, successive letters of the key string will be taken and each message letter enciphered by using its corresponding key row. The next letter of the key is chosen, and that row is gone along to find the column heading that matches the message character. The letter at the intersection of [key-row, msg-col] is the enciphered letter.

For example, the first letter of the plaintext, A, is paired with L, the first letter of the key. Therefore, row L and column A of the Vigenère square are used, namely L. Similarly, for the second letter of the plaintext, the second letter of the key is used. The letter at row E and column T is X. The rest of the plaintext is enciphered in a similar fashion:

Plaintext:  ATTACKATDAWN
Key:        LEMONLEMONLE
Ciphertext: LXFOPVEFRNHR

Decrypting

Vigenere ciphers are extremely difficult to decrypt by hand. The math behind it is extremely complex and beyond the scope of this website. However, there are plenty of tools that do the job by brute forcing it and other means.

Encrypting

Vigenere ciphers are implemented by CyberChef too. This CyberChef recipe allows you to encrypt text using a Vigenere cipher. Just remember to change the key setting to your own secret key.

Vigenere Cipher Variants

Beaufort cipher

The Beaufort cipher is equivilant to the Vigenere Cipher except the key and ciphertext have both been processed by the Atbash cipher (A replaced by Z, etc).

Please note that the recipes' input titles carry through the operations, so the tags of plaintext, ciphertext, and key in the output are incorrect labels. The plaintext label in the output actually label the ciphertext and vice versa. (The key label in the output is a meaningless byproduct.)

Variant Beaufort Cipher

In variant Beaufort, the encryption is the decryption step of the standard Vigenère cipher. Similarly, the decryption is the encryption step of the standard Vigenère cipher.