The Shift Cipher Encryption example... The Shift Cipher Encryption example... “Security” The process of attempting to compute the key k, given a string of ciphertext y, is called cryptan
Trang 2• Douglas Stinson, Cryptography: Theory and Practice, 3rd, Chapman & Hall CRC, 2006.
– Chapter 1
Trang 3Secure communication scheme
Trang 4The set of integers modulo m:
Trang 5Lab computing: try operators + and * modulo
m in Python
Trang 6The Shift Cipher
Trang 7Caesar cipher (K = 3)
• x = “NGUYENTHANHNHUT”
• y = “QJXBHQWKDQKQKXW”
Trang 8The Shift Cipher Encryption example
Trang 9The Shift Cipher Encryption example
Trang 10The Shift Cipher Decryption example
ow Cryptool it! Cryptool it!
Trang 11Practical cryptosystems
1 Each encryption function ek and each decryption
function dk should be efficiently computable
2 An opponent, upon seeing a ciphertext string y,
should be unable to determine the key k that was
used, or the plaintext string x
“Security”
The process of attempting to compute the key k, given
a string of ciphertext y, is called cryptanalysis
Trang 12Security of the Shift cipher
• The Shift Cipher (modulo 26) is not secure.
• It can be cryptanalyzed by the obvious method
of exhaustive key search
– How many possible keys with the A Z alphabet?
“Secure” the keyspace should be very
large.
Trang 14The Substitution Cipher
Trang 15The Substitution Cipher
• The number of possible permutations is 26!,
which is more than 4*1026, a very large number
Trang 17Compute the Euler phi-function
Trang 18The multiplicative inverse modulo m
For m = 26:
Trang 19Exercise
Trang 20The Affine Cipher
Trang 21So the three ciphertext characters are 0, 23, and 6, which corresponds to the alphabetic string AXG
Trang 22Security of the Affine cipher
Trang 23Take a short break ☺☺
Trang 24The Vigenère Cipher
• Each key k is an alphabetic string of length m, called
a keyword
• The Vigenere Cipher encrypts m alphabetic characters
at a time
Trang 26Security of the Vigenere Cipher
• How many possible keywords of length m with the A Z alphabet.
Trang 27The Hill Cipher
Trang 28Try Python Matrix modulo n
Trang 29Try Cryptool it!
Trang 301.12
Trang 31• Think about the security of the Hill Cipher!
Take a short break ☺☺
Trang 32The Permutation Cipher
Trang 351.16
Trang 361.17
Trang 37The Permutation Cipher is a special case of the
Hill Cipher
Short break!
Trang 39Stream ciphers
• Periodic stream cipher with period d
– zi+d = zi for all i > 0.
– Vigenere is a periodic stream cipher with period m.
• Some basic stream cipher: (self-reading)
– Linear feedback shift register (LFSR)
Trang 40The Vigenère cipher is a stream cipher
• We define the keystrean as follow:
• This generate the keystream Short break!
Trang 41• The goal of the adversary/the opponent:
– Determine the key K
• General assumption (Kerckhoff’s principle):
– Oscar knows the cryptosystem being used.
• Four attack models:
Trang 42Basic tool for cryptanalysis
• Statistical properties of language (English)
– Beker and Piper partition
Trang 43Digrams and trigrams in English
• The 30 most common digrams
Trang 45Cryptanalysis of Affine Cipher
Trang 46• Big problem:
– Statistical properties of Vietnamese language
• Cryptanalyses of: (self-reading)
– Substitution Cipher
– Vigenere Cipher
– Hill Cipher
– LFSR Cipher