Fall 2016 Ada (Adam) Lerner lerner@cs.washington.edu
Thanks to Franzi Roesner, Dan Boneh, Dieter Gollmann, Dan Halperin, Yoshi Kohno, John Manferdelli, John Mitchell, Vitaly Shmatikov, Bennet Yee, and many others for sample slides and materials ...
Cryptography: Hash Functions, MACs (finish) Asymmetric Cryptography - - PowerPoint PPT Presentation
CSE 484 / CSE M 584: Computer Security and Privacy Cryptography: Hash Functions, MACs (finish) Asymmetric Cryptography (start) Fall 2016 Ada (Adam) Lerner lerner@cs.washington.edu Thanks to Franzi Roesner, Dan Boneh, Dieter Gollmann, Dan
Thanks to Franzi Roesner, Dan Boneh, Dieter Gollmann, Dan Halperin, Yoshi Kohno, John Manferdelli, John Mitchell, Vitaly Shmatikov, Bennet Yee, and many others for sample slides and materials ...
10/28/16 CSE 484 / CSE M 584 - Fall 2016 2
10/28/16 CSE 484 / CSE M 584 - Fall 2016 3
bit strings of any length n-bit bit strings
– Collision: h(x)=h(x’) for distinct inputs x, x’
– Every bit (almost) equally likely to be 0 or 1
message “digest”
message
10/28/16 CSE 484 / CSE M 584 - Fall 2016 4
10/28/16 CSE 484 / CSE M 584 - Fall 2016 5
10/28/16 CSE 484 / CSE M 584 - Fall 2016 6
10/28/16 CSE 484 / CSE M 584 - Fall 2016 7
10/28/16 CSE 484 / CSE M 584 - Fall 2016 8
10/28/16 CSE 484 / CSE M 584 - Fall 2016 9
10/28/16 CSE 484 / CSE M 584 - Fall 2016 10
10/28/16 CSE 484 / CSE M 584 - Fall 2016 11
10/28/16 CSE 484 / CSE M 584 - Fall 2016 12
10/28/16 CSE 484 / CSE M 584 - Fall 2016 13
10/28/16 CSE 484 / CSE M 584 - Fall 2016 14
10/28/16 CSE 484 / CSE M 584 - Fall 2016 15
10/28/16 CSE 484 / CSE M 584 - Fall 2016 16
10/28/16 CSE 484 / CSE M 584 - Fall 2016 17
10/28/16 CSE 484 / CSE M 584 - Fall 2016 18
10/28/16 CSE 484 / CSE M 584 - Fall 2016 19
10/28/16 CSE 484 / CSE M 584 - Fall 2016 20
goodFile
VIRUS
badFile
The NYTimes
hash(goodFile)
– Alice wants to bid B, sends H(B), later reveals B – One-wayness: rival bidders should not recover B (this may mean that she needs to hash some randomness with B too) – Collision resistance: Alice should not be able to change her mind to bid B’ such that H(B)=H(B’)
10/28/16 CSE 484 / CSE M 584 - Fall 2016 21
– 128-bit output – Designed by Ron Rivest, used very widely – Collision-resistance broken (summer of 2004)
– 160-bit variant of MD5
– 160-bit output – US government (NIST) standard as of 1993-95 – Also recently broken! (Theoretically -- not practical.)
10/28/16 CSE 484 / CSE M 584 - Fall 2016 22
10/28/16 CSE 484 / CSE M 584 - Fall 2016 23
Against padding attacks Split message into 512-bit blocks
Compression function
and current 160-bit buffer
160-bit buffer (5 registers) initialized with magic values
10/28/16 CSE 484 / CSE M 584 - Fall 2016 24
10/28/16 CSE 484 / CSE M 584 - Fall 2016 25
KEY KEY
message
MAC: message authentication code
(sometimes called a “tag”)
message, MAC(KEY,message) = ? Recomputes MAC and verifies whether it is equal to the MAC attached to the message
10/28/16 CSE 484 / CSE M 584 - Fall 2016 26
10/28/16 CSE 484 / CSE M 584 - Fall 2016 27
Embedded hash function “Black box”: can use this HMAC construction with any hash function
Block size of embedded hash function Secret key padded to block size magic value (flips half of key bits) another magic value
(flips different key bits)
hash(key,hash(key,message))
– Obvious approach: Encrypt-and-MAC – Problem: MAC is deterministic! same plaintext à same MAC
10/28/16 CSE 484 / CSE M 584 - Fall 2016 28
M2 C’2 EncryptKe T2 MACKm M1 C’1 EncryptKe T1 M3 C’3 EncryptKe T3 DON’T FIRE FIRE FIRE FIRE FIRE MACKm MACKm T1 T3
10/28/16 CSE 484 / CSE M 584 - Fall 2016 29
EncryptKe
MACKm
Ciphertext C
10/28/16 CSE 484 / CSE M 584 - Fall 2016 30
– Lots of heuristic arguments
(and reversible) describing the whole process (cryptographic weakness).
Especially non-linear mixing, e.g., S-boxes. – Some math gives us confidence in these assumptions
10/28/16 CSE 484 / CSE M 584 - Fall 2016 31
10/28/16 CSE 484 / CSE M 584 - Fall 2016 32
private key
public key public key
Alice Bob
10/28/16 CSE 484 / CSE M 584 - Fall 2016 33
10/28/16 CSE 484 / CSE M 584 - Fall 2016 34
10/28/16 CSE 484 / CSE M 584 - Fall 2016 35
10/28/16 CSE 484 / CSE M 584 - Fall 2016 36
10/28/16 CSE 484 / CSE M 584 - Fall 2016 37
Alice Bob
10/28/16 CSE 484 / CSE M 584 - Fall 2016 38
[from Wikipedia]