CS555Spring 2012/Topic 141 Cryptography CS 555 Topic 14: CBC-MAC & Hash Functions.

Slides:



Advertisements
Similar presentations
Hash Function. What are hash functions? Just a method of compressing strings – E.g., H : {0,1}*  {0,1} 160 – Input is called “message”, output is “digest”
Advertisements

ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Cryptographic Hash Functions Rocky K. C. Chang, February
1 Introduction CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell.
Information Security Principles & Applications Topic 4: Message Authentication 虞慧群
CS426Fall 2010/Lecture 81 Computer Security CS 426 Lecture 8 User Authentication.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
Hash functions a hash function produces a fingerprint of some file/message/data h = H(M)  condenses a variable-length message M  to a fixed-sized fingerprint.
Information Security and Management 11
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.
1 CS 255 Lecture 6 Hash Functions Brent Waters. 2 Recap-Notions of Security What attacker can do Random plaintext attack Chosen plaintext attack Chosen.
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.
Cryptographic Hash Functions July Topics  Overview of Cryptography Hash Function  Usages  Properties  Hashing Function Structure  Attack on.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Lecture 15 Lecture’s outline Public algorithms (usually) that are each other’s inverse.
CS555Topic 211 Cryptography CS 555 Topic 21: Digital Schemes (1)
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
HASH Functions.
Message Authentication  message authentication is concerned with: protecting the integrity of a message protecting the integrity of a message validating.
Information Security Principles Assistant Professor Dr. Sana’a Wafa Al-Sayegh 1 st Semester ITGD 2202 University of Palestine.
Hash Functions A hash function H accepts a variable-length block of data M as input and produces a fixed-size hash value h = H(M) Principal object is.
Cryptographic Hash Functions June Topics  Overview of Cryptography Hash Function  Usages  Properties  Hashing Function Structure 
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
EE515/IS523 Think Like an Adversary Lecture 4 Crypto in a Nutshell Yongdae Kim.
Message Authentication Code July Message Authentication Problem  Message Authentication is concerned with:  protecting the integrity of a message.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2015 Nitesh Saxena.
EE515/IS523 Think Like an Adversary Lecture 3 Crypto Yongdae Kim 한국과학기술원.
CS555Spring 2012/Topic 111 Cryptography CS 555 Topic 11: Encryption Modes and CCA Security.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
Slide 1 EJ Jung Hash Functions. Integrity checks.
Cryptographic Hash Functions and Protocol Analysis
Lecture 2: Introduction to Cryptography
Chapter 11 Message Authentication and Hash Functions.
1 Message authentication codes, modes of operation, and indifferentiability Kan Yasuda (NTT, Japan) ASK 2011 Aug. 31, Singapore.
Cryptographic Hash Functions Prepared by Dr. Lamiaa Elshenawy
Cryptography and Network Security (CS435) Part Nine (Message Authentication)
Hash Functions Ramki Thurimella. 2 What is a hash function? Also known as message digest or fingerprint Compression: A function that maps arbitrarily.
CS555Spring 2012/Topic 31 Cryptography CS 555 Topic 3: One-time Pad and Perfect Secrecy.
CS555Spring 2012/Topic 71 Cryptography CS 555 Topic 7: Stream Ciphers and CPA Security.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2014 Nitesh Saxena.
Cryptographic Hash Functions
Cryptography and Network Security
CS426Fall 2010/Lecture 51 Computer Security CS 426 Lecture 5 Cryptography: Cryptographic Hash Function.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
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.
CS555Spring 2012/Topic 151 Cryptography CS 555 Topic 15: HMAC, Combining Encryption & Authentication.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 13.Message Authentication.
Cryptography Hyunsung Kim, PhD University of Malawi, Chancellor College Kyungil University February, 2016.
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
Cryptographic Hash Function. A hash function H accepts a variable-length block of data as input and produces a fixed-size hash value h = H(M). The principal.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
Computer Security CS 526 Topic 4
Cryptographic Hash Functions
Cryptographic Hash Functions
Topic 14: Random Oracle Model, Hashing Applications
Computer Security CS 526 Topic 4
Topic 13: Message Authentication Code
Lecture 4.1: Hash Functions, and Message Authentication Codes
Computer Security CS 526 Topic 5
Cryptography Lecture 13.
Blockchains Lecture 4.
Presentation transcript:

CS555Spring 2012/Topic 141 Cryptography CS 555 Topic 14: CBC-MAC & Hash Functions

CS555Spring 2012/Topic 142 Outline and Readings Outline CBC-MAC Collision-resistant hash functions Applications of MAC and hash functions Readings: Katz and Lindell: : 4.5,4.6

Basic CBC-MAC (secure for fixed- length messages) Given a PRF F:{0,1} n  {0,1} n  {0,1} *, fix a length function l (n), basic CBC-MAC is –Mac k (m)m is of length l (n)  n Divide m into m 1,…,m l Set t 0 := 0 n For i=1 to l, set t i := F k (t i-1  m i ) Output t l –Vrfy(k, m, t)on input m of length l (n)  n, check whether t = Mac k (m) When F is a block cipher, this is similar to CBC encryption with IV= 0 n, and using last block as tag Why is this insecure for variable messages? CS555Spring 2012/Topic 143

Security of Basic CBC-MAC The basic CBC-MAC is a fixed-length MAC that is existential unforgerable under an adaptive chosen-message attack assuming that F is PRF. CBC-MAC differs with CBC encryption –Fixed IV vs random IV –Outputting last block vs. all blocks Outputting more than one ciphertext blocks is no longer a secure MAC. Why? CS555Spring 2012/Topic 144

Secure MAC for Variable-length Msgs Several constructions are proven secure –Set k l :=F k ( l ), then compute basic CBC-MAC with k l –Prepend message with its length encoded as an n-bit string, then apply basic CBC-MAC Append message length is insecure, why? –Uses two keys, compute basic CBC-MAC of m using k1 as t, then compute output tag F k2 (t) CS555Spring 2012/Topic 145

Hash Functions A hash function maps/compresses messages of arbitrary lengths to a m-bit output –output known as the fingerprint or the message digest What is an example of hash functions? –Given a hash function that maps Strings to integers in [0,2^{32}-1] A hash function is a many-to-one function, so collisions must happen. Hash functions are used in a number of data structures –Good hash functions have few collisions Cryptographic hash functions are hash functions with additional security requirements CS555Spring 2012/Topic 146

CS555Spring 2012/Topic 147 Security Requirements for Cryptographic Hash Functions Given a function h:X  Y, then we say that h is: preimage resistant (one-way): if given y  Y it is computationally infeasible to find a value x  X s.t. h(x) = y 2-nd preimage resistant (weak collision resistant): if given x  X it is computationally infeasible to find a value x’  X, s.t. x’  x and h(x’) = h(x) collision resistant (strong collision resistant): if it is computationally infeasible to find two distinct values x’,x  X, s.t. h(x’) = h(x)

CS555Spring 2012/Topic 148 Bruteforce Attacks on Hash Functions Attacking one-wayness –Goal: given h:X  Y, y  Y, find x such that h(x)=y –Algorithm: pick a random value x in X, check if h(x)=y, if h(x)=y, returns x; otherwise iterate after failing q iterations, return fail –The average-case success probability is when q << |Y| –Let |Y|=2 m, q = 2 m-1 then,   is 1/sqrt(e) about 0.6

CS555Spring 2012/Topic 149 Bruteforce Attacks on Hash Functions Attacking collision resistance –Goal: given h, find x, x’ such that h(x)=h(x’) –Algorithm: pick a random set X 0 of q values in X for each x  X 0, computes y x =h(x) if y x =y x’ for some x’  x then return (x,x’) else fail –The average success probability is –Let |Y|=2 m, to get  to be close to 0.5, q  2 m/2 –This is known as the birthday attack.

CS555Spring 2012/Topic 1410 Well Known Hash Functions MD5 –output 128 bits –collision resistance completely broken by Prof. Xiaoyun Wang and others from in China in 2004 SHA1 –output 160 bits –no collision found yet, but method exist to find collisions in less than 2^80 –considered insecure for collision resistance –one-wayness still holds SHA2 (SHA-224, SHA-256, SHA-384, SHA-512) –outputs 224, 256, 384, and 512 bits, respectively –No real security concerns yet

Merkle-Damgard Construction for Hash Functions CS555Spring 2012/Topic 1411 Message is divided into fixed-size blocks and padded Uses a compression function f, which takes a chaining variable (of size of hash output) and a message block, and outputs the next chaining variable Final chaining variable is the hash value

Security of Merkle-Damgard Construction Finding a collision against the hash function implies finding a collision against the compression function A compression function that takes a chaining variable and a block of msg is often similar to a block cipher using the msg as round keys to encrypt the chaining variable –Finding collisions is similar to related-key attacks against block ciphers, something that is not very well- understood. CS555Spring 2012/Topic 1412

Related-Key Attacks Against Block Ciphers Attacker ensures two keys that satisfy that some relationship, e.g., k1  k2=p, and then use chosen plaintext attacks to obtain ciphertexts of msgs under both keys Recent paper claims that AES-256 with 9 rounds can be broken with 2 39 ciphertexts and 2 39 time –AES-256 uses 14 rounds –AES-128 and AES-192 are less vulnerable to related key attacks, because shorter keys force more permutation in generating sub-keys CS555Spring 2012/Topic 1413

NIST SHA-3 Competition NIST is having an ongoing competition for SHA-3, the next generation of standard hash algorithms 2007: Request for submissions of new hash functions 2008: Submissions deadline. Received 64 entries. Announced first- round selections of 51 candidates. 2009: After First SHA-3 candidate conference in Feb, announced 14 Second Round Candidates in July. 2010: After one year public review of the algorithms, hold second SHA-3 candidate conference in Aug. Announced 5 Third-round candidates in Dec. 2011: Public comment for final round 2012: Hold Final hash candidate conference. Draft standard, wait for comments, and submit recommendation. CS555Spring 2012/Topic 1414

CS555Spring 2012/Topic 1415 Choosing the length of Hash outputs The Weakest Link Principle: –A system is only as secure as its weakest link. Hence all links in a system should have similar levels of security. Because of the birthday attack, the length of hash outputs in general should double the key length of block ciphers –SHA-224 matches the 112-bit strength of triple-DES –SHA-256, SHA-384, SHA-512 match the new key lengths (128,192,256) in AES

CS555Spring 2012/Topic 1416 Application of Hash Function and MAC Using Passwords Over Insecure Channels One-time passwords –Each password is used only once –Defend against passive adversaries who eavesdrop and later attempt to impersonate Challenge response –Send a response related to both the password and a challenge

CS555Spring 2012/Topic 1417 How to do One-Time Password Shared lists of one-time passwords Time-synchronized OTP –E.g., use MAC K (t), where K is shared secret, and t is current time Using a hash chain (Lamport) –h(s), h(h(s), h(h(h(s))), …, h 1000 (s) –use these values as passwords in reverse order

CS555Spring 2012/Topic 1418 Lamport’s One-Time Password: Using a Hash Chain One-time setup: –A selects a value w, a hash function H(), and an integer t, computes w 0 = H t (w) and sends w 0 to B –B stores w 0 Protocol: to identify to B for the i th time, 1  i  t –A sends to B: A, i, w i = H t-i (w) –B checks i = i A, H(w i ) = w i-1 –if both holds, i A = i A +1

CS555Spring 2012/Topic 1419 Challenge-Response Protocols Goal: one entity authenticates to other entity proving the knowledge of a secret, ‘challenge’ Approach: Use time-variant parameters to prevent replay, interleaving attacks, provide uniqueness and timeliness –e.g., nonce (used only once), timestamps

CS555Spring 2012/Topic 1420 Challenge-response based on symmetric-key crypto Unilateral authentication, timestamp-based –A to B: MAC K (t A, B) Unilateral authentication, nonce-based –B to A: r B –A to B: MAC K (r B, B) Mutual authentication, nonce-based –B to A: r B –A to B: r A, MAC K (r A, r B, B) –B to A: MAC K (r B, r A )

Authenticated Data Structure with Merkle Hash Tree An Authenticated Data Structure enables an untrusted party to answer queries on behalf of data owner –Each query answer comes with a proof of correctness –Useful in data outsourcing, database as a service, cloud computing, etc. A merkle hash tree enables proof of size O(log n) CS555Spring 2012/Topic 1421

CS555Spring 2012/Topic 1422 Other Usages of Cryptographic Hash Functions Software integrity –E.g., tripwire Timestamping –How to prove that you have discovered a secret on an earlier date without disclosing it?

CS555Spring 2012/Topic 1423 Coming Attractions … HMAC CCA-Secure encryption Combining encryption with MAC Reading: Katz & Lindell: 4.7,4.8,4.9