Lecture 1-Overview of Cryptography
Lecture 1-Overview of Cryptography
CSE-411 Cryptography
Instructor : Dr. Ahmed Gomaa
Fall, 2024
GENERAL INFORMATION
Level Under-Graduate
Pre-requisites MTH 211 + CSE 312 ( Probability and Statistics + Discrete Mathematics).
Schedule
Thursday 10:45 – 12:15 pm , Office Hours : TBD
Attendance Policy A minimum of 75% attendance is expected.
Disclaimer Slides throughout the course are based on the textbooks above and some slides will be
modified from the slides made available by the above mentioned textbook publishers &
authors.
Course objectives:
• Learn how crypto primitives work
• Learn how to use them correctly and reason about security
My recommendations:
• Take notes
Course goals
Secure communication:
– web traffic: HTTPS
– wireless traffic: 802.11i WPA2 (and WEP), GSM, Bluetooth
User authentication
no eavesdropping
no tampering
Secure Sockets Layer / TLS
No eavesdropping
No tampering
File 2
k k
Cryptography is:
– A tremendous tool
– The basis for many security mechanisms
Cryptography is not:
– The solution to all security problems
– Reliable unless implemented and used properly
– Something you should try to invent yourself
• many many examples of broken ad-hoc designs
What is cryptography?
Crypto core Talking to
Talking to
Alice
Bob
attacker???
Secure communication: k m1
k
m2
confidentiality and integrity
But crypto can do much more
• Digital signatures
• Anonymous communication
Alice
Who did I signature
just talk to?
Alice
Bob
But crypto can do much more
• Digital signatures
• Anonymous communication
E[ results ]
results
• Propose a construction
• I.e., encryption
Classical cryptography
Private-key cryptography
– aka secret-key / shared-key / symmetric-key cryptography
Private-key encryption
key key
ciphertext
c
k k
m
c Enck(m) message/plaintext m := Deck(c)
decryption
encryption
Private-key encryption
k
c
m
c := Enck(m)
c
c
k
m := Deck(c)
Private-key encryption
• k K = {0, …, 25}
• To encrypt using key k, shift every letter of the plaintext by k
positions (with wraparound)
• Decryption just does thehelloworldz
reverse
ccccccccccc
jgnnqyqtnfb
Modular arithmetic
• 25 = 35 mod 10
• 25 ≠ [35 mod 10]
• 5 = [35 mod 10]
The shift cipher, formally
• Ciphertext uryybjbeyq
• Try every possible key…
– tqxxaiadxp
– spwwzhzcwo
–…
– helloworld
Symmetric Ciphers
Few Historic Examples (all badly broken)
1. Substitution cipher
Caesar Cipher (no key)
What is the size of key space in the substitution cipher assuming 26 letters?
|𝒦| = 26
|𝒦| = 226
|𝒦| = 262
How to break a substitution cipher?
“X”
“L”
“E”
“H”
How to break a substitution cipher?
UKBYBIPOUZBCUFEEBORUKBYBHOBBRFESPVKBWFOFERVNBCVBZPRUBOFERVNBCVBPCYYFVUFOF
EIKNWFRFIKJNUPWRFIPOUNVNIPUBRNCUKBEFWWFDNCHXCYBOHOPYXPUBNCUBOYNRVNIWNC
POJIOFHOPZRVFZIXUBORJRUBZRBCHNCBBONCHRJZSFWNVRJRUBZRPCYZPUKBZPUNVPWPCYVFZI
XUPUNFCPWRVNBCVBRPYYNUNFCPWWJUKBYBIPOUZBCUIPOUNVNIPUBRNCHOPYXPUBNCUBOY
NRVNIWNCPOJIOFHOPZRNCRVNBCUNENVVFZIXUNCHPCYVFZIXUPUNFCPWZPUKBZPUNVR
B 36 E NC 11 IN UKB 6 THE
N 34 PU 10 AT RVN 6
U 33 T UB 10 FZI 4
P 32 A UN 9 trigrams
C 26 digrams
2. Rotor Machines (1870-1943)
A K E N
B S K E
C T S K
. . T S
. . . T
X R . .
Y N R .
Z key E N R
Rotor Machines (cont.)
• Cryptography is ubiquitous!
– Password-based authentication, password hashing
– Secure credit-card transactions over the internet
– Encrypted WiFi
– Disk encryption
– Digitally signed software updates
– Bitcoin
–…
Rough course outline
Secrecy Integrity
Private-key setting Private-key Message
encryption authentication codes
Public-key setting Public-key Digital signatures
encryption
• Building blocks
– Pseudorandom (number) generators
– Pseudorandom functions/block ciphers
– Hash functions
– Number theory
Discrete Probability
U: finite set (e.g. U = {0,1}n )
note: Pr[U]=1
• The set A is called an event
The union bound
A1
A2
Random Variables
More generally:
rand. var. X induces a distribution on V: Pr[ X=v ] := Pr[ X-1(v) ]
The uniform random variable
Then Pr[X=2] = ¼
• Randomized algorithm m
A(m)
y ⟵ A( m ; r ) where r ⟵ {0,1} n
R
2
Example: U = {0,1} = {00, 01, 10, 11} and r⟵
R
U