Cryptography
By:
Dr. Mohammad Shoab
Week 2
Symmetric Encryption
2
Cryptography
Department of Computer Science
Some Basic Terminology
3
Cryptography
Department of Computer Science
Symmetric Cipher Model
4
Cryptography
Department of Computer Science
Requirements
Y = E(K, X)
X = D(K, Y)
5
Cryptography
Department of Computer Science
Cryptography
6
Cryptography
Department of Computer Science
Cryptanalysis
7
Cryptography
Department of Computer Science
Cryptanalytic Attacks
8
Cryptography
Department of Computer Science
More Definitions
9
Cryptography
Department of Computer Science
Brute Force Search
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 characters (permutation) | 26! = 4 × 1026 | 2 × 1026 µs = 6.4 × 1012 years | 6.4 × 106 years |
10
Cryptography
Department of Computer Science
Classical Substitution Ciphers
11
Cryptography
Department of Computer Science
Caesar Cipher
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
12
Cryptography
Department of Computer Science
Caesar Cipher
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 J K L M N O P Q R S T U V W X Y Z A B C
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
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
c = E(k, p) = (p + k) mod (26)
p = D(k, c) = (c – k) mod (26)
13
Cryptography
Department of Computer Science
Cryptanalysis of Caesar Cipher
14
Cryptography
Department of Computer Science
Monoalphabetic Cipher
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
15
Cryptography
Department of Computer Science
Monoalphabetic Cipher Security
16
Cryptography
Department of Computer Science
Language Redundancy and Cryptanalysis
17
Cryptography
Department of Computer Science
English Letter Frequencies
18
Cryptography
Department of Computer Science
Use in Cryptanalysis
19
Cryptography
Department of Computer Science
Example Cryptanalysis
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
it was disclosed yesterday that several informal but
direct contacts have been made with political
representatives of the viet cong in moscow
20
Cryptography
Department of Computer Science
Playfair Cipher
21
Cryptography
Department of Computer Science
Playfair Key Matrix
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 |
22
Cryptography
Department of Computer Science
Encrypting and Decrypting
23
Cryptography
Department of Computer Science
Security of Playfair Cipher
24
Cryptography
Department of Computer Science
Polyalphabetic Ciphers
25
Cryptography
Department of Computer Science
Vigenère Cipher
26
Cryptography
Department of Computer Science
Example of Vigenère Cipher
key: deceptivedeceptivedeceptive
plaintext: wearediscoveredsaveyourself
ciphertext:ZICVTWQNGRZGVTWAVZHCQYGLMGJ
27
Cryptography
Department of Computer Science
Security of Vigenère Ciphers
28
Cryptography
Department of Computer Science
Kasiski Method
29
Cryptography
Department of Computer Science
Autokey Cipher
key: deceptivewearediscoveredsav
plaintext: wearediscoveredsaveyourself
ciphertext:ZICVTWQNGKZEIIGASXSTSLVVWLA
30
Cryptography
Department of Computer Science
Vernam Cipher
31
Cryptography
Department of Computer Science
One-Time Pad
32
Cryptography
Department of Computer Science
Transposition Ciphers
33
Cryptography
Department of Computer Science
Rail Fence cipher
m e m a t r h t g p r y
e t e f e t e o a a t
MEMATRHTGPRYETEFETEOAAT
34
Cryptography
Department of Computer Science
Row Transposition Ciphers
Key: 4312567
Column Out 3 4 2 1 5 6 7
Plaintext: a t t a c k p
o s t p o n e
d u n t i l t
w o a m x y z
Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ
35
Cryptography
Department of Computer Science
Product Ciphers
36
Cryptography
Department of Computer Science
Rotor Machines
37
Cryptography
Department of Computer Science
Hagelin Rotor Machine
38
Cryptography
Department of Computer Science
Rotor Machine Principles
39
Cryptography
Department of Computer Science
Steganography
40
Cryptography
Department of Computer Science
The End
41
Cryptography
Department of Computer Science
Exercise
Q1. What is symmetric encryption?
Q2. What are the requirements of symmetric encryption?
Q3. Explain cryptography and cryptanalysis.
Q4. Explain unconditional security and computational security.
Q5. What is a monoalphabetic cipher? Explain it’s security.
Q6. Explain Playfair cipher with it’s matrix.
Q7. What is a polyalphabetic cipher?
Q8. Explain Vigenere cipher.
Q9. What is Kasiski method?
Q10. What is Vernam cipher?
Q11. What is Steganography?
42
Cryptography
Department of Computer Science
Q12. In which encryption sender and recipient share a common key?
Q13. Converting plaintext to ciphertext is called.
Q14. Recovering ciphertext from plaintext is called.
Cryptography
Department of Computer Science
Q15. Human languages are.
Q16. If a truly random key as long as the message is used, the cipher will be?
Cryptography
Department of Computer Science