Symmetric Cipher Model

COMPUTER SECURITY
(CS3801)
Lecture 2 (Chapter 2)
Classical Encryption Techniques
Prepared by Dr. Lamiaa M. Elshenawy
1
OUTLINES

1.
2.

1.
2.
3.
4.
5.
6.



Symmetric Cipher Model
Cryptography
Cryptanalysis and Brute-Force Attack
Substitution Techniques
Caesar Cipher
Monoalphabetic Ciphers
Playfair Cipher
Hill Cipher
Polyalphabetic Ciphers
One-Time Pad
Transposition Techniques
Rotor Machines
Steganography
KEY POINTS



1.
2.
Symmetric encryption (conventional encryption) is a
form of cryptosystem in which encryption and
decryption are performed using the same key
Symmetric encryption transforms plaintext into
ciphertext using a secret key and an encryption
algorithm and decrypt by the same key and a
decryption algorithm
Two types of attack on an encryption algorithm
Cryptanalysis based on properties of the encryption
algorithm
Brute-force, trying all possible keys
KEY POINTS

1.
2.


Traditional (pre-computer) symmetric ciphers use
substitution and/or transposition techniques
Substitution techniques map plaintext elements
(characters, bits) into ciphertext elements
Transposition techniques systematically transpose
the positions of plaintext elements
Rotor machines are sophisticated pre-computer
hardware devices that use substitution techniques.
Steganography is a technique for hiding a secret
message within a larger one in such a way that others
cannot discern the presence or contents of the hidden
message.
SYMMETRIC CIPHER MODEL
Input
Plaintext
Encryption
Encryption
algorithm
Secret key
output
Ciphertext
Input
Decryption
output
Ciphertext
Decryption
algorithm
Secret key
Plaintext
SYMMETRIC CIPHER MODEL





Plaintext: The original intelligible message or data that is
fed into the algorithm as input
Encryption algorithm: The encryption algorithm performs
various substitutions and transformations on the plaintext
Secret key: The secret key is also an input to the
encryption algorithm
Ciphertext: The scrambled unintelligible message produced
as output
Decryption algorithm: It takes the ciphertext and the
secret key to produce the original plaintext
SYMMETRIC CIPHER MODEL
SECURITY MATHEMATICS
Encryption
algorithm
•
Encryption
Secrete
key
Y = E(K, X)
Chipertext
•
Decryption
Plaintext
X = D(K, Y)
Decryption
algorithm
SECURITY REQUIREMENTS
Strong
Secret
encryption algorithm
key should be secret
(sender/receiver)
SYMMETRIC CIPHER MODEL
1- Cryptography (enciphering)
 Cryptology
2- Cryptanalysis (deciphering)
 Cryptanalyst (Opponent-AdversaryHacker)
CRYPTOGRAPHY

Encryption techniques

Substitution techniques
Transposition techniques

Secret keys


Symmetric (single-key)
Asymmetric (two-key)

Plaintext processing



Block cipher (processes one block of input elements at a time)
Stream cipher (processes one of input elements at a time)
CRYPTANALYSIS AND BRUTE-FORCE
ATTACK
 Objective
recover the key

Cryptanalysis ( plaintext-ciphertext pairsalgorithm nature)

Brute-force attack (try possible keys)
CRYPTANALYSIS AND BRUTE-FORCE
ATTACK
Unconditionally secure
 Computationally secure
 Cost of breaking cipher > value of
encrypted information
 Time of breaking cipher > lifetime of
information

CRYPTANALYSIS AND BRUTE-FORCE
ATTACK
CRYPTANALYSIS AND BRUTE-FORCE
ATTACK
 32-bit key
 56-bit key (DES)
 128-bit key (AES)
 168-bit Key
Key Size (bits)
Number of Alternative
Keys
Time required at 1
decryption/µs
Time required at 106
decryptions/µs
32
232 = 4.3  109
231 µs
= 35.8 minutes
2.15 milliseconds
56
256 = 7.2  1016
255 µs
= 1142 years
10.01 hours
128
2128 = 3.4  1038
2127 µs
= 5.4  1024 years
5.4  1018 years
168
2168 = 3.7  1050
2167 µs
= 5.9  1036 years
5.9  1030 years
26! = 4  1026
2  1026 µs = 6.4  1012 years
26 characters
(permutation)
DES: Data Encryption Standard
AES: Advanced Encryption Standard
6.4  106 years
SYMMETRIC CIPHER TECHNIQUES
 - Substitution techniques
1.
2.
3.
4.
5.
6.
Caesar Cipher
Monoalphabetic Ciphers
Playfair Cipher
Hill Cipher
Polyalphabetic Ciphers (Vigenère cipher–
Vernam cipher)
One-Time Pad
 - Transposition techniques
• Rail fence
CAESAR CIPHER
• Letter
3rd letter
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
D E F G H I G K L M N O P Q R S T U V W X Y Z A B C
Plaintext: meet me after
the
party
 Ciphertext: PHHW PH DIWHU WKH SDUWB

Gaius Julius Caesar: Roman Dictator, 1st century BC
CAESAR CIPHER
a
b
c
d
e
f
g
h
i
j
0
1
2
3
4
5
6
7
8
9
n
o
p
q
r
s
t
u
v
w
k
l
10 11
x
y
13 14 15 16 17 18 19 20 21 22 23 24
C = E(K, P) = (P + K) mod 26
 P = D(K, C) = (C - K) mod 26

m
12
z
25
MONOALPHABETIC CIPHERS
MONOALPHABETIC CIPHERS
MONOALPHABETIC CIPHERS
PLAYFAIR CIPHER
5 × 5 matrix
 Allied forces

World War II
“MONARCHY”
M
O
N
A
R
C
H
Y
B
D
E
F
G
I/J
K
L
P
Q
S
T
U
V
W
X
Z
Baron Playfair is a British scientist and a friend of Sir Charles Wheatstone
in1854
PLAYFAIR CIPHER
Example:
 Plaintext: “How are you”
“HO WA RE YO UQ”
 Ciphertext:
“FH XN MK HN WL”

HILL CIPHER
C = E(K, P) = PK mod 26
 P = D(K, C) = CK-1 mod 26
 For 3 × 3 matrix

Lester S. Hill (1891–1961) :An American mathematician and educator
POLYALPHABETIC CIPHERS
1.
2.
Vigenère Cipher
Vernam Cipher
VIGENÈRE CIPHER
Ci = (pi + ki mod m) mod 26
 pi = (Ci - ki mod m) mod 26

Blaise de Vigenère (5 April 1523 – 19 February 1596): French diplomat,
cryptographer, translator and alchemist
VIGENÈRE CIPHER
“decpective”
VERNAM CIPHER
Gilbert Sandford Vernam (3 April 1890 – 7 February 1960): American scientist
VERNAM CIPHER
Let the message be “IF” then its ASCII code be
(1001001 1000110) and the key be (1010110 0110001)
 Encryption:
Plaintext: 1001001 1000110
Key:
1010110 0110001
Ciphertext: 0011111 1110111
 Decryption:
Ciphertext: 0011111 1110111
Key:
1010110 0110001
Plaintext: 1001001 1000110

ONE-TIME PAD





An Army Signal Corp officer, Joseph Mauborgne, proposed
an improvement to Vernam cipher that yields the ultimate in
security
Mauborgne suggested using random key one time to
encrypt and decrypt a single message
Random key
Unbreakable
One-time pad is the only cryptosystem that is referred to as
perfect secrecy
Joseph Mauborgne was American General (February 26, 1881 – June 7,
1971) co-invented the one time pad with Gillbert Vernam in 1914
ONE-TIME PAD
Example
TRANSPOSITION TECHNIQUES

Rail fence
“meet me after the toga party”
SYMMETRIC CIPHER TECHNIQUES
•
Rotor machines
Hebern rotor machine
SYMMETRIC CIPHER TECHNIQUES
 Steganography
• Character marking
• Invisible ink
• Pin puncture
• Type writer correction ribbon
Thank you for your
attention