/
Cryptography Lecture Cryptography Lecture

Cryptography Lecture - PowerPoint Presentation

giovanna-bartolotta
giovanna-bartolotta . @giovanna-bartolotta
Follow
344 views
Uploaded On 2019-11-20

Cryptography Lecture - PPT Presentation

Cryptography Lecture 14 Hash functions Q and A b ring the written answers to TA before the class 1 Write down and remember the syntax and security definition ID: 766082

collision hash function functions hash collision functions function mac length sha block bit messages cipher probability birthday people output

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Cryptography Lecture" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Cryptography Lecture 14

Hash functions

Q and A; bring the written answers to TA before the class 1. Write down and remember the syntax and security definition of hash function 2. Write down the hash-and-mac construction (construction 5.5) and its theorem 3. (No need to write down) Carefully go over $5.4.1; go over the slide for lecture 12

Hash functions (Cryptographic) hash function: deterministic function mapping arbitrary length inputs to a short, fixed-length output (sometimes called a digest )Hash functions can be keyed or unkeyedIn practice, hash functions are unkeyedWe will assume unkeyed hash functions for simplicity

Collision-resistance Let H: {0,1} *  {0,1}l be a hash functionA collision is a pair of distinct inputs x, x’ such that H(x) = H(x’)H is collision-resistant if it is infeasible to find a collision in H

Generic hash-function attacks What is the best “generic” collision attack on a hash function H: {0,1} *  {0,1}l ?Note that collisions are guaranteed to exist…If we compute H(x1), …, H(x2l + 1 ), we are guaranteed to find a collision Can we do better?

“Birthday” attacks Compute H(x 1 ), …, H(xk)What is the probability of a collision?Related to the so-called birthday paradoxHow many people are needed to have a 50% chance that some two people share a birthday?

N Bins : days of the year (N=365) Balls : k people Bins : values in {0,1} l (N= 2 l ) Balls : k hash-function computations How many balls do we need to have a 50% chance of a collision?

Theorem The collision probability is O(k 2 /N)When k  N1/2, probability of a collision is  50%Birthdays: 23 people suffice!Hash functions: O(2l/2) hash-function evaluations Need l =2n-bit output length to get security against attackers running in time 2 n Note: twice as long as symmetric keys (e.g., block-cipher keys or PRG seeds) for the same security

“Birthday bound” The birthday bound comes up in many other cryptographic contexts Example: IV reuse in CTR-mode encryption If k messages are encrypted, what are the chances that some IV is used twice?Note: this is much higher than the probability that a specific IV is used again

Hash functions in practice MD5 Developed in 1991 128-bit output lengthCollisions found in 2004, should no longer be usedSHA-1Introduced in 1995160-bit output lengthTheoretical analysis indicates some weaknessesVery common; current trend to migrate to SHA-2Collision found by brute force in 2017!

Hash functions in practice SHA-2 Supports 224, 256, 384, and 512-bit outputs No known weaknessesSHA-3/KeccakResult of a public competition from 2008-2012Very different design than SHA-1/SHA-2Supports 224, 256, 384, and 512-bit outputs

Applications to message authentication

Recall… We showed how to construct a secure MAC for short, fixed-length messages based on any PRF/block cipher We want to extend this to a secure MAC for arbitrary-length messages Before: using CBC-MACHere: using hash functions

M M h =? H(M) Intuition… h h = H(M )

k M k M h = H(M) Vrfy k (h, t) = 1? Hash-and-MAC h , t h = H(M) t = Mac k (h ) t

Security? If the MAC is secure for fixed-length messages and H is collision-resistant, then the previous construction is a secure MAC for arbitrary-length messages

Proof sketch Say the sender authenticates M 1 , M2, … Let mi = H(Mi)Attacker outputs forgery (M, t), MMi for all i Two cases: H(M) = H( M i ) for some i Collision in H! H(M)  m i for all i Forgery in the underlying, fixed-length MAC

Instantiation? Hash function + block-cipher-based MAC? Block-length mismatch Need to implement two crypto primitives (block cipher and hash function)

HMAC Constructed entirely from (certain type of) hash functions MD5, SHA-1, SHA-2 Not SHA-3Can be viewed as following the hash-and-MAC paradigmWith (part of the) hash function being used as a pseudorandom function

Other applications of hash functions

Hash functions are ubiquitous Collision-resistance  “fingerprinting” Used as a one-way functionUsed as a “random oracle”Proofs of work

Fingerprinting E.g., virus scanning E.g., deduplication