You are on page 1of 19

C235 – IT Security and

Management
Lecture 4.2 - Cryptanalysis
Learning Objectives

• Explain and apply cryptanalysis techniques

• Distinguish between substitution and transposition


ciphers
Chart

Cryptanalysis
Cryptanalysis

Brute
Brute Force
Force Attack
Attack Frequency
Frequency Analysis
Analysis Attack
Attack
What is Cryptanalysis?

• It is the study of cryptographic systems in order to


attempt to understand how they work, and if any
flaws exist that will allow them to be broken, with or
without the key.

• Example of cryptanalysis techniques


 Brute Force Attack
 Frequency Analysis
Brute Force Attack

• Try all possible methods and permutations


• Time consuming and may not be effective.
• Even with the help of computers, some modern
ciphers may take billion of years to break by trying
all possible permutations.
Examples - Brute Force Attack

• Caesar Cipher
 Start to decipher with key of 1, 2, 3, and hope to find
the right shift
 Worst case, you have to try 25 keys
Brute Force a Caesar Ciphertext

• We assume the message is an English text and is encrypted


using Caesar cipher as
VYR JSV CSYV PMJI
In Brute Force attack, all possible shift are tried until a
meaningful English message is obtained.

Key=1:
Key=2:
Key=3:
Key=4:
Frequency Analysis

• It is the study of the frequency of letters in a


ciphertext, as an aid to breaking monoalphabetic
ciphers.
• There is a characteristic distribution of letters that is
roughly the same for almost all samples of that
language.
• For instance, given a section of English language, E, T,
A and O are the most common, while Z, Q and X are
rare.
Caesar Cipher

• https://www.youtube.com/watch?v=sMOZf4GN3oc
Letter Frequency
a 8.167%
b 1.492%

English Letter Frequency c


d
2.782%
4.253%
e 12.702%
f 2.228%
g 2.015%
14.00% h 6.094%
i 6.966%
12.00% j 0.153%
k 0.772%
10.00% l 4.025%
m 2.406%
8.00% n 6.749%
o 7.507%
6.00%
p 1.929%
q 0.095%
4.00%
r 5.987%
2.00% s 6.327%
t 9.056%
0.00% u 2.758%
a b c d e f g h i j k l m n o p q r s t u v w x y z
v 0.978%
w 2.360%
Figure 1 x 0.150%
y 1.974%
z 0.074%
Frequency in Transposition cipher
of Letters
• Since transposition does not affect the frequency of
individual letters, transposition ciphertext can be
easily detected by frequency analysis.

• If a ciphertext letters has a frequency distribution


very similar to English plaintext, then most likely it is
a transposition ciphertext.
Frequency in Transposition cipher
of Letters
14.00%
12.00%
10.00%
8.00%
6.00%
English plaintext
4.00%
2.00%
0.00%
a b c d e f g h i j k l m n o p q r s t u v w x y z

14.00%
12.00%
10.00%
Transposition 8.00%
6.00%
ciphertext
4.00%
with key ‘hello’ 2.00%
0.00%
a b c d e f g h i j k l m n o p q r s t u v w x y z
Frequency in Transposition cipher
of Letters

• If a ciphertext letters has a frequency distribution


similar to English plaintext but across different
letters, then most likely it is a Caesar ciphertext.
Caesar Cipher
14.00%
12.00%
10.00%
8.00%
English plaintext 6.00%
4.00%
2.00%
0.00%
a b c d e f g h i j k l m n o p q r s t u v w x y z

14.00%

12.00%

10.00%

8.00%
Caesar ciphertext 6.00%
with key=4 4.00%

2.00%

0.00%
a b c d e f g h i j k l m n o p q r s t u v w x y z
Quiz
• The frequency distribution of letters below is likely to be
that of
A. Caesar cipher
B. Columnar Transposition cipher
C. Vigenere cipher
D. Substitution cipher but not Caesar cipher
14.00%
12.00%
10.00%
8.00%
6.00%
4.00%
2.00%
0.00%
a b c d e f g h i j k l m n o p q r s t u v w x y z
Quiz
• A given ciphertext has G as the highest frequency
frequency letter and V as the 2nd highest frequency
letter. This ciphertext is likely to produce by a
A. Rail fence Transposition cipher
B. Columnar Transposition cipher
C. Vigenere cipher
D. Caesar cipher
Quiz
• Given that a Caesar ciphertext has K as the highest
frequency letter. What is the key of the Caesar cipher?
A. 5
B. 6
C. 7
D. 8
Quiz
• Which of the following ciphertexts cannot be decrypted
using frequency analysis of letters?
A. Caesar cipher with key = 19
B. Monoalphabetic cipher using one of the
permutations of the alphabet letters as key
C. Vigenere cipher with key AAA
D. Transposition cipher with key WEAK
At the end of you should be able to:
the lesson,
• Explain and apply cryptanalysis techniques

• Distinguish between substitution and transposition


ciphers

You might also like