01 Intro v2 Annotated
01 Intro v2 Annotated
01 Intro v2 Annotated
1
8/8/2019
E, D: cipher k: secret key (e.g. 128 bits) Multi use key: (many time key)
m, c: plaintext, ciphertext • Key used to encrypt multiple messages
• encrypted files: same key used to encrypt many files
Encryption algorithm is publicly known • Need more machinery than for one-time key
• Never use a proprietary cipher
Dan Boneh Dan Boneh
Things to remember
Cryptography is:
– A tremendous tool
– The basis for many security mechanisms
End of Segment
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?
Secure communication: k m1
k
m2
confidentiality and integrity
Dan Boneh Dan Boneh
2
8/8/2019
But crypto can do much more But crypto can do much more
• Digital signatures • Digital signatures
Protocols Protocols
• Elections • Elections
• Private auctions • Private auctions
trusted
Goal: compute f(x1, x2, x3, x4) authority
“Thm:” anything that can done with trusted auth. can also
be done without
3
8/8/2019
Introduction
End of Segment
History
Few Historic Examples (all badly broken) Caesar Cipher (no key)
1. Substitution cipher
k :=
4
8/8/2019
What is the size of key space in the substitution cipher How to break a substitution cipher?
assuming 26 letters?
| | = 26 What is the most common letter in English text?
= 26! (26 factorial)
“X”
| |=2 “L”
“E”
| | = 26
“H”
5
8/8/2019
Introduction
End of Segment
Discrete Probability
(crash course, cont.)
6
8/8/2019
More generally:
Pr[ lsb2(x)=11 or msb2(x)=11 ] = Pr[A1∪A2] ≤ ¼+¼ = ½ rand. var. X induces a distribution on V: Pr[ X=v ] := Pr[ X-1(v) ]
Dan Boneh Dan Boneh
( formally, r is the identity function: r(x)=x for all x∈U ) Hint: Pr[X=2] = Pr[ r=11 ]
Randomized algorithms
inputs outputs
• Deterministic algorithm: y ⟵ A(m)
m
• Randomized algorithm
R
A(m)
End of Segment
y ⟵ A( m ; r ) where r ⟵ {0,1}n
R
Example: A(m ; k) = E(k, m) , y⟵ A( m )
Dan Boneh Dan Boneh
7
8/8/2019
8
8/8/2019
|U|=106
collision probability
End of Segment
# samples n
Dan Boneh Dan Boneh