Playfair encryption algorithm (Menu Crypt/Decrypt \ Symmetric (classic))
The Playfair encryption algorithm is based on an algorithm developed by Charles Wheatstone in 1854.
To start with, one requires an encryption key (as an example we will use the word PASSWORT). This password is entered in a 5x5 or 6x6 matrix using the Playfair key entry dialog, as illustrated below. As no two identical letters can occur in the matrix, any double characters in the password are replaced by the next free letter in the alphabet.
The remaining cells in the matrix are then filled in with the alphabetic letters that are left over. Any characters which already exist are omitted here.
In the case of the 5x5 matrix, the J in the alphabet is left out.
The message to be encrypted is then written down in groups of two characters each (digrams). For example, suppose the message to be encrypted is
AL LE SI ST HE RA US FL IE HE SO FO RT (= " cover is broken flee immediately ").
To encrypt the message, first of all one takes the first pair of letters, AL. These two letters form the end points of one of the diagonals in a rectangle (A-L from bottom to top). The endpoints of the other diagonal (also read from bottom to top) are points P and M. The pair of letters AL is thus replaced by the pair PM. LE becomes XR. There are problems with the pair ST as both letters occur in the same row. In this case the letters immediately to the right of the original letters are used - TW. If there are no more letters to the left, then one simply proceeds to the end of the row. If the letters in a letter pair in the table are above each other, as is the case with the pair FL, then in each case one takes the next letters underneath - LY. The encrypted message now reads:
M XR TH TW KB UP BA LY KC KB TP KP CP
To improve security, it is possible to eliminate any letter duplications prior to encryption by inserting, for example, the letter X, as pairs of identical letters provide attackers with a lot of useful information.
Because letter pairs are used, the algorithm is more difficult to break than cryptosystems which only use individual letters. Thus, for example, a frequency analysis is less informative and the creation of code books is more long-winded. For this reason modern methods do not limit themselves to just two characters, but IDEA, for example, operates with 64-bit (i.e. 8-character) blocks.
A detailed example of the Playfair encryption algorithm will be found in the Examples chapter.