Professional Documents
Culture Documents
Network Security
Chapter 2
Fourth Edition
by William Stallings
CRYPTOLOGY
Definition:
Cryptology : from the Greek
Crypto meaning secret or hidden, and
ology meaning theory, or science
Symmetric Encryption
or conventional /
private-key / single-key
sender and recipient share a common key
all classical encryption algorithms are
private-key
was only type prior to invention of publickey in 1970s
and by far most widely used
Requirements
two requirements for secure use
of
(conventional) symmetric encryption:
mathematically have:
C = EK(P)
P = DK(C)
assume encryption algorithm
is known
implies a secure channel to distribute key
Cryptography
Cryptanalysis
objective to recover key not just message
general approaches:
cryptanalytic attack
brute-force attack
Cryptanalytic Attacks
ciphertext only
known plaintext
chosen plaintext
chosen ciphertext
chosen text
More Definitions
unconditional security
computational security
KeySize(bits)
NumberofAlternative
Keys
Timerequiredat1
decryption/s
Timerequiredat106
decryptions/s
32
232=4.3109
231s
=35.8minutes
2.15milliseconds
56
256=7.21016
255s
=1142years
10.01hours
128
2128=3.41038
2127s
=5.41024years
5.41018years
168
2168=3.71050
2167s
=5.91036years
5.91030years
26!=41026
21026s =6.41012years
6.4106years
26characters
(permutation)
Classical Substitution
Ciphers
where
Types of Ciphers
The Playfair cipher is an example of this type of cipher and was used by the British in World
War One.
Caesar Cipher
earliest known substitution cipher
by Julius Caesar
first attested use in military affairs
replaces each letter by 3rd letter on
example:
meetmeafterthetogaparty
PHHWPHDIWHUWKHWRJDSDUWB
Caesar Cipher
can define transformation as:
abcdefghijklmnopqrstuvwxyz
DEFGHIJKLMNOPQRSTUVWXYZABC
Cryptanalysis of Caesar
Cipher
only have 26 possible ciphers
A maps to A,B,..Z
brute force
search
given ciphertext, just try all shifts of letters
do need to recognize when have plaintext
eg. break ciphertext "GCUA VQ DTGCM"
are known
There are only 25 keys to try (25 different
k values)
The language of plaintext is known and
easily recognizable
Monoalphabetic Cipher
Monoalphabetic Cipher
Security
now have a total of 26! = 4 x 1026 keys
with so many keys, might think is secure
but would be
!!!WRONG!!!
problem is language characteristics
followed by T,R,N,I,O,A,S
Use in Cryptanalysis
Example Cryptanalysis
given ciphertext:
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
Playfair Cipher
not even the large number of keys in a
I/J
3.
4.
Playfair Example
Use the following table:
C
E
G
O
V
H
S
I/J
P
W
A
B
K
Q
X
R
D
M
T
Y
L
F
N
U
Z
Playfair Example
TH ES CH EM ER EA LX LY WO RK SX
TH -> PR
ES -> SB
CH -> HA
EM -> DG
ER -> DC
EA -> BC
LX -> AZ
LY -> RZ
WO -> VP
RK -> AM
SX -> BW
C
E
G
O
V
H
S
I/J
P
W
A
B
K
Q
X
R
D
M
T
Y
L
F
N
U
Z
Hill Cipher
The Hill Cipher uses matrix
05
12
5 12 5
100
7
22 mod 26
16
mod 26
10
Polyalphabetic Ciphers
Vigenre Cipher
simplest polyalphabetic substitution cipher
effectively multiple caesar ciphers
key is multiple letters long K = k 1
k2 ... kd
ith letter specifies ith alphabet to use
use each alphabet in turn
repeat from start after d letters in message
decryption simply works in reverse
THISPROCESSCANALSOBEEXPRESSED
CIPHERCIPHERCIPHERCIPHERCIPHE
VPXZTIQKTZWTCVPSWFDMTETIGAHLH
Vigenre Cipher
ABCDEFGHIJKLMNOPQRSTUVWXYZ
A ABCDEFGHIJKLMNOPQRSTUVWXYZ
B BCDEFGHIJKLMNOPQRSTUVWXYZA
C CDEFGHIJKLMNOPQRSTUVWXYZAB
D DEFGHIJKLMNOPQRSTUVWXYZABC
E EFGHIJKLMNOPQRSTUVWXYZABCD
F FGHIJKLMNOPQRSTUVWXYZABCDE
G GHIJKLMNOPQRSTUVWXYZABCDEF
H HIJKLMNOPQRSTUVWXYZABCDEFG
I IJKLMNOPQRSTUVWXYZABCDEFGH
J JKLMNOPQRSTUVWXYZABCDEFGHI
K KLMNOPQRSTUVWXYZABCDEFGHIJ
L LMNOPQRSTUVWXYZABCDEFGHIJK
M MNOPQRSTUVWXYZABCDEFGHIJKL
N NOPQRSTUVWXYZABCDEFGHIJKLM
O OPQRSTUVWXYZABCDEFGHIJKLMN
P PQRSTUVWXYZABCDEFGHIJKLMNO
Q QRSTUVWXYZABCDEFGHIJKLMNOP
R RSTUVWXYZABCDEFGHIJKLMNOPQ
S STUVWXYZABCDEFGHIJKLMNOPQR
T TUVWXYZABCDEFGHIJKLMNOPQRS
U UVWXYZABCDEFGHIJKLMNOPQRST
V VWXYZABCDEFGHIJKLMNOPQRSTU
W WXYZABCDEFGHIJKLMNOPQRSTUV
X XYZABCDEFGHIJKLMNOPQRSTUVW
Y YZABCDEFGHIJKLMNOPQRSTUVWX
Z ZABCDEFGHIJKLMNOPQRSTUVWXY
Vigenre Cipher
By using math. Equation:
THISPROCESSCANALSOBEEXPRESSED
CIPHERCIPHERCIPHERCIPHERCIPHE
VPXZTIQKTZWTCVPSWFDMTETIGAHLH
plaintext letter
hence letter frequencies are obscured
but not totally lost
start with letter frequencies
Kasiski Method
Autokey Cipher
AHMD
3- 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
ABGLQUYHCINR VZMEJ OSWDF KPTX
4- M= BE OR NOT TO BE
C= BQ JO ZMW WM BQ
One-Time Pad
A B C D E F G H I J K L M N O P Q R S
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
T U VW X Y Z
20 21 22 23 24 25 26
Step 1:
HLMSEZRBHPSJOTDW
To make the key easier to work with, break it into blocks of two
characters each, thus
HL MS EZ RB HP SJ OT DW
Now use the conversion table shown above to convert the
alphabet characters into numbers. For example H=08 and L=12,
so the first block HL becomes 0812.
The result is 0812 1319 0526 1802 0816 1910 1520 0423.
(The key)
Guidelines...
Rule 1 Numbers. Spell out all numbers in full in your
plaintext. For example, 365 becomes THREE SIX FIVE.
Rule 2 Negatives. Always add emphasis to the word NOT
in your plaintext. For example, you would write AGENT ALPHA
NOT RPT NOT AVAILABLE FOR MEETING TUESDAY, where
RPT stands for REPEAT.
Rule 3 Punctuation. Use an X for each period in your
plaintext. For example, MESSAGE RECEIVEDX SEND MORE
INFOX. All other punctuation must be written out in full. For
example, COMMA.
Rule 4 Termination. End your plaintext with XX. If
necessary, add dummy characters after XX in order to pad out
the message to frustrate cryptanalysis and to conclude on a
doublet (ensuring the numeric string ends with four digits).
Transposition Ciphers
now consider classical
transposition or
permutation ciphers
these hide the message by rearranging
the letter order
without altering the actual letters used
can recognise these since have the same
frequency distribution as the original text
giving ciphertext
MEMATRHTGPRYETEFETEOAAT
Key:4312567
Plaintext:attackp
ostpone
duntilt
woamxyz
Ciphertext:TTNAAPTMTSUOAODWCOIXKNLYPETZ
Product Ciphers
Rotor Machines
Steganography
an alternative to encryption
hides existence of message
has drawbacks
http://
www.ise.gmu.edu/~njohnson/Steganography
http://
www.rhetoric.umn.edu/Rhetoric/misc/dfrank/s
tegsoft.html
http://www.topology.org/crypto.html
Summary
have considered: