Professional Documents
Culture Documents
Chris Christensen
Class notes
Assume that, somehow, we have discovered that the keyword has length
five. Then the first letter of each block is enciphered with the same row of
the Vigenre square they are enciphered with the same Caesar cipher.
Similarly, the second letter of each block is enciphered with the same row
the same Caesar cipher. The third letters with the same Caesar cipher. The
fourth letters with the same Caesar cipher. And, the fifth letters with the
same Caesar cipher.
Because Caesar ciphers are easily broken by frequency analysis, we can
discover the letters of the keyword. Here is how we can proceed.
Do a frequency analysis of the first letters of the blocks. The should have all
been enciphered with the same Caesar cipher.
11
11111
11111111
1
1
1111111
1111
1
1
11111111
1111111
11111111
11
1
111
11
111111111
1111111
111
111
1111111111
11
11111111
11
1
11111111
1
111
1111111
11111
11
1111
11111111
1111111111
1
1111111
111111
11111111111111
1
1111
11
11
111111111
111
111
111111
1111111
11
111
11
11111111
111
111111
11111111111111111
11
11
1111111111
111111111
1111111
1
11
111
1111111111111111111
1
11
11
11111111
111111
1111
1111111111111
1111
1
11111
1111
1111
1111
11
11
11
1111111
11
1111111
111111
11111111
1
111111111
11
1111111111
11
1
1
111111
11
11111
111111
1111111111
11
1111
The Cryptanalysts
The English mathematician Charles Babbage (1792 1871) appears to have
been the first person to solve an autokey and he also solved polyalphabetics.
Babbage unfortunately had the defect that he was not able to stop improving
and to finish a work. Therefore, his work was never published.
Friedrich Kasiski (1805 1881) is credited with a method of attacking
polyalphabetic encryption. (Notice that from the Sixteenth Century until the
Eighteenth Century the cipher was secure.)
William Frederick Friedman (1891 1969) developed a statistical method of
attack that we will consider in the next section.
Friedrich Kasiski
Friedrich Kasiski was born in November 1805 in a western Prussian
town and enlisted in an East Prussian infantry regiment at the age of
17.
He moved up through the ranks to become a company commander
and retired in 1852 as a major. Although he had become interested in
cryptology during his military career, it was not until the 1860s that he
put his ideas on paper. In 1863 his 95-page text Die Geheimschriften
und die Dechiffrirkunst (Secret Writing and the Art of Deciphering)
was published. A large part of its contents addressed the solution of
polyalphabetic ciphers with repeating keywords, a problem that had
tormented cryptanalysts for centuries.
Disappointed by the lack of interest in his findings, Kasiski turned his
attention to other activities including anthropology. He took part in
artifacts searches and excavations and wrote numerous archeological
articles for scholarly journals. He died in May 1881 not realizing the
significance of his cryptanalytic findings. Wrixon, Fred B., Codes, Ciphers &
other Cryptic & Clandestine Communication: Making and breaking secret messages from
hieroglyphs to the internet, Black Dog & Leventhal Publishers.
DBZMGAOIYSOPVFHOWKBWXZPJLVVRFGNBKIX
DVUIMOPFQLVVPUDKPRVWOARLWDVLMWAWINZ
DAKBWMMRLWQIICGPAKYUCVZKMZARPSDTRVD
ZWEYGABYYEYMGYFYAFHLCMWLWLCVHLMMGYL
DBZIFJNCYLOMIAJJCGMAIBVRLOPVFWOBVLK
OPVUJZDVLQXWDGGIQEYFBTZMZDVRMMANZWA
ZVKFQGWEALZFKNZZZVCKVDVLQBWFXUCIEWW
OPRMUJZIYKKWEXAIOIYHZIKYVGMKNWMOIIM
KADUQWMWIMILZHLCMTCHCMINWSBRHVOPVSO
DTCMGHMKCEZASYDJKRNWYIKCFOMIPSGAFZK
JUVGMGBZJDZWWNZZVLGTZZFZSGXYUTZBJCF
PAVNZZAVWSIJVZGPVUVQNKRHFDVXNZZKZJZ
ZZKYPOIEXXMWDNZZQIMHVKZHYDVKYDGQXYF
OOLYKNMJGSYMRMLJBYYFPUSYJJNRFHCISYL
N
1111111111111111111
11111111111111
1111111111111111
11111111111111111111
11111111
1111111111111111111
11111111111111111111
111111111111
11111111111111111111111111
1111111111111111
1111111111111111111111111
1111111111111111111111
11111111111111111111111111111111
1111111111111111
111111111111111111
1111111111111111
1111111111
11111111111111
11111111111
111111
11111111111
1111111111111111111111111111111111
1111111111111111111111111111
1111111111
111111111111111111111111111
11111111111111111111111111111111111111111
19
14
16
20
8
19
20
12
26
16
25
22
32
16
18
16
10
14
11
6
11
34
28
10
27
41
491
10
STUVWXYZABCDEFGHIJKLMNOPQR
Think of a common trigraph say, the and assume that it appears twice in
the plaintext message.
11
If the is not enciphered by the same three alphabets at both locations, its
ciphertexts will be different.
GALOISGALOISGALOISGALOISGALOIS...GALOISGALOISGALOIS
the
the
ZHPTSS
But, if we are lucky and the is enciphered by the same three alphabets, we
will see a duplicate trigraph.
GALOISGALOISGALOISGALOISGALOIS...GALOISGALOISGALOIS
the
the
ZHPZHP
12
GAOGNBGPAGABGYFGYLGMAGGIGIQGWEGMKGHMGAFGMGGBZ
GTZGXYGPVGQXGSY
HOWHLC(2)HLMHZIHCMHVOHMKHFDHVKHYDHCI
IYSIXDIMOINZIICICGIFJIAJIBVIQEIEWIYKIOIIYHIKY
IIMIMKIMIILZINWIKCIPSIJVIEXIMHISY
JLVJNCJJCJCGJZDJZIJKRJUVJDZJCFJVZJZZJGSJBYJJN
JNR
KBW(2)KIXKPRKYUKMZKOPKFQKNZKVDKKWKWEKYVKNWKAD
KCEKRNKCFKJUKRHKZJKYPKZHKYDKNM
LVV(2)LWDLMWLWQLCM(2)LWLLCVLMMLDBLOMLOPLKOLQX
LZFLQBLZHLGTLYKLJB
MGAMOPMWAMMRMRLMZAMGY(2)MWLMMGMIAMAIMZDMMAMAN
MUJMKNMOIMKAMWIMILMTCMINMGHMKCMIFMGBMWDMHVMJG
MRMMLJ
NBKNZDNCYNZWNWMNWSNWYNZZ(5)NKRNMJNRF
OIYOPV(4)OWKOPFOAROMI(2)OBVOPROIYOIIODTOIEOCL
OLY
PVF(2)PJLPFQPUDPRVPAKPSDPVU(2)PRMPVSPSGPAVPOI
PUS
QLVQIIQXWQEYQGWQBWQWMQNKQIMQXY
RFGRVWRLW(2)RPSRVDRLORMMRMURHVRNWRHFRMLRFH
SOPSDTSBRSODSYDSGASGXSIJSYMSYJSYL
TRVTZMTCHTCMTZZTZB
UIMUDKUCVUJZ(2)UCIUQWUVGUTZUVQUSY
VFHVVRVRFVUIVVPVPUVWOVLMVZKVDZVHLVRLVFWVLKVUJ
VLQ(2)VRMVKFVCKVDVVGMVOFVSOVGMVLGVNZVWSVZGVUV
VQNVXNVKZVKY
WKBWXZWOAWDVWAWWINWMMWQIWEYWLWWLCWOBWDGWAZWEA
WFXWWOWOPWEXWMOWMWWIMWSBWYIWWNWNZWSIWDN
13
XZPXDVXWDXUCXAIXYUXNZXXMXMWXYF
YSOYUCYGAYYEYEYYMGYFYYAFYLDYLOYFBYKKYMZYVGYDJ
YIKYUTYPOYDVYDGYFOYKNYMRYYFYFPYJJYLN
ZMGZPJZDAZKMZARZWEZIFZDV(2)ZMZZWAZVKZFKZZZ(2)
ZZV(2)ZVCZIYZIKZHLZASZKJZJDZWWZVLZZFZFZZSGZBJ
ZZAZAVZGPZZK(2)ZKZZJZZKYZZQZQIZHY
Whew!
14
360
BYY
140
121
170
55
20
170
20
140
NZZ
OPV
OMI
PVF
PVU
RLW
UJZ
VLQ
ZZV
ZZK
ZDV
ZZZ
DBZ
DVL
HLC
KBW
LVV
LCM
MGY
NZZ
20
155
OPV
190
155
224
20
71
50
139
6
19
195
50
DVL
25
NZZ
25
10
OPV
135
NZZ
OPV
OMI
PVF
PVU
RLW
UJZ
VLQ
ZZV
ZZK
ZDV
ZZZ
Remember that we are looking for a length that is a common divisor of "all"
of these lengths well, not all because some repetitions are accidental but
most. The bolded portions of the table seem to indicate that the length of the
keyword might be five.
Now we return to the ciphertext and separate it into its five alphabets. We
begin with the first letter and take every fifth letter after it. Then take the
second letter and every fifth letter after it. Then take the third letter and
every fifth after it. Etc.
If we determined the length of the keyword correctly, we should have
partitioned the ciphertext into five portions each of which was enciphered
with a Caesar cipher. Then we proceed as we did for the first example of
this section.
15
1111
11
111111
1111111111
111111
1
11111
1111111
111
1
1111
1111
1111111111111
1111
1
1
1111
1
11
1111
1111111111111111
16
1111111111
1111111111
11
11
1
111111
1
1111
1
1111111111111
111
1111
1111111
111
111
11
11111111111
111111111
1
11111
17
11
111
111111
11111
111
1111111111
11
111111111111
111
11
1111111111111
111
1
11
11111111111111
111
11
111
111111111
18
11
11
111111
11111
1111
111111
11111
111
1
111111
111111111
111111111
11
1
1
1
1111
111
111
111
1111111111111111111
111
19
111
11111
11
11111111
1111111
11111
111
11111
11111111111
111111
1
1
11111
111111
11
111
11
111111111111
11
1
11111111
21
For the exercises which follow, software written by Robert Lewand was
used to encipher the messages, determine letter and trigraph frequencies,
calculate I, and calculate l. This software was written to accompany Lewand,
Robert Edward, Cryptological Mathematics, Mathematical Association of America, 2000.
The software also enciphers and deciphers other ciphers and performs useful
calculations.
Exercises
1. Decipher the message above. (There are a couple of errors in the
plaintext.)
2. Here is a message that was enciphered with a Vigenre cipher with a
keyword of length 6.
wgixfirtnxamwpzgfclnbztefrooznmaourtlrnodsxjw
xxdanzhdixnqttahogcmrwrvjnumybgxavtmgzdtewlqs
wvwtmlgblknrinsozgifbgnlmfpsqnxhvjaufgmjxyxum
hqsxvvzteabzrptlrijyivntofywewuyfsebeiawvbimm
igwhqceytkppienudmiqnkmtwbnidytgitmlcfqyfhegp
ghewvviqbipwsqlitmtpavlzkmdmaogxmsfbgxlssokdm
eagyzazntgzdhvxramegqifresnoodyeqtstlregdirpt
apirtbnqfezwaezmzukdmeavzqlitzgytlnbxqvintkpg
ieugzywczubowrlgxlmnviqwmgpsqxmpwgsamaazfhihv
ofehfbgfewnvjihsfmjusgywygriumrbehczubepnukdi
gnqtfoxumcmr
22
3. Here is a cipher. The results of the Friedman test are: I 0.0429 and
l 5.4572 .
3a. Use a Kasiski test to determine the length of the keyword.
tfrvgakceoekiiibrjgyobqgrnfbukzimmetfyebpuwyrvqibj
ymeyvbfwycactpugwvvmakoutcnzxxzvnazojbgutpzkgukcrv
punhkzlsthjqbtufvbpneypxnxdvcmgiafvgvzlycnjglujunr
enfeauyiilvttlplhrehvafgulzkxhnccbhxuuelvymlzkgogn
ymoxbwbnvkexjwshnwbqamaudauokyscgomfrgnzmbvorufykz
vivyebrxhzzvgkefvkgatfvvtrthueukkykprstceznoeqrgsx
hgcwajhhkwgnxhfzgnucjmpzxxkprhkuekurbhvneufionbxwn
fknsulzltkcojbgumbvvbxmbnmfzhzkprxtccenecoekgohhfv
nyecxpgnbfcoegvyujlgguekvkgntphxvbrvquoyitbudceogn
xwcilvbnjwszaymiyrxsjbbuwvcmgiafvgcgke
kgo2
lzk2
mbv2
mgi2
oek2
ogn2
ojb2
rvq2
uek2
ulz2
vcm2
vkg2
yeb2
zkg2
zxx2
23
4a. The word the is enciphered exactly the same way twice in a ciphertext,
and the distance between the two appearances is 24. What are the possible
lengths of the keyword?
4b. The word the is enciphered exactly the same way twice in a ciphertext,
and the distance between the two appearances is 15. What are the possible
lengths of the keyword?
4c. The word the is enciphered exactly the same way twice in a ciphertext,
and the distance between the two appearances is 7. What are the possible
lengths of the keyword?
4d. The word the is enciphered exactly the same way twice in a ciphertext,
and the distance between the two appearances is 6. What are the possible
lengths of the keyword?
5. The following are the intervals between repeated trigraphs in a ciphertext.
For each, what do you suspect the length of the keyword to be?
5a. 6, 12, 48, 7.
5b. 11, 32, 56, 3, 8, 16.
5c. 7, 35, 105, 2, 7, 42.
6. If the keyword of a Vigenre cipher has repeated letters, what problems
does this cause for the Kasiski test? (It causes the same problems for the
Friedman test.)
24
25