Skip to main content
\( \def\ppa{-- ++(10pt,0pt) -- ++(0pt,10pt) ++(5pt,-10pt)} \def\ppb{-- ++(10pt,0pt) -- ++(0pt,10pt) ++(-10pt,0pt) -- ++(0pt,-10pt) ++(15pt,0pt)} \def\ppc{-- ++(10pt,0pt) ++(-10pt,0pt) -- ++(0pt,10pt) ++(15pt,-10pt)} \def\ppd{-- ++(10pt,0pt) -- ++(0pt,10pt) -- ++(-10pt,0pt) ++(15pt,-10pt)} \def\ppe{-- ++(10pt,0pt) -- ++(0pt,10pt) -- ++(-10pt,0pt) -- ++(0pt,-10pt) ++(15pt,0pt)} \def\ppf{-- ++(10pt,0pt) ++(0pt,10pt) -- ++(-10pt,0pt) -- ++(0pt,-10pt) ++(15pt,0pt)} \def\ppg{ ++(10pt,0pt) -- ++(0pt,10pt) -- ++(-10pt,0pt) ++(15pt,-10pt)} \def\pph{ ++(10pt,0pt) -- ++(0pt,10pt) -- ++(-10pt,0pt) -- ++(0pt,-10pt) ++(15pt,0pt)} \def\ppi{ ++(10pt,0pt) ++(0pt,10pt) -- ++(-10pt,0pt) -- ++(0pt,-10pt) ++(15pt,0pt)} \def\ppj{-- ++(10pt,0pt) -- ++(0pt,10pt) ++(-5pt,-5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppk{-- ++(10pt,0pt) -- ++(0pt,10pt) ++(-10pt,0pt) -- ++(0pt,-10pt) ++(5pt,5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppl{-- ++(10pt,0pt) ++(-10pt,0pt) -- ++(0pt,10pt) ++(5pt,-5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppm{-- ++(10pt,0pt) -- ++(0pt,10pt) -- ++(-10pt,0pt) ++(5pt,-5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppn{-- ++(10pt,0pt) -- ++(0pt,10pt) -- ++(-10pt,0pt) -- ++(0pt,-10pt) ++(5pt,5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppo{-- ++(10pt,0pt) ++(0pt,10pt) -- ++(-10pt,0pt) -- ++(0pt,-10pt) ++(5pt,5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppp{ ++(10pt,0pt) -- ++(0pt,10pt) -- ++(-10pt,0pt) ++(5pt,-5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppq{ ++(10pt,0pt) -- ++(0pt,10pt) -- ++(-10pt,0pt) -- ++(0pt,-10pt) ++(5pt,5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppr{ ++(10pt,0pt) ++(0pt,10pt) -- ++(-10pt,0pt) -- ++(0pt,-10pt) ++(5pt,5pt) node {$\cdot$} ++(10pt,-5pt)} \def\pps{ ++(0pt,10pt) -- ++(5pt,-10pt) -- ++(5pt,10pt) ++(5pt,-10pt)} \def\ppt{ ++(0pt,10pt) -- ++(10pt,-5pt) -- ++(-10pt,-5pt) ++(15pt,0pt)} \def\ppu{ ++(10pt,10pt) -- ++(-10pt,-5pt) -- ++(10pt,-5pt) ++(5pt,0pt)} \def\ppv{-- ++(5pt,10pt) -- ++(5pt,-10pt) ++(5pt,0pt)} \def\ppw{ ++(0pt,10pt) -- ++(5pt,-10pt) -- ++(5pt,10pt) ++(-5pt,-5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppx{ ++(0pt,10pt) -- ++(10pt,-5pt) -- ++(-10pt,-5pt) ++(5pt,5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppy{ ++(10pt,10pt) -- ++(-10pt,-5pt) -- ++(10pt,-5pt) ++(-5pt,5pt) node {$\cdot$} ++(10pt,-5pt)} \def\ppz{-- ++(5pt,10pt) -- ++(5pt,-10pt) ++(-5pt,5pt) node {$\cdot$} ++(10pt,-5pt)} \newcommand \sboxOne{ \mbox{ $ \begin{array}{|c|c|c|c|c|}\hline \amp 00 \amp 01 \amp 10 \amp 11 \\ \hline 00 \amp 01 \amp 11 \amp 10 \amp 11 \\ \hline 01 \amp 11 \amp 10 \amp 01 \amp 00 \\ \hline 10 \amp 00 \amp 10 \amp 01 \amp 11 \\ \hline 11 \amp 11 \amp 01 \amp 11 \amp 10 \\ \hline \end{array} $ } } \newcommand \sboxTwo{ \mbox{ $ \begin{array}{|c|c|c|c|c|}\hline \amp 00 \amp 01 \amp 10 \amp 11 \\ \hline 00 \amp 00 \amp 01 \amp 10 \amp 11 \\ \hline 01 \amp 10 \amp 00 \amp 01 \amp 11 \\ \hline 10 \amp 11 \amp 00 \amp 01 \amp 00 \\ \hline 11 \amp 10 \amp 01 \amp 10 \amp 11 \\ \hline \end{array} $ } } \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Appendix E Solutions to Selected Exercises

Exercises How Shifty are You?

Exercise 1
Answer
``FN'EN JUU QNJAM CQJC J VRUURXW VXWTNHB KJWPRWP XW
J VRUURXW CHYNFARCNAB FRUU NENWCDJUUH ANYAXMDLN
CQN NWCRAN FXATB XO BQJTNBYNJAN. WXF, CQJWTB CX
CQN RWCNAWNC, FN TWXF CQRB RB WXC CADN.'' -
YAXONBBXA AXKNAC BRUNWBTH
Exercise 2
Answer

There are in fact multiple answers to this, one of them would be:

STUVVWXYZ TRJ ST SN U LE ME VS VX
Exercise 3
Answer

BAA LEEK BAD

Exercise 4
Answer
NRHGZPVH ZIV Z KZIG LU YVRMT SFNZM. ZKKIVXRZGV
BLFI NRHGZPVH ULI DSZG GSVB ZIV: KIVXRLFH ORUV
OVHHLMH GSZG XZM LMOB YV OVZIMVW GSV SZIW DZB.
FMOVHH RG?H Z UZGZO NRHGZPV, DSRXS, ZG OVZHG,
LGSVIH XZM OVZIM UILN. - ZO UIZMPVM, LS, GSV
GSRMTH R PMLD, 2002
Exercise 5
Answer

“Now they show you how detergents take out bloodstains, a pretty violent image there. I think if you’ve got a T-shirt with a bloodstain all over it, maybe laundry isn’t your biggest problem. Maybe you should get rid of the body before you do the wash.” - Jerry Seinfeld

Exercise 6
Answer

“One should guard against preaching to young people success in the customary form as the main aim in life. The most important motive for work in school and in life is pleasure in work, pleasure in its result, and the knowledge of the value of the result to the community.” - Albert Einstein

Exercise 7
Answer

“In a completely rational society, the best of us would be teachers and the rest of us would have to settle for something less, because passing civilization along from one generation to the next ought to be the highest honor and the highest responsibility anyone could have.” - Lee Iacocca

Exercise 8
Answer

“The good Christian should beware of mathematicians and all those who make empty prophecies. The danger already exists that mathematicians have made a covenant with the devil to darken the spirit and confine man in the bonds of Hell.” - St. Augustine

Exercise 9
Answer
MPKRGOPL AHRM GHP ZHFR NKHF TDGGDGO. VHQK
MPKQOOERM ARSREHI VHQK MPKRGOPLM. TLRG VHQ OH
PLKHQOL LXKAMLDIM XGA ARZDAR GHP PH MQKKRGARK,
PLXP DM MPKRGOPL. - XKGHEA MZLTXKWRGROORK

Exercises Bringing it all Together

Exercise 5
Answer

“of all that is good, sublimity is supreme. succeeding is the coming together of all that is beautiful. furtherance is the agreement of all that is just. perseverance is the foundation of all actions.” - lao tzu

Solution

When you look at the frequencies you see that G and V are most common, next most common are R and Z. So we know that one of the first two is probably e while the other is t, and one of the latter two is likely a, assuming the frequencies are fairly normal. Then we see that GSV and GSZG appear frequently with GS the most common bi-gram (so that it is likely th). Putting this together we see that e is V, t is G, a is Z, and h is S. We can also see that ZOO appears four times with Z replaced by a this looks like aOO, the likely candidate is that ZOO is all, so that O is l.

At this point we can start writing down the letters we have in the monoalphabetic substitution table (Table 1.1.2). When you do that you will hopefully notice that the cipher letters are in reverse alphabetic order, so this was likely enciphered with atabash which we learned about in Exercise 1.4.

Exercise 6
Answer

“far better is it to dare mighty things, to win glorious triumphs, even though checkered by failure ... than to rank with those poor spirits who neither enjoy nor suffer much, because they live in a gray twilight that knows not victory nor defeat.” - theodore roosevelt

Solution

Looking at a basic frequency analysis we see that the most common single letters are G, R, B, E, V, U, A, F, N, H, the most common bi-gram is GU, and the most common tri-gram is GUR; from this we may conclude that G is t, U is h, and R is e. Since the word spacing is preserved we also have the two letter words VF, VG, GB, and VA, and the one letter word N, these allow us to deduce the ciphertext-plaintext pairs N - a, B - o, V - i, and F - s. When we start writing down the ciphertext we have worked out under the plaintext alphabet (use Table 1.1.2) we can see that the letters we have discovered are in the correct order and with the correct spacing so that we appear to have a shift, trying this as a possible solution we see that we are correct and that a was shifted to N.

Exercise 7
Answer

“... what is out of the common is usually a guide rather than a hindrance. In solving a problem of this sort, the grand thing is to be able to reason backwards. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the every-day affairs of life it is more useful to reason forwards, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.” - Sherlock Holmes in Study in Scarlet by Sir Arthur Conan Doyle

Solution

As always you need to start with a basic frequency analysis. From this you immediately get that the ten most common letters are L, T, J, S, Q, P, I, K, F, D, the most common bi-gram and tri-gram are TK and TKL, L appears frequently before and after other letters (in particular P), and finally TKLPL and TKLDP appear multiple times; from all of this we get the ciphertext-plaintext pairs L - e, T - t, H - k, P - r, and D - i. Then we can start filling in bits and pieces of the message and looking for more clues, for example LVLPY becomes eVerY which we reasonably assume is every. Also, with the hint that it is a keyword cipher we can line up the ciphertext letters we have worked out underneath a copy of the plaintext alphabet (Table 1.1.2) and look for patterns. Continuing in this way we can finally arrive at the solution and the key is KEYWORD: SHERLOCKED, key letter: a.

Exercises Up Hill struggle?

Exercise 9
Answer

VIXJZ FVIBW DUZT

Exercise 11
Answer

spicy chicken wings

Exercise 13
Answer

“Chuck Norris threw a grenade and killed 50 zombies, then it exploded.”