Cryptography Lecture 13.

Slides:



Advertisements
Similar presentations
Foundations of Network and Computer Security J J ohn Black Lecture #10 Sep 19 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
Advertisements

CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
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.
Cryptography1 CPSC 3730 Cryptography Chapter 11, 12 Message Authentication and Hash Functions.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Message Authentication  message authentication is concerned with: protecting the integrity of a message protecting the integrity of a message validating.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2015 Nitesh Saxena.
Hash Functions Ramki Thurimella. 2 What is a hash function? Also known as message digest or fingerprint Compression: A function that maps arbitrarily.
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.
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
IT443 – Network Security Administration Instructor: Bo Sheng
CSCE 715: Network Systems Security
Computer Security CS 526 Topic 4
Cryptographic Hash Functions
Cryptographic Hash Function
Cryptographic Hash Functions
Presented by: Dr. Munam Ali Shah
Topic 14: Random Oracle Model, Hashing Applications
Foundations of Network and Computer Security
Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptographic Hash Functions Part I
MAC: Message Authentication Code
B504/I538: Introduction to Cryptography
Cryptographic Hash Functions
Cryptography Lecture 12.
ICS 454 Principles of Cryptography
Cryptography Lecture 27.
Cryptography Lecture 19.
Cryptographic Hash Functions
Cryptography Lecture 10.
Message Authentication and Hash Functions
Introduction to Symmetric-key and Public-key Cryptography
Cryptography Lecture 11.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
ICS 454 Principles of Cryptography
Lecture 4.1: Hash Functions: Introduction
Cryptographic Hash Functions Part I
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Cryptography Lecture 14.
Cryptography Lecture 9.
Cryptography Lecture 12.
Topic 13: Message Authentication Code
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 13.
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 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 (sometimes called a digest) Hash functions can be keyed or unkeyed In practice, hash functions are unkeyed We will 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 Can we do better?

“Birthday” attacks Compute H(x1), …, H(xk) What is the probability of a collision? 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

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-bit output length 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

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 Theoretical analysis indicates some weaknesses Very common; current trend to migrate to SHA-2 Collision found by brute force in 2017!

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

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-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 Two cases: H(M) = H(Mi) for some i Collision in H! H(M)  mi 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-3 Can be viewed as following the hash-and-MAC paradigm With (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 function Used as a “random oracle” Proofs of work

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