Vigenère cipher

From Exampleproblems

Jump to: navigation, search
Image:Vigenere.jpg
The Vigenère cipher is named for Blaise de Vigenère (pictured), although Giovan Batista Belaso had invented the cipher earlier. Vigenère did invent a stronger autokey cipher.

The Vigenère cipher is a method of encryption that uses a series of different Caesar ciphers based on the letters of a keyword. It is a simplified version of the more general polyalphabetic substitution cipher, invented by Alberti circa 1465. This cipher's basic idea is so natural that it has been reinvented many times.

This cipher is well known because while it is easy to understand and implement, it often appears to beginners to be unbreakable; this earned it the moniker le chiffre indéchiffrable (French for 'the unbreakable cipher'). Consequently, many programmers have implemented obfuscation or encryption schemes in their applications, which are essentially Vigenère ciphers, only to have them broken.

Contents

History

The invention of the Vigenère cipher was misattributed to Blaise de Vigenère in the 19th century. The cipher was originally described by Giovan Batista Belaso in his 1553 book La cifra del. Sig. Giovan Batista Belaso. Vigenère published his description of the cipher in 1586.

Johannes Trithemius and Giovanni Battista Della Porta both created important predecessors to the Vigenère cipher.

Noted author and mathematician Charles Ludwidge Dodgson (Lewis Carroll) called this cipher unbreakable in his 1868 piece "The Alphabet Cipher" in a children's magazine. In 1917, Scientific American described the Vigenère cipher as "impossible of translation". Despite this reputation, however, the cipher was broken in the 19th century.

Gilbert Vernam tried to repair the broken cipher (creating the Vernam-Vigenère cipher in 1918), but no matter what he did the cipher was still vulnerable to cryptanalysis.

Description

Image:Vigenere-square.png
The Vigenère square or Vigenère table, also known as the tabula recta, can be used for encryption and decryption.

In a Caesar cipher, each letter of the alphabet is shifted along some number of places; for example, in a Caesar cipher of shift 3, A would become D, B would become E and so on. The Vigenère cipher consists of using several Caesar ciphers in sequence with different shift values.

To encipher, a table of alphabets can be used, termed a tabula recta, Vigenère square, or Vigenère table. It consists of the alphabet written out 26 times in different rows, each alphabet shifted cyclically to the left compared to the previous alphabet, corresponding to the 26 possible Caesar ciphers. At different points in the encryption process, the cipher uses a different alphabet from one of the rows. The alphabet used at each point depends on a repeating keyword.

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

The first letter of the plaintext, A, is enciphered using the alphabet in row L, which is the first letter of the key. This is done by looking at the letter in row L and column A of the Vigenère square, 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

Decryption is performed by finding the position of the ciphertext letter in a row of the table, and then taking the label of the column in which it appears as the plaintext. For example, in row L, the ciphertext L appears in column A, which taken as the first plaintext letter. The second letter is decrypted by looking up X in row E of the table; it appears in column T, which is taken as the plaintext letter.

Vigenère can also be viewed algebraically. If the letters AZ are taken to be the numbers 0–25, and addition is performed modulo 26, then Vigenère encryption can be written,

C_i \equiv P_i + K_i \pmod{26},

and decryption,

P_i \equiv C_i - K_i \pmod{26}.

Cryptanalysis

The strength behind the Vigenère cipher is, like all polyalphabetic ciphers, to make frequency analysis more difficult. Frequency analysis is the practice of decrypting a message by counting the frequency of ciphertext letters, and equating it to the letter frequency of normal text. For instance if P occurred most in a ciphertext whose plaintext is in English one could suspect that P corresponded to E, because E is the most frequently used letter in English. Using the Vigenère cipher, E can be enciphered as any of several letters in the alphabet at different points in the message thus defeating simple frequency analysis.

The critical weakness in the Vigenère cipher is the relatively short and repeated nature of its key. If a cryptanalyst discovers the key's length then the cipher text can be treated as a series of different Caesar ciphers, which individually are trivially broken. The Kasiski and Friedman tests help divine a ciphertext's key length.

Kasiski examination

For more details on this topic, see Kasiski examination.

Friedrich Kasiski published the first successful attack on the Vigenère cipher in 1863, but Charles Babbage had already developed the same test in 1854. Babbage decided to break the Vigenère cipher when John Hall Brock Thwaites submited a "new" cipher to the Journal of the Society of the Arts. When Babbage showed that Thwaites' cipher was essentially just another recreation of the Vigenère cipher Thwaites grew irritated and challenged Babbage to break his cipher.

The Kasiski examination, also called the Kasiski test, takes advantage of the fact that certain common words like "the" will, by chance, be encrypted using the same key letters, leading to repeated groups in the ciphertext. For example, a message encrypted with the keyword ABCDEF<tt> might not encipher "crypto" the same way each time it appears in the plain text:

Key:        ABCDEF AB CDEFA BCD EFABCDEFABCD
Plaintext:  CRYPTO IS SHORT FOR CRYPTOGRAPHY
Ciphertext: CSASXT IT UKSWT GQU GWYQVRKWAQJB

The encrypted text here will not have repeated sequences that correspond to repeated sequences in the plaintext. However, if the key length is different, as in this example:

Key:        ABCDAB CD ABCDA BCD ABCDABCDABCD
Plaintext:  CRYPTO IS SHORT FOR CRYPTOGRAPHY
Ciphertext: CSASTP KV SIQUT GQU CSASTPIUAQJB

Then the Kasiski test is effective. The following ciphertext has several repeated segments and allows a cryptanalyst to discover its key length:

Ciphertext: DYDUXRMHTVDVNQDQNWDYDUXRMHARTJGWNQD

The distance between the repeated <tt>DYDUXRMH<tt>s is 18. This, assuming that the repeated segments represent the same plaintext segments, implies that the key is 18, 9 or 2 characters long. The distance between the <tt>NQD<tt>s is 20 characters. This means that the key length is 20, 10, 5 or 2 characters long. By taking the intersection of these sets one could safely conclude that the key length is 2.

Friedman test

The Friedman test (also known as the Kappa test) was invented in 1925 by William F. Friedman. Friedman used the index of coincidence, the probability that any two cipher letters represent the same letter in the plaintext, to break the cipher. By knowing that the probability of any two randomly chosen letters in English are the same is about 6.5%, Friedman found that the key length is approximately equal to:

{.027n}\over{(n-1)\boldsymbol{I}-.038n+.065}

where I (the index of coincidence) equals

\sum_{n=1}^{26}\frac{n_i(n_i -1)}
{n(n-1)}

n is the length of the text and n1 through n26 are the frequencies of the letters.

The test is, however, only an approximation. It would be necessary to try key lengths close to the test result. The accuracy increases with the size of the text analysed.

The cipher of Blaise de Vigenère

Vigenère actually invented a stronger cipher: an autokey cipher. The name "Vigenère cipher" became associated with this polyalphabetic cipher instead. In fact, the two ciphers were often confused, and both were sometimes called "le chiffre indéchiffrable", or "the unbreakable cipher". For nearly 300 years this cipher was thought to be unbreakable, but Charles Babbage and Friedrich Kasiski independently found a way to break it in the middle of the 19th century. Babbage actually broke the much stronger autokey cipher, while Kasiski is generally credited with the first published solution to fixed-key polyalphabetic ciphers.

References

External links

Template:Classical cryptographyfr:Chiffrement de Vigenère he:צופן_ויז'נר it:Cifrario di Vigenère ja:ヴィジュネル暗号 nl:Vigenèrecijfer pl:Szyfr Vigenere'a

Argan Oil
Natural Skin Care
Organic Skin Care
visitor stats