Lecture 04
Lecture 04
2
Basic Terminology
• Plaintext - The original message
3
Basic Terminology
• Decipher (Decrypt) - Recovering plaintext from
ciphertext
5
6
Conventional Encryption
Principles
• An encryption scheme has five ingredients:
1. Plaintext
2. Encryption algorithm
3. Secret Key
4. Ciphertext
5. Decryption algorithm
7
8
Symmetric Encryption
• Or conventional/private-key/single-key
9
10
11
12
13
Symmetric Cipher Model
14
Requirements
• Two requirements for secure use of symmetric encryption:
– A strong Encryption Algorithm
Y = EK(X)
– Assumes encryption algorithm is known
X = DK(Y)
• Implies a secure channel to distribute key
15
16
17
18
Cryptography Dimensions
• Classified along three independent dimensions:
• Block / Stream
19
Cryptanalysis
• Two general approaches to attack an encryption scheme
1.Cryptanalysis
• Needs encryption algorithm plus some knowledge regarding
the plaintext or some sample plaintext-ciphertext pair
2. Brute-Force attack
• Attacker tries every possible key to decrypt.
20
Types of Cryptanalytic Attacks
• Ciphertext only
– Attacker only knows the encryption algorithm & ciphertext
• Known Plaintext
– Knows the encryption algorithm & ciphertext
• Chosen Plaintext
– Attacker selects plaintext and obtains ciphertext to attack cipher
21
Types of Cryptanalytic Attacks
• Chosen Ciphertext
– Select ciphertext and obtain plaintext to attack cipher
• Chosen Text
– Select either plaintext or ciphertext to en/decrypt to attack
cipher
22
Model of Symmetric
Cryptosystem
23
Computational vs. Unconditional
Security
• Unconditional Security
• Computational Security
24
Classical Substitution
Ciphers
25
Substitution Ciphers
• Monoalphabetic cipher
– Caesar cipher
• Polyalphabetic cipher
– Vigenère cipher
• Multiple letter cipher
– Playfair cipher
26
Caesar Cipher
• Earliest known substitution cipher
• By Julius Caesar
• First attested use in military affairs
• Suppose Key is 3 , so Replaces each
letter by 3rd letter of alphabets in
plaintext to get cipher text.
• Example:
Plaintext: meet me after the toga party
Ciphertext: PHHW PH DIWHU WKH WRJD SDUWB
27
Caesar Cipher
• Can define transformation as:
28
Caesar Cipher
• Then we can generalize Caesar cipher as:
• Where:
p : letter to be converted into ciphertext
k : offset e.g., 3 as in our example
C : ciphertext
29
• https://www.boxentriq.com/code-br
eaking/caesar-cipher
30
Cryptanalysis of Caesar
Cipher
• Only have 26 possible ciphers
– A maps to A,B,..Z
• Could simply try each in turn i.e., using
a brute force search
• Given ciphertext, just try all shifts of
letters
31
Brute Force Search
• Always possible to simply try every key
• Most basic attack, proportional to key size
• Assume either know / recognise plaintext
32
Brute-Force
Cryptanalysi
s of Caesar
Cipher
33
Cryptanalysis of Caesar
Cipher
• Do need to recognize when have
plaintext
• eg. break ciphertext “KHOOR ZRUOG“
HELLO WORLD
-3
KHOOR ZRUOG
34
Compressed Plaintext
• The input may be abbreviated or
compressed
• Encrypted using simple substitution,
decrypting is not simple as plaintext is
not understandable
35
Sample of Compressed
Text
36