![]() |
[Home][FAQ Details] Encryption - Using More Than One AlphabetWe noted earlier that it is the word frequencies that are fairly constant for a given language that give away the code to the unauthorised reader in a scrambled alphabet. One way to do this is to use different alphabets. Here, this means that we do not simply use the regular order of the alphabet (abcdef), but have others in a different order. This scheme was first devised by the Frenchman, Vigenère We can illustrate this better with an example. Let us choose a password "Harry". First we start with the regular alphabet, and write under it the same alphabet, but beginning with each letter of the password:
The top alphabet, in bold, is the plain text alphabet. The first alphabet below the plain text is the H alphabet. This begins with H and continues as usual. Next come the A and the R alphabets, which begin with the named letter and continue. We drop the second R in Harry, and continue with the Y alphabet. We could have written all 26 alphabets, each beginning with A, B, C, etc, but as we will use only the ones in the password, we write only the necessary ones. This scheme uses a polyalphabet. How to Encipher a Message Using the Different AlphabetsSuppose we wish to encode the following:
First we group the letters according to the length of the password ("Harry" is 4, omitting the repeated letters):
The first letter in each group is encoded with the first (the H) alphabet). The second with the second alphabet (the A alphabet), and so on. So, K is encoded as R, e as E, etc. The encoded message is:
The example shows that it is a good idea to avoid passwords containing A, because that is the regular alphabet. It also shows that the same letter in the plain text is not always encoded with the same letter in the cipher text. In this example, the two e's in the plain text are enciphered differently in the cipher text. Because the third "e" occurs 4 letters from the first one, it is enciphered in the same way as the first "e". Scrambling the AlphabetsWe have used regular alphabets in the example, but we could have made things harder for the unauthorised reader by scrambling the alphabets. If we did this, then the principles above would be the same, but when we used, say, the H alphabet, it would start with an H, but the order would follow the scrambled alphabet. For example, we can write a scrambled alphabet for Harry: HARYBCDEFGIJKLMNOPQSTUVWXZ
Writing the columns we get HBFKOTXACGLPUZRDUMQVYEJNSW We use this to make our alphabets. The H alphabet is the same as the scramble above. The A alphabet is: ACGLPUZRDUMQVYEJNSWHBFKOTX And so on .... ProgramThe program below uses the same principles as the example above. Unlike the example above, it uses all 95 printable characters in Windows as its alphabet. The text and the password are case sensitive. This example, does not use a scrambled alphabet. I used the password "Harry", and the same text as before. The following code resulted:
The following are the top frequencies in the above code:
You may notice that the frequencies are very similar. Gone are the extremes of natural language, which have been averaged over the alphabets. The space does not appear as a clear high frequency element. The frequency is much flatter because it is the average of several alphabets. Below is a list of all the repeating patterns of length 11: Solving the VigenèreWe can solve the Vigènere style crypt that uses polyalphabets by firstly finding the length of the password and then extracting the alphabets and unravelling them. Easily said ... Finding the Length of the PasswordThe numbers in the above list of repeating patterns are the positions of the pattern in the text. For example, the pattern, "=foii>""(4," occurs at 254 and 754, so the difference is 500. Similarly we note: 500, 500, 132, 132 .. We factorise these distances between repetitions: 500=5x4*25 132=4x33 The common factor is 4, which may be the length of the password. Dividing the Cipher into its Original AlphabetsIf the password length is 4, then the alphabets are reused every fourth character, so by putting the text into 4 columns, we have a list of the cipher encoded in each alphabet. Using the first part of the code, we have:
The characters
in the first column, may be in the same alphabet. If so, we may be able to use letter frequencies, etc, to solve If the original alphabets have been scrambled, then we would use the techniques for unscrambling jumbled alphabets. Even when we use multiple alphabets, we can find a rout to decipher them, even if the original alphabets are scrambled. SummaryWhile polyalphabetical systems are better than previous ones, they still have a rout to unauthorised inspection. As attempt to improve matters, other techniques, such as the Playfair cipher were used.
|