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}{&}
\)
Solutions F Solutions to Selected Exercises
Chapter 1 Caesar's Shifty Idea
Section 1.1 Simple Early Ciphers (and a little math)
Checkpoint 1.1.3.
Checkpoint 1.1.4.
Checkpoint 1.1.5.
Checkpoint 1.1.6.
Checkpoint 1.1.7.
Checkpoint 1.1.8.
Checkpoint 1.1.9.
Checkpoint 1.1.11.
Checkpoint 1.1.12.
Section 1.2 Arabic Numerical Ciphers
Checkpoint 1.2.2.
Checkpoint 1.2.3.
Checkpoint 1.2.4.
Checkpoint 1.2.5.
Exercises 1.3 How Shifty are You?
1.3.1.
1.3.2.
1.3.3.
1.3.4.
1.3.5.
1.3.6.
1.3.7.
1.3.8.
1.3.9.
Chapter 2 Attacking the Alphabet
Exercises 2.4 Bringing it all Together
2.4.5.
2.4.6.
2.4.7.
Chapter 3 Mixing Things Up
Section 3.1 Alberti's Great Idea
Subsection 3.1.2 Alberti's Polyalphabetic Cipher
Checkpoint 3.1.3.
Checkpoint 3.1.4.
Subsection 3.1.3 Vigenère's Cipher
Checkpoint 3.1.8.
Checkpoint 3.1.9.
Checkpoint 3.1.10.
Checkpoint 3.1.11.
Section 3.2 Variation on a Theme
Subsection 3.2.2 Pigpen Cipher
Checkpoint 3.2.3.
Checkpoint 3.2.5.
Checkpoint 3.2.8.
Checkpoint 3.2.10.
Section 3.3 An Automatic Hit
Subsection 3.3.2 The Autokey Cipher
Checkpoint 3.3.2.
Checkpoint 3.3.3.
Checkpoint 3.3.4.
Section 3.4 Stirring Things Up
Subsection 3.4.2 Transposition
Checkpoint 3.4.4.
Checkpoint 3.4.6.
Checkpoint 3.4.8.
Section 3.5 Presidential Secrets
Subsection 3.5.2 Thomas Jefferson and Vigenère's Cipher
Checkpoint 3.5.1.
Checkpoint 3.5.2.
Subsection 3.5.3 Thomas Jefferson's Wheel Cipher
Checkpoint 3.5.3.
Checkpoint 3.5.4.
Exercises 3.6 How Mixed Up Do You Feel?
3.6.1.
3.6.2.
3.6.3.
3.6.4.
3.6.5.
3.6.6.
3.6.7.
3.6.8.
3.6.9.
3.6.10.
3.6.11.
3.6.12.
3.6.13.
3.6.14.
Chapter 4 Triumphs of Logic and Statistics
Section 4.1 A Simple Solution
Subsection 4.1.1 The Power of Prime Factors
Checkpoint 4.1.1.
Checkpoint 4.1.6.
Checkpoint 4.1.9.
Subsection 4.1.2 But Really There's an Easier Way (sort of)
Checkpoint 4.1.12.
Checkpoint 4.1.13.
Checkpoint 4.1.14.
Section 4.3 Nineteenth Century Revelations
Subsection 4.3.1 Kasiski's Attack
Subsubsection 4.3.1.2 Determining the Key
Checkpoint 4.3.3.
Checkpoint 4.3.4.
Exercises 4.4 Do You Feel Logical?
4.4.1.
4.4.2.
4.4.3.
4.4.4.
4.4.5.
4.4.6.
4.4.7.
4.4.8.
Chapter 5 (*) An Industrial Revolution
Section 5.2 Perfect Secrecy
Subsection 5.2.2 Gilbert S. Vernam and His Great Plan
Subsubsection 5.2.2.2 Vernam's Plan
Checkpoint 5.2.14.
Checkpoint 5.2.15.
Checkpoint 5.2.16.
Checkpoint 5.2.17.
Checkpoint 5.2.18.
Checkpoint 5.2.19.
Checkpoint 5.2.20.
Checkpoint 5.2.21.
Chapter 6 Mathematics to the Rescue
Section 6.2 Affine Ciphers
Subsection 6.2.1 Affine Cipher: Encryption
Checkpoint 6.2.2.
Checkpoint 6.2.3.
Subsection 6.2.2 Affine Cipher: Decryption
Checkpoint 6.2.4.
Checkpoint 6.2.5.
Checkpoint 6.2.6.
Section 6.3 Hill's Cipher
Subsection 6.3.1 Matrices
Checkpoint 6.3.2.
Checkpoint 6.3.3.
Checkpoint 6.3.4.
Checkpoint 6.3.5.
Checkpoint 6.3.6.
Subsection 6.3.2 Hill's Cipher
Subsubsection 6.3.2.1 Enciphering with Matrices
Checkpoint 6.3.7.
Checkpoint 6.3.8.
Checkpoint 6.3.9.
Subsubsection 6.3.2.2 Matrix Inverses and Deciphering
Checkpoint 6.3.12.
Checkpoint 6.3.13.
Checkpoint 6.3.14.
Checkpoint 6.3.15.
Checkpoint 6.3.16.
Checkpoint 6.3.17.
Section 6.4 Decrypting Hill's Cipher
Subsection 6.4.1 Comments on Matrix Inverses
Checkpoint 6.4.1.
Checkpoint 6.4.2.
Checkpoint 6.4.3.
Checkpoint 6.4.4.
Subsection 6.4.2 Ciphertext Only Attack
Checkpoint 6.4.6.
Checkpoint 6.4.7.
Checkpoint 6.4.8.
Subsection 6.4.3 Known Plaintext Attack
Checkpoint 6.4.10.
Checkpoint 6.4.11.
Checkpoint 6.4.12.
Exercises 6.5 Up Hill struggle?
6.5.9.
6.5.11.
6.5.13.
Chapter 7 (*) The Modern Age
Section 7.1 Symmetric Ciphers
Subsection 7.1.1 Binary
Checkpoint 7.1.9.
Checkpoint 7.1.10.
Checkpoint 7.1.11.
Checkpoint 7.1.12.
Subsection 7.1.2 Bitwise Addition
Checkpoint 7.1.15.
Checkpoint 7.1.16.
Checkpoint 7.1.17.
Checkpoint 7.1.19.
Checkpoint 7.1.20.
Checkpoint 7.1.21.
Subsection 7.1.4 Feistel Cipher
Checkpoint 7.1.27.
(a)
(b)
(c)
(d)
Checkpoint 7.1.28.
Checkpoint 7.1.29.
Checkpoint 7.1.30.
Checkpoint 7.1.31.
Section 7.2 Data Encryption Standard
Subsection 7.2.2 Overview Really Simple DES
Checkpoint 7.2.3. Expanding a Key Schedule.
Checkpoint 7.2.4. Finding Another Key Schedule.
Checkpoint 7.2.6. Encipher “hi”: Convert and Split.
Subsection 7.2.3 Permutation
Checkpoint 7.2.9. Encipher “hi”: Initial Permutation.
Subsection 7.2.4 Enciphering Function
Checkpoint 7.2.12. Encipher “hi”: Expansion and Key.
Checkpoint 7.2.16. Encipher “hi”: Finishing the Round.
Subsection 7.2.5 Finishing Enciphering
Checkpoint 7.2.18. Encipher “hi”: Completing Encryption.
Subsection 7.2.6 A Little More Practice
Checkpoint 7.2.19. Encipher \(M_2\).
(a)
(b)
(c)
(d)
(e)
(f)
Checkpoint 7.2.20. Encipher \(M_3\).
(a)
(b)
(c)
(d)
(e)
(f)
Checkpoint 7.2.21. Encipher \(M_4\).
(a)
(b)
(c)
(d)
(e)
Checkpoint 7.2.22. Sample Decipherment.