Cryptography Lecture 13.

Slides:



Advertisements
Similar presentations
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Advertisements

Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
Secure Hashing and DSS Sultan Almuhammadi ICS 454 Principles of Cryptography.
CS470, A.SelcukHash Functions1 Cryptographic Hash Functions CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Hash Functions Nathanael Paul Oct. 9, Hash Functions: Introduction Cryptographic hash functions –Input – any length –Output – fixed length –H(x)
CS526Topic 5: Hash Functions and Message Authentication 1 Computer Security CS 526 Topic 5 Cryptography: Cryptographic Hash Functions And Message Authentication.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2015 Nitesh Saxena.
Cryptographic Hash Functions and Protocol Analysis
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2014 Nitesh Saxena.
CS426Fall 2010/Lecture 51 Computer Security CS 426 Lecture 5 Cryptography: Cryptographic Hash Function.
Dan Boneh Collision resistance The Merkle-Damgard Paradigm Online Cryptography Course Dan Boneh.
Hashes Lesson Introduction ●The birthday paradox and length of hash ●Secure hash function ●HMAC.
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
Chapter 12 – Hash Algorithms
CSCE 715: Network Systems Security
Computer Security CS 526 Topic 4
Cryptographic Hash Functions
Cryptographic Hash Function
Cryptographic Hash Functions
Topic 14: Random Oracle Model, Hashing Applications
Computer Security CS 526 Topic 4
Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptographic Hash Functions Part I
Cryptography Lecture 13.
MAC: Message Authentication Code
Cryptographic Hash Functions
Cryptography Lecture 12.
ICS 454 Principles of Cryptography
Cryptography Lecture 19.
Cryptographic Hash Functions
Cryptography Lecture 6.
Cryptography Lecture 10.
Message Authentication and Hash Functions
CS/ECE 478 Introduction to Network Security Dr. Attila Altay Yavuz
Cryptography Lecture 11.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
ICS 454 Principles of Cryptography
Lecture 4.1: Hash Functions: Introduction
Cryptographic Hash Functions Part I
Cryptography Lecture 8.
Block Ciphers (Crypto 2)
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Cryptography Lecture 9.
CIS 4930/6930 – Privacy-Preserving and Trustworthy Cyber-Systems Dr
Cryptography Lecture 12.
Lecture 4.1: Hash Functions, and Message Authentication Codes
Computer Security CS 526 Topic 5
Cryptography Lecture 14.
Hashing Hash are the auxiliary values that are used in cryptography.
Cryptography Lecture 10.
Cryptography Lecture 9.
Cryptography Lecture 11.
Cryptography Lecture 10.
Cryptography Lecture 13.
Cryptography Lecture 15.
Cryptography Lecture 18.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Lecture 4: Hash Functions
Hash Function Requirements
CRYPTOGRAPHY & NETWORK SECURITY
Cryptography Lecture 15.
Cryptography Lecture 26.
Blockchains Lecture 4.
Presentation transcript:

Cryptography Lecture 13

Hash functions

Hash functions (Cryptographic) hash function: deterministic function mapping arbitrary length inputs to a short, fixed-length output Hash functions can be keyed or unkeyed Theoretically, need to be keyed (as in book) Key is public In practice, hash functions are unkeyed Assume unkeyed hash functions for simplicity

Collision-resistance Let H: {0,1}*  {0,1}l be a hash function A 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 (why?) Can we do better?

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

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

“Birthday” attacks Theorem: the collision probability is O(k2/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 to get security against attackers running in time 2n 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

Building a hash function Two-stage approach Build a compression function h I.e., hash function for fixed-length inputs Build a full-fledged hash function (for arbitrary length inputs) from a compression function h

Building a hash function For now… Assume we have a “good” compression function h I.e., collision-resistant for fixed-length inputs Will discuss how to construct such an h later Construct a hash function H (for arbitrary length inputs) based on h Prove that collision resistance of h implies collision resistance of H

Merkle-Damgard transform mB |M| z0 … h h h h Note: M = m1…mB is padded with 0s if necessary

Merkle-Damgard transform Claim: if h is collision-resistant, than so is H Proof: Collision in H  collision in h Say H(m1, …, mB) = H(m’1, …, m’B’) |M|  |M’|, obvious |M| = |M’|, look at largest i with (zi-1, mi)  (z’i-1, m’i) m1 m2 mB |M| = mB+1 z0 z1 z2 zB zB+1 … h h h h

Hash functions in practice MD5 Developed in 1991 128-bit output length Collisions found in 2004, should no longer be used SHA-1 Introduced in 1995 160-bit output length Very common; current trend to migrate to SHA-2 Collision found by brute force in 2017

Hash functions in practice SHA-2 Introduced in 2001 Versions with 224, 256, 384, and 512-bit outputs No significant known weaknesses SHA-3/Keccak Result of a public competition from 2008-2012 Very different design than SHA-1/SHA-2 Does not use Merkle-Damgard transform Supports 224, 256, 384, and 512-bit outputs

Applications of hash functions 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-MAC Here: using hash functions

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

Hash-and-MAC M k k h, t t M h = H(M) Vrfyk(h, t) = 1? h = H(M) t = Mack(h)

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 M1, M2, … Let mi = H(Mi) Attacker outputs forgery (M, t), MMi for all I Let m = H(M) Two cases: H(M) = H(Mi) for some i Collision in H! H(M) = m  mi for all i Forgery in the underlying, fixed-length MAC

Instantiation? Hash function + block-cipher-based MAC? Block-length mismatch (e.g., if using AES as the block cipher) Need to implement two crypto primitives (block cipher and hash function)

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