C1-Cryptography Overview
C1-Cryptography Overview
Nguyen Phi Le
About this course
n Materials
q slides
n Evaluation
q Project + exercises: (30%)
q final exam: writing exam (70%)
n Contents
q Cryptography foundation
n Ciphers
n Cryptography protocols
q Security applications
n Digital signature
n Network security
Cryptography I
n Basic concepts
n Attack models
n Classic ciphers: mono-alphabetic
n Vigenere cipher
n One-time-pad cipher
Security Goals
n Cryptography
n Software controls
n Hardware controls
n Policies and procedures
n Physical controls
What is Crypto?
Y=EZ(X) Y X=DZ’(Y)
Sender Alice Receiver Bob
n Ciphertext-only attack:
q The cryptanalyst knows only the ciphertext.
q Goal: to find the plaintext and the key.
q NOTE: such vulnerable is seen completely insecure
n Known-plaintext attack:
q The cryptanalyst knows one or several pairs of
ciphertext and the corresponding plaintext.
q Goal: to find the key used to encrypt these messages
n or a way to decrypt any new messages that use the same key
(although may not know the key).
Breaking ciphers …
n Chosen-plaintext attack
q The cryptanalyst can choose a number of messages and
obtain the ciphertexts for them
q Goal: deduce the key used in the other encrypted
messages or decrypt any new messages (using that key).
n Chosen-ciphertext attack
q Similar to above, but the cryptanalyst can choose a
number of ciphertexts and obtain the plaintexts.
n Both can be adaptive
q The choice of ciphertext may depend on the plaintext
received from previous requests.
Classic ciphers
Shift cipher (additive cipher)
n Key Space: [1 .. 25]
n Encryption given a key K:
q each letter in the plaintext P is replaced with the K’th letter
following corresponding number (shift right):
q Another way: Y=X Å K è additive cipher
n Decryption given K:
q shift left
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
P = CRYPTOGRAPHYISFUN
K = 11
C = NCJAVZRCLASJTDQFY
Shift Cipher: Cryptanalysis
n Example:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
π=BADCZHWYGOQXSVTRNMSKJIPFEU
BECAUSE → AZDBJSZ
Looks secure, early days
𝑝! 𝑝" …… 𝑝# 𝑐! 𝑐" …… 𝑐#
𝑝#$! 𝑝#$" …… 𝑝"# 𝑐#$! 𝑐#$" …… 𝑐"#
. .
. .
. .
𝑝%#$! 𝑝%#$" …… 𝑐%#$! 𝑐%#$" ……
+𝑘!
+𝑘!
n Kasiski method
q Search the cipher text for pairs of identical
segments and record the distance between their
starting positions
n Suppose the obtained distances are 𝛿! , … , 𝛿%
q Then, 𝑚 should divides the greatest common
divisor of 𝛿% , … , 𝛿$
Vigenère cipher
n Example
Vigenère cipher
n Example
Kasiski method: CHR’s occurrence positions: 1, 166, 236, 276 and 286
à Distances: 165, 235, 275 and 285
à Gcd(165, 235, 275, 285) = 5
à The key length should divides 5
Vigenère cipher
n Example
𝑝" 𝑓"(#
&'
𝑀# = ,
"$% 𝑛′
The almond tree was in tentative blossom. The days were longer,
often ending with magnificent evenings of corrugated pink skies.
𝐾 = 9, 0, 13, 4, 19 = 𝐽𝐴𝑁𝐸𝑇 The hunting season was over, with hounds and guns put away for
six months. The vineyards were busy again as the well-organized
farmers treated their vines and the more lackadaisical neighbors
hurried to do the pruning they should have done in November.
Exercises
n Decode the following cipher texts
q Encrypted by shift cipher:
n JBCRCLQRWCRVNBJENBWRWN
q Encrypted by substitution cipher:
n Pjmu mu b amtjfo rfsr. Mr jbu cffi fiaowtrfg cw rjf uvcurmrvrmqi amtjfo. Wqv
bof xfow nvahw. Rjf amtjfo jbu cffi coqhfi
n YIFQFMZRWQFYVECFMDZPCVMRZWNMDZVEJBTXCDDUMJ
NDIFEFMDZCDMQZKCEYFCJMYRNCWJCSZREXCHZUNMXZ
NZUCDRJXYYSMRTMEYIFZWDYVZVYFZUMRZCRWNZDZJJ
XZWGCHSMRNMDHNCMFQCHZJMXJZWIEJYUCFWDJNZDIR
n Hints:
q The letters in the English alphabet can be divided into 5 groups of similar frequencies
§ e
§ t,a,o,i,n,s,h,r
§ d,l
§ c,u,m,w,f,g,y,p,b
§ v,k,j,x,q,z
q Some frequently appearing bigrams or trigrams
§ Th, he, in, an, re, ed, on, es, st, en at, to
§ The, ing, and, hex, ent, tha, nth, was eth, for, dth.
Exercises
n Decode the following cipher texts
q Encrypted by substitution cipher:
YIFQFMZRWQFYVECFMDZPCVMRZWNMDZVEJBTXCDDUMJ
NDIFEFMDZCDMQZKCEYFCJMYRNCWJCSZREXCHZUNMXZ
NZUCDRJXYYSMRTMEYIFZWDYVZVYFZUMRZCRWNZDZJJ
XZWGCHSMRNMDHNCMFQCHZJMXJZWIEJYUCFWDJNZDIR