Professional Documents
Culture Documents
Week 3 – Lecture 1
Classical Encryption Techniques
So make it longer
Multiple letters in key
Idea is to smooth the statistical frequencies to
make cryptanalysis harder
How to make Caesar Cipher
hard?
The input may be abbreviated or compressed in some
fashion, making recognition difficult. Below it shows a
portion of a text file compressed using an algorithm called
ZIP. If this file is then encrypted with a simple substitution
cipher (expanded to include more than just 26 alphabetic
characters), then the plaintext may not be recognized when
it is uncovered in the brute-force cryptanalysis.
Frequency Analysis Attack
Ciphertext: KHOOR ZRUOG
Compute frequency of each letter in ciphertext:
K 1 H 1 O 3 R 2
Z 1 U 1 G 1
Apply 1-gram model of English
The statistical distribution of letter frequencies
of a message (text) written in any language tend
towards a known letter frequency distribution
profile of the language
Frequency Analysis Attack
This is particularly true for long messages (i.e.,
the longer the text, the closer the letter
frequency distributions match the language’s
letter frequency distributions)
The simple substitution cipher preserves the
letter frequency distributions of the plaintext
in the ciphertext (i.e., information about the
plaintext is leaked in the ciphertext)
The attacker takes a frequency count of the
ciphertext letters and tries to match them to
the letter frequency distribution profile of the
plaintext language
Frequency Statistics of English
Language
In addition to the frequency info of single letters, the
frequency info of two-letter (di-gram) or three-letter
(tri-gram) combinations can be used for the
cryptanalysis
Most frequent diagrams
TH, HE, IN, ER, AN, RE, ED, ON, ES, ST, EN, AT, TO,
NT, HA, ND, OU, EA, NG, AS, OR, TI, IS, ET, IT,
AR, TE, SE, HI, OF
Most frequent trigrams
THE, ING, AND, HER, ERE, ENT, THA, NTH, WAS,
ETH, FOR, DTH
Example: Frequency Analysis
Relative Frequency Distributions
(English & Ciphertext)
Example: Frequency
Analysis
Example: Frequency Analysis
Polyalphabetic Cipher
Poly: a Greek word means “Many”
Polyalphabetic cipher uses multiple alphabets
Avoids the problem of frequency analysis as in
case of mono-alphabetic substitution because of
one to many mappings of alphabets i.e., A to D,
F, T, etc.
The best known and the simplest example of
polyalphabetic cipher is referred to as Vigenere
Cipher
Classical Encryption
Techniques
Substitution Ciphers
Monoalphabetic Ciphers
• Caesar Cipher
Polyalphabetic Ciphers
Vigenere Cipher
Playfair Cipher
Hill Cipher
One-Time Pad
Vigenère Cipher
Best-known polyalphabetic cipher
The cipher uses multiple key letters to encrypt. The first key
encrypts the first plaintext character, the second key encrypts
the second plaintext character and so on. After all the key
letters are used, they are re-cycled i.e.,
Key Length = 9
Vigenère Cipher Tableau
Vigenère Cipher: Decryption
Example
Vigenère Cipher Tableau
Vigenère Cipher
Strength of the algorithm
Multiple ciphertext letters for each plaintext
letter
Letter frequency information is obscured
Weakness
Not all knowledge of plaintext is lost
Improvement over the Playfair cipher, but
language structure and frequency
information still remain
Classical Encryption
Techniques
Substitution Ciphers
Monoalphabetic Ciphers
• Caesar Cipher
Polyalphabetic Ciphers
• Vigenere Cipher
• Playfair Cipher
• Hill Cipher
• One-Time Pad
Playfair Cipher
Best-known multiple-letter substitution cipher
Digram cipher through keyword-based 5x5
transformation table
The 5x5 matrix is constructed by filling the letter of
keywords (minus duplicates) from left to right & from top
to bottom first and then filling the rest of the matrix with
the remaining letters in alphabetic order
The I/J count as one letter
Keyword= MONARCHY
Key Space=25!
Playfair Cipher
Repeating plaintext letters in the same pair:
Separate with a filler x. e.g. balloon with ba lx lo on
Plaintext letters in the same row
Each replaced by the letter to the right
Plaintext letters in the same column
Each replaced by the letter beneath
Otherwise
Each letter in a pair is replaced by the letter that lies in
its own row and the column occupied by the other
plaintext letter in the pair
Keyword= MONARCHY
Plaintext: HB HD HP HV HX
Ciphertext: YD YC FV FO BV
Playfair Cipher: Decryption
Simply reverse the process:
Ciphertext letters in the same row replaced
by the letter to the left
Ciphertext letters in the same column
replaced by the letter directly above
Else each letter in a pair is replaced by the letter that
lies in its own row and column occupied by the other
ciphertext letter
Keyword= MONARCHY
Ciphertext: YD YC FV FO BV
Plaintext: HB HD HP HV HX
Playfair Cipher
“In the Playfair system, there is no rule for
enciphering or deciphering a double letter in the
same digraph. When double letters are encountered
in plaintext in the same digraph, the cryptographer
must break up the double letters with a null letter,
such as inserting an X between them. As a result,
double letters will never be encountered in the
ciphertext, except in error. This is only true of the
Playfair system.” (Basic Cryptanalysis, Issues 34-42 of
Field Manual, United States Department of the Army, 1990)
Playfair Cipher: Example 1
Keyword: APPLE
Step 01: APLE
A P L E B
Step 02: C D F G H
I/J K M N O
Where, I=J
Q R S T U
V W X Y Z