Lecture 1
Lecture 1
in an article of
William Friedman
(Office of the Chief Signal Officer
War dept. Washington, D.C.)
on Edgar Allan Poe written in
"American Literature" V 8, Nov 1936 pp 265-280
next
http://www.math.ucsd.edu/~alina/187/
next
CRYPTOGRAPHY
Cryptography: from greek kryptos ( ),
which may be translated into hidden or secret;
and graphen ( ), for writing.
Secret Writing
next
TEXTBOOKS?
There is no single textbook that contains all the
material that is presented in this class.
All classroom presentations will be posted in
the web in pdf form the day after the class.
There will also be lecture notes.
To access this material you will need a password.
For a historical view (with sensationalist elements) of cryptography you
may want to read:
The Codebreakers: The Comprehensive History of
Secret Communication from Ancient Times to the Internet
by David Kahn
Revised ed. New York: Scribner, 1996.
next
Cipher:
A method of secret writing.
next
CIPHER
OR CYPHER
?
cypher is British
cipher is American
next
Encipherment, Encryption:
The process of encoding plaintext into ciphertext.
Decipherment, Decryption:
The process of decoding ciphertext back into plaintext.
Encrypt, Decrypt:
These are the corresponding verbs.
next
Receiver:
The person which is to receive and decrypt
the message.
Opponent:
The person or organization which intercepts the message and
attempts the unauthorized decipherment.
next
ALICE
BOB
BOB
ALICE
from Wikipedia:
Opponent:
EVE
next
Key:
The information, usually a sequence of digits or symbols,
used to determine the algorithm by which plaintext is to be
transformed into ciphertext.
next
Key space:
The collection of all keys that may occur in a given
cryptographic system.
next
Code breaking:
The process by which a cryptographic system is made
vulnerable to cryptanalysis.
THE SET UP
In a typical cryptographic transaction the sender and receiver
choose a cryptographic system and, at some time before the message
is to be sent, the sender chooses the key. This determines
which transformation of the system will be used to
encrypt the message.
next
ASSUMPTIONS
Safe paths between sender and receiver do exist
though generally they maybe impractical to use
for the message itself
(for instance the path may require hand carrying by
an especially trusted messenger).
By necessity the path taken by the message itself
may have to be "unsafe".
ASSUMPTIONS
(classical Cryptography)
If the opponent's task consists
of reconstructing the key from an analysis of the
ciphertext,
then security is achieved by assuring that the key space
is too large for an exhaustive trial and error attack to be
practical.
Methods of Encryption
Substitution:
When individual letters or n-grams of plaintext are replaced
by letters or n-grams of ciphertext
Transposition:
When the characters or words of the original message are rearranged
according to some particular pattern.
SUBSTITUTION
C H U R C H Y A R D
next
ENCRYPTION
BY SUBSTITUTION
Plaintext
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
P V J W D C H T S K Z F N Q E Y O R I G A U M L X B
Ciphertext
next
TRANSPOSITION
THE PAST IS A PEBBLE IN
MY SHOE
next
Encryption by
transposition
1
T T L I N
TTIBAGLN
next
Cryptographic transactions
may be viewed as two-person games
between the sender-receiver on one side
and the opponent on the other side.
ALICE
BOB
EVE
This game may be played under different sets of rules.
next
Classical Cryptography:
A cryptographic transaction where the opponent
is allowed ciphertext-only or known-plaintext attacks.
Modern Cryptography:
Usually this refers to the game in which the opponent has access
to an unlimited amount of corresponding
plaintext-ciphertext pairs.
That is, the opponent is capable of chosen-plaintext attack.
This is achieved by the opponent having access
to all the encrypting transformations of the system.
Security is to be achieved through
secrecy of all the decrypting transformations.
next
COURSE OBJECTIVES
The analysis and decryption of cryptograms is more an art than a
science
which is very much like playing chess.
COURSE OVERVIEW
FIRST STAGE
Early ciphers:
Caesar shift
Vigenre
Rectangular transposition
Monoalphabetic substitution
Playfair
ADFGVX
Vernams two tape system
Affine ciphers
Hill Cipher
next
SECOND STAGE
Elements of probability and statistics
Probabilities and conditional probabilities
Expectation and conditional expectation
Dependence and independence
Statistical models of English text
Random number generators
The chi-square test
next
THIRD STAGE
Codebreaking
Breaking Vigenre
Breaking rectangular transposition
Breaking homophonic
Breaking affine
Breaking Hill
Breaking monoalphabetic substitution
Breaking ADFGVX
next
FOURTH STAGE
Information theory
Basics on the concept of information
Entropy and information
Fundamental identities
Redundancy and compression of text
Entropy of English text
File and text compression
The Huffman code
Perfect secrecy systems
next
FINAL STAGE
Modern cryptography
Euclidean algorithm
Chinese remainder theoorem
Residue systems
The Euler phi function
Primitive roots
Quadratic residues
Quadratic reciprocity law
The Jacobi symbol
Primality testing
The RSA scheme
Knapsack
Factoring large integers
The quadratic sieve
Public key systems
Discrete logarithms
Diffie-Hellman key exchange
The ElGamal public key cryptosystem
Elliptic curve cryptography
Zero-knowledge techniques
The DES (Data Encryption Standard)
next
EARLY CIPHERS
next
Described by
the greek
Historian
Plutarch
46-127
next
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
KHUH LV DQ HADPSOH
HERE IS AN EXAMPLE
next
next
next
next
Demotic script,
it permitted
Jean-Franois
Champollion,
in 1822
to decode
hieroglyphics.
next
Ancient Greek.
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
HERE IS AN EXAMPLE
LIVI MW ER IBEQTPI
next
RAGZP
QZFYO
PYEXN
OXDWM
NWCVL
MVBUK
LUATJ
KTZSI
JSYRH
IRXQG
HQWPF
GPVOE
FOUND
ENTMC
DMSLB
CLRKA
BKQJZ
AJPIY
ZIOHX
YHNGW
K
P
XGMFV
SBHAQ
WFLEU
M
R
VEKDT
UDJCS
TCIBR
RAGZP
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
M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
next
A cipher deemed
``unbreakable
Blaise de Vigenre
(1523-1596)
A poly-alphabetic substitution
next
G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
next
h
p
m
g
i
q
n
h
j
r
o
i
k
s
p
j
l
t
q
k
m
u
r
l
n
v
s
m
o
w
t
n
p
x
u
o
q
y
v
p
r
z
w
q
s
a
x
r
t
b
y
s
u
c
z
t
v
d
a
u
w
e
b
v
x
f
c
w
y
g
d
x
z
h
e
y
a
i
f
z
b
j
g
a
c
k
h
b
d
l
i
c
e
m
j
d
f
n
k
e
next
RECTANGULAR TRANSPOSITION
(ROW VERSION)
T H
BO
AR
MI
OR
E B
ON
E C
NG
YO
EATBH
A
S
O
F
U
EA
OS
EO
NF
YU
OSBNO EOACR
NFMGI
T
B
A
M
O
B
N
C
G
O
H
O
R
I
R
YUOOR
eat
bho
sbn
oeo
acr nfm
giy
uoo r
next
e(x) = ax + b (mod p)
-1
3 4
5 6
7 8
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
0 1 2 3 4 5 6 7 8 9 =
27 28 29 30 31 32 33 34 35 36 37
Modular Arithmetic
A=Bq+r
quotient
y = x (mod p)
-1
y = a
0r<B
remainder
y = p q + x 0x<p
ya=1
(mod p)
next
Since 2 and 13 are the prime factors of 26, then 13 and all even
next
numbers have no inverse mod 26
18
next