Читать книгу Cryptography, Information Theory, and Error-Correction - Aiden A. Bruen - Страница 51
Finding the keyword
ОглавлениеNow that we know how to find , we examine how to find the keyword itself. Suppose, for example, that the key‐length is 7. Consider the plain text character in the positions (i.e. characters at a distance of 7 spaces). If a particular letter occurs in positions 1 and 8, the cipher text letters in positions 1 and 8 will be the same (because we use the same key letter to encipher both characters). How can we deduce which cipher text characters correspond to which plain text characters? In the English language, the most frequently used letter is “e.” Even if we restrict ourselves to the letters of the message in positions , this will still be the case. Therefore, the most frequent cipher text letter in positions will have come from the enciphering of the letter “e”. Thus, by computing the number of occurrences of each cipher text letter at intervals of 7 letters, we can determine the most frequently occurring cipher text letter and assign it to the plain text letter “e”. Hence, we will have determined the first letter of the keyword. Similar remarks apply to positions {}, {}. In general, if we know the period , we can capture the key using frequency analysis.
We will first try the case where the period is 4, and we will determine the character frequencies for the {} letters, {} letters, and so on. Taking the letters, we get
from which we obtain the following table of frequencies:
A | B | C | D | E | F | G | H | I | J | K | L | M |
1 | 0 | 2 | 3 | 1 | 0 | 6 | 0 | 0 | 1 | 2 | 0 | 1 |
N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
0 | 0 | 5 | 0 | 0 | 0 | 1 | 1 | 4 | 0 | 0 | 0 | 0 |
Since G is the most frequently occurring letter, we make the assumption that “e” enciphers to G. Thus the first key letter might be “C.” Similarly, for the second set of letters (i.e. the letters), we obtain the following table:
A | B | C | D | E | F | G | H | I | J | K | L | M |
0 | 1 | 0 | 1 | 0 | 5 | 2 | 4 | 2 | 0 | 1 | 0 | 1 |
N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
0 | 1 | 0 | 1 | 0 | 4 | 0 | 1 | 2 | 1 | 0 | 0 | 1 |
Here there are three letters which could likely decipher to “e.” To determine which letter is the right choice, consider each character separately. If “e” enciphers to “F,” we have a key letter of “B.” If “e” enciphers to “H,” we have a key letter of “D.” Finally, if “e” enciphers to “S,” we have a key letter of “O.” Now, we must examine each choice case by case. A key letter of “B” means that the most frequently occurring letters besides “e” are “g” and “r.” Similarly, a key letter of “D” means that the most frequently occurring letters in the plain text (in positions ) besides “e” are “c” and “p.” Finally, a key letter of “O” means that the most frequently occurring letters besides “e” are “t” and “r.”. From the results shown in Table 2.1, it seems that “O” is then the more likely key‐letter. Therefore, we conclude that the second key letter is “O.”
For the letters, we obtain the following frequency table:
A | B | C | D | E | F | G | H | I | J | K | L | M |
1 | 1 | 0 | 1 | 1 | 2 | 2 | 8 | 0 | 0 | 2 | 2 | 0 |
N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
0 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 0 | 2 | 2 | 0 | 1 |
For this set of letters, the most frequently occurring letter is H. Therefore, we make the assumption that “e” enciphers to “H.” This corresponds to a key letter of “D.”
Finally, for the letters, we compute the frequencies to be
A | B | C | D | E | F | G | H | I | J | K | L | M |
1 | 0 | 1 | 0 | 2 | 0 | 1 | 2 | 5 | 0 | 0 | 1 | 1 |
N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
0 | 0 | 1 | 0 | 3 | 3 | 0 | 0 | 1 | 1 | 3 | 0 | 2 |
From this table, we deduce that since “e” likely enciphers to “I,” our fourth and final key letter is “E.”
Putting all of this together, we have determined that the period is Four, and the corresponding keyword is the word “code.” This gives the message, “The Vigenère cipher was created in the sixteenth century and was considered by everyone to be unbreakable until the twentieth century.”
The method used above, though simple to use, is very effective in determining the keyword of a given cipher text passage. The reader should be aware that there may be times where it may take some more work to pin the keyword down, due to multiple period choices and ambiguities that may occur in the frequencies of cipher text letters.