Classical ciphers and historical cryptography
- •
Substitution ciphers and frequency cryptanalysis
- •
- •
- •
- •
Why monoalphabetic substitution fails
- •
Structural preservation -> identical plaintext letters always produce identical ciphertext letters at corresponding positions: if , then for all keys .
- •
Known-structure leakage -> intercepting messages with predictable headers (e.g. "From:", "HTTP/1.1") immediately reveals character mappings throughout the entire text.
- •
- •
Letter-frequency cryptanalysis (ciphertext-only attack)
- •
natural human languages exhibit non-uniform unigram frequency distributions.
- •
English unigram baseline -> E (), T (), A (), O (), I (), N ().
- •
Attack procedure
- 1.
tally letter counts across the intercepted ciphertext.
- 2.
map the most frequent ciphertext letter to E, the second to T, and the third to A.
- 3.
for ambiguous mappings, compute digram frequencies (common pairs: TH, HE, IN, ER, AN, RE) and trigrams (THE, AND, THA, ENT, ION).
- 4.
complete the key table via trial and error on remaining infrequent characters.
- 1.
- •
Core cryptographic principle -> a large key space () is necessary for security, but entirely insufficient on its own if the cipher leaks statistical structure.
- •
- •
- •
- •
Polyalphabetic substitution: The Vigenère cipher
- •
- •
Defense against naive frequency analysis
- •
the same plaintext letter maps to different ciphertext letters depending on its position mod , flattening the global letter frequency histogram.
- •
- •
Cryptanalysis (Kasiski examination and coset decomposition)
- •
Recovering key length
- •
repeated words in the plaintext produce identical ciphertext sequences whenever the distance between occurrences is a multiple of key length .
- •
inding the greatest common divisor (GCD) of distances between repeated ciphertext sequences identifies candidates for .
- •
alternatively, test candidate lengths computing the Index of Coincidence for each coset until it matches English text ().
- •
- •
- •
- •

