the vigen`ere cipher (draft) - computer shene/nsf-4/ vigen`ere cipher (draft) can li, jun ma, jun...

Download The Vigen`ere Cipher (Draft) - Computer shene/NSF-4/ Vigen`ere Cipher (Draft) Can Li, Jun Ma, Jun Tao Melissa Keranen, Jean Mayo, Ching-Kuang Shene and Chaoli Wang Depart of Computer

Post on 06-Feb-2018

216 views

Category:

Documents

2 download

Embed Size (px)

TRANSCRIPT

  • The Vigenere Cipher (Draft)Can Li, Jun Ma, Jun Tao

    Melissa Keranen, Jean Mayo, Ching-Kuang Shene and Chaoli Wang

    Depart of Computer Science

    Michigan Technological UniversityHoughton, Michigan

    Version 0.1 (March 10, 2014)

    The Vigenere cipher first appeared in the 1585 book Traicte des Chiffres (A Treatise onSecret Writing) by Blaise de Vigenere (Figure 1). However, Giovan Batista Belaso discusseda similar technique in his 1553 booklet La cifra del. Sig. Giovan Batista Belaso [5, page137]. Singh [11, pp. 4551, Chapter 2] has a short and interesting discussion about Vigenere,which is quoted below, and Kahn [5, Chapter 4] has a longer and more detailed exposition.On the other hand, the book of Vigenere did present an auto-key system, which is perhapshis major contribution to cryptography in addition to the Vigenere cipher. This documentwill not discuss this auto-key systems.

    Vigenere became acquainted with the writings of Alberti, Trithemius and Portawhen, at the age of twenty-six, he was sent to Rome on a two year diplomaticmission. To start with, his interest in cryptography was purely practical and waslinked to his diplomatic work. Then, at the age of thirty-nine, Vigenere decidedthat he had accumulated enough money for him to be able to abandon his careerand concentrate on a life of study. It was only then that he examined in detailthe ideas of Alberti, Trithemius, and Porta, weaving them into a coherent andpowerful new cipher [11, page 46]. . . . Although Alberti, Trithemius and Porta allmade vital contributions, the cipher is known as the Vigenere cipher in honour ofthe man who developed it into its final form. The strength of the Vigenere cipherlies in its using not one, but 26 distinct cipher alphabets to encode a message [11,page 48]. . . . To unscramble the message, the intended receiver needs to knowwhich row of the Vigenere square has been used to encipher each letter, so theremust be an agreed system of switching between rows. This is achieved by using akeyword [11, page 49]. . . . Vigeneres work culminated in his Traicte des Chiffres,published in 1586. Ironically, this was the same year that Thomas Phelippes wasbreaking the cipher of Mary Queen of Scots. If only Marys secretary had readthis treatise, he would have known about the Vigenere cipher, Marys messages toBabington would have baffled Phelippes, and her life might have been spared [11,page 51].

    This document focuses on the basics of the Vigenere cipher. Section 1 explains thecipher and the encryption and decryption processes. The Vigenere cipher is simple and easyto understand and implement. However, for nearly three centuries the Vigenere cipher had

    1

  • Figure 1: Blaise de Vigenere

    not been broken until Friedrich W. Kasiski published his 1863 book. Note that CharlesBabbage also used a similar technique and successfully broke the Vigenere cipher in 1846;but he did not publish his work. Section 2 and Section 3 discuss the two well-known attackson the Vigenere cipher. Section 2 focuses on Kasiskis work and Section 3 presents theIndex of Coincidence (IOC, IoC or IC) method proposed in 1922 by William F. Friedman.Both methods try to estimate the length of the unknown keyword (Section 4). Once apossible length of the unknown keyword is found, the 2 method is used to recover thekeyword (Section 5). Since the estimation of keyword length may not be correct, a numberof iterations may be needed. Hence, to decrypt a ciphertext encrypted with the Vigenerecipher, one usually follows an iterative procedure as shown below. Section 6 provides severalcomplete examples. Finally, Section 7 has some concluding remarks.

    while (the decryption is not satisfactory) doestimate a new keyword length;recover the keyword using the estimated length;decrypt the ciphertext using the recovered keyword;

    end

    1 The Vigenere Cipher

    1.1 The Cipher

    The Vigenere cipher uses a 2626 table with A to Z as the row heading and column heading(Figure 2). This table is usually referred to as the Vigenere Tableau, Vigenere Table orVigenere Square. We shall use Vigenere table throughout this document. The first row of

    2

  • this table has the 26 English letters. Starting with the second row, each row has the lettersshifted to the left one position in a cyclic way. For example, when B (i.e., the second letterin the English alphabet) is shifted to the first position on the second row, the letter A movesto the end (i.e., the 26-th position).

    Figure 2: The Vigenere Table

    In addition to the plaintext, the Vigenere cipher also requires a keyword, which is repeatedso that the length is equal to that of the plaintext. For example, suppose the plaintext isMICHIGAN TECHNOLOGICAL UNIVERSITY and the keyword is HOUGHTON. Then, the keywordmust be repeated as follows:

    MICHIGAN TECHNOLOGICAL UNIVERSITY

    HOUGHTON HOUGHTONHOUGH TONHOUGNTO

    In this document, we follow the tradition by removing all spaces and punctuation, convertingall letters to upper case, and dividing the result into 5-letter blocks. As a result, the aboveplaintext and keyword become the following:

    MICHI GANTE CHNOL OGICA LUNIV ERSIT Y

    HOUGH TONHO UGHTO NHOUG HTONH OUGHT O

    To encrypt, pick a letter in the plaintext and its corresponding letter in the keyword, usethe keyword letter and the plaintext letter as the row index and column index, respectively,and the entry at the row-column intersection is the letter in the ciphertext. For example, thefirst letter in the plaintext is M and its corresponding keyword letter is H. This means that therow of H and the column of M are used, and the entry T at the intersection is the encryptedresult (Figure 3(a)). Similarly, since letter N in MICHIGAN corresponds to the letter N in thekeyword, the entry at the intersection of row N and column N is A which is the encryptedletter in the ciphertext (Figure 3(b)). Repeating this process until all plaintext letters areprocessed, the ciphertext is TWWNPZOA ASWNUHZBNWWGS NBVCSLYPMM. The following has theplaintext, repeated keyword and ciphertext aligned together.

    3

  • MICHI GANTE CHNOL OGICA LUNIV ERSIT Y

    HOUGH TONHO UGHTO NHOUG HTONH OUGHT O

    TWWNP ZOAAS WNUHZ BNWWG SNBVC SLYPM M

    (a) (b)

    Figure 3: The Vigenere Table Examples

    To decrypt, pick a letter in the ciphertext and its corresponding letter in the keyword,use the keyword letter to find the corresponding row, and the letter heading of the columnthat contains the ciphertext letter is the needed plaintext letter. Therefore, this is thereversed procedure of the encryption process. For example, to decrypt the first letter T inthe ciphertext, we find the corresponding letter H in the keyword. Then, the row of H is usedto find the corresponding letter T and the column that contains T provides the plaintextletter M (Figure 3(a)). Consider the fifth letter P in the ciphertext. This letter correspondsto the keyword letter H and row H is used to find P. Since P is on column I, the correspondingplaintext letter is I.

    Example 1 Let us encrypt the first word MICHIGAN with the keyword HOUGHTON using theVigenere table.

    MICHI GAN

    HOUGH TON

    Table 1 shows a step-by-step encryption. In this table, each pair of rows has the plaintextletter on the first column, the corresponding keyword letter on the second column, and thealphabet (top) and the row corresponding to the keyword letter (bottom). The plaintextletter and the corresponding ciphertext letters are underlined.

    From this table, we have the following result:

    MICHI GAN

    HOUGH TON

    TWWNP ZOA

    Since the keyword is repeated and a keyword letter is used multiple times, we may breakthe plaintext into rows, each of which has all the plaintext letters that are encrypted with thesame keyword letter. Each row is referred to as a coset (Section 4.1). Table 2 is an example.The first column of this table has the he keyword letters. The plaintext is organized column

    4

  • Table 1: Vigenere Table Example

    Letter Keyword Letter 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 ZM Row 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

    Letter Keyword Letter 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 ZI Row 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

    Letter Keyword Letter 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 ZC Row 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

    Letter Keyword Letter 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 ZH Row 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

    Letter Keyword Letter 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 ZI Row 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

    Letter Keyword Letter 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 ZG Row 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

    Letter Keyword Letter 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 ZA Row 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

    Letter Keyword Letter 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 ZN Row 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

    by column (i.e., writing down the plaintext top-down). In this way, once we use row H allplaintext letters that should be encrypted by H can be encrypted quickly. The number ofrow movements (i.e., moving from row to row in encryption and decryption) is the length ofthe keyword, which is more convenient than the original table lookup process as the numberof row movements is equal to the length of the plaintext.

    Table 2: Vigenere Table Example

    Keyword Letter Plaintext Letter Coset Ciphertext CostH M T G V T A N CO I E I E W S W SU C C C R W W W LG H H A S N N G YH I N L I P U S PT G O U T Z H N MO A L N Y O Z B M

    N N O I A B V

    1.2 Other Cipher Devices

    Since the Vigenere table is l