The Playfair cipher • Sir Charles Wheatstone devised the following

advertisement
The Playfair cipher
1
The Playfair cipher
• Sir Charles Wheatstone devised the following
cipher system in 1896; it was named for his friend,
Lord Lyon Playfair, who popularized its use.
• Rather than encrypting letter by letter, the
plaintext is separated into digraphs (two letter
blocks); the cipher encrypts the message digraph by
digraph. Consequently, the Playfair cipher is an
example of a digraphic substitution cipher.
• To determine the ciphertext, we first build a 5 × 5
table with the letters of the alphabet (treating I
and J as the same letter). We fill the rows of the
table by first entering the letters of a keyword
€
(skipping duplicate letters) then filling in
remaining letters in alphabetical order. For
example, if the keyword were Xavier, the table
would look like
X A
R B
G H
N O
T U
V
C
K
P
W
I
D
L
Q
Y
E
F
M
S
Z
Plaintext digraphs are then encrypted as follows:
€
The Playfair cipher
2
• First, separate the plaintext into digraphs, taking
care to avoid any doubled letters, by inserting a
null character between any repeats: the word
freefall becomes, e.g., fr ex ef al lq.
• Then, if the two letters appear in the table in
different rows and different columns, they occupy
the two opposite corners of a square within the
table; we use a digraph consisting of the letters
that occupy the other two corners of the square for
the ciphertext (the order of the letters within the
digraph is not important).
• If the two letters appear in the same row, replace
each letter of the digraph with the letters
immediately to their right (wrapping around to the
beginning of the row if needed), and if the two
letters appear in the same column, replace each
letter of the digraph with the letters immediately
below these two in the same column (wrapping
around to the top of the column if needed).
The Playfair cipher
3
X A
R B
G H
N O
T U
V
C
K
P
W
I
D
L
Q
Y
E
F
M
S
Z
• Thus, fr ex ef al lq is encrypted as
€
RB XA FM IH QY.
• Decryption is straightforward, since the cipher is
symmetric (move left along rows and up along
columns).
• Cryptanalysis requires frequency analysis on
digraphs, which is in principle no more complicated
than standard frequency analysis on single letters,
but in practice is a bit more difficult, since one
must tally the frequencies of 26 2 = 676 different
digraphs, rather than only 26 letters.
Furthermore, unless the keyword is rather long,
the last few characters in the cipher table are
€
predictable.
Download