Lecture06 SP 2012
Lecture06 SP 2012
Intro to Cryptography
Tadayoshi Kohno
Thanks to Dan Boneh, Dieter Gollmann, Dan Halperin, John Manferdelli, John Mitchell,
Vitaly Shmatikov, Bennet Yee, and many others for sample slides and materials ...
Goals for Today
Cryptography
M M
Encapsulate Decapsulate
K K
Alice
Bob
K
K
Adversary
Asymmetric Setting
Each party creates a public key pk and a secret key sk.
M M
Encapsulate Decapsulate
pkB,skA pkA,skB
pkB
Alice
pkA,skA pkA Bob
pkB,skB
Adversary
Achieving Privacy (Symmetric)
Encryption schemes: A tool for protecting privacy.
M C M
Encrypt Decrypt
K K
Alice
Bob
K
Message . . . . . . . . . . M K
Ciphertext . . . . . . . C Adversary
Achieving Privacy (Asymmetric)
Encryption schemes: A tool for protecting privacy.
M C M
Encrypt Decrypt
pkB skB
pkB
Alice
pkA,skA pkA Bob
Message . . . . . . . . . . M pkB,skB
Ciphertext . . . . . . . C Adversary
Achieving Integrity (Symmetric)
Message authentication schemes: A tool for
protecting integrity.
(Also called message authentication codes or MACs.)
valid/
M T (M,T) invalid
MAC Verify
K K
Alice
Bob
K
Message . . . . . . . . . . M K
Tag . . . . . . . . . . . . . . . . T Adversary
Achieving Integrity (Asymmetric)
Digital signature schemes: A tool for protecting
integrity and authenticity.
valid/
M T (M,T) invalid
Sign Verify
skA pkA
pkB
Alice
pkA,skA pkA Bob
Message . . . . . . . . . . M pkB,skB
Tag . . . . . . . . . . . . . . . . T Adversary
“Random” Numbers
Pseudorandom Number Generators (PRNGs)
Machine State
Alice User Input
... Adversary
Getting keys: PBKDF
Password-based Key Derivation Functions
Password K
PBKDF
(Key check value)
Alice
Getting keys: CAs
Each party creates a public key pk and a secret key sk.
(Public keys signed by a trusted third party: a certificate
authority.)
M M
Encapsulate Decapsulate
pkB,skA pkA,skB
Alice
Bob
pkA,skA
pkB,skB
pkB, sign(skCA,B,pkB) pkA, sign(skCA, A, pkA)
Adversary
Getting keys: Key exchange
Key exchange protocols: A tool for establishing a
shared symmetric key from public keys
K K
K.E. K.E.
pkB,skA pkA,skB
pkB
Alice
pkA,skA pkA Bob
pkB,skB
Adversary
One-way Communications
PGP is a good example
• Asymmetric cryptography
• Everyone has a public key that everyone else knows;
and a paired secret key that is private
• Public key can encrypt; only secret key can decrypt
• Secret key can sign/MAC, public key can verify
• Computationally expensive
• Challenge: How do you validate a public key?
Checkpoint
• Where are public keys from?
• One solution: keys for Certificate
Authorities a priori known by browser, OS,
etc.
• Where are shared keys from?
• In person exchange, snail mail, etc.
• If we have verifiable public/private keys:
key exchange protocol generates a shared
key for symmetric cryptography
How cryptosystems work today
Layered approach:
• Cryptographic primitives, like block ciphers, stream ciphers,
hash functions, and one-way trapdoor permutations
• Cryptographic protocols, like CBC mode encryption, CTR mode
encryption, HMAC message authentication
Public algorithms (Kerckhoff’s Principle)
Security proofs based on assumptions (not this course)
From http://en.wikipedia.org/wiki/Letter_frequencies
Attack Scenarios for Encryption
Ciphertext-Only
Known Plaintext
Chosen Plaintext
Chosen Ciphertext (and Chosen Plaintext)
encrypt(key,PIN)
key
key
Crook #2 eavesdrops
Crook #1 changes on the wire and learns
his PIN to a number ciphertext corresponding
of his choice to chosen plaintext PIN
----- 10111101…
-----
----- = 10111101…
⊕ 10001111… ⊕
= 00110010… 00110010… =
----- 10111101…
-----
----- = 10111101…
⊕ 10001111… ⊕
= 00110010… 00110010… =
0
----- 10111101…
-----
----- = 10111101… 0
⊕ 10001111… ⊕
= 00110010… 00110010… =