1 Message Integrity CS255 Winter ‘06. 2 Message Integrity Goal: provide message integrity. No confidentiality. –ex: Protecting public binaries on disk.

Slides:



Advertisements
Similar presentations
Dan Boneh Message integrity Message Auth. Codes Online Cryptography Course Dan Boneh.
Advertisements

Lecture 5: Cryptographic Hashes
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”
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Message Authentication Codes (MACs) and Hashes David Brumley Carnegie Mellon University Credits: Many slides from Dan Boneh’s June 2012.
Cryptography: Review Day David Brumley Carnegie Mellon University.
1 PRPs and PRFs CS255: Winter Abstract ciphers: PRPs and PRFs, 2.Security models for encryption, 3.Analysis of CBC and counter mode Dan Boneh, Stanford.
Authenticated Encryption and Cryptographic Network Protocols David Brumley Carnegie Mellon University.
Dan Boneh Message Integrity A Parallel MAC Online Cryptography Course Dan Boneh.
1 Brief PRP-PRF Recap CS255 Winter ‘06. 2 PRPs and PRFs PRF: F: K  X  Y such that: exists “efficient” algorithm to eval. F(k,x) PRP: E: K  X  X such.
25th Feb 2009FSE1 1 Fast and Secure CBC-type MACs National Institute of Standards and Technology Mridul Nandi
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
Goal Ensure integrity of messages, even in presence of
Information Security and Management 11
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
Foundations of Network and Computer Security J J ohn Black Lecture #5 Sep 7 th 2004 CSCI 6268/TLEN 5831, Fall 2004.
Foundations of Network and Computer Security J J ohn Black Lecture #7 Sep 11 th 2009 CSCI 6268/TLEN 5550, Fall 2009.
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.
Foundations of Network and Computer Security J J ohn Black Lecture #9 Sep 17 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
Cryptography Overview CS155. Cryptography Is A tremendous tool The basis for many security mechanisms Is not The solution to all security problems Reliable.
Dan Boneh Authenticated Encryption Definitions Online Cryptography Course Dan Boneh.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
CS555Topic 211 Cryptography CS 555 Topic 21: Digital Schemes (1)
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
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.
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.
Cryptography Lecture 9 Stefan Dziembowski
Introduction1-1 Data Communications and Computer Networks Chapter 6 CS 3830 Lecture 31 Omar Meqdadi Department of Computer Science and Software Engineering.
Dan Boneh Using block ciphers Modes of operation: many time key (CTR) Online Cryptography Course Dan Boneh Example applications: 1. File systems: Same.
Dan Boneh Using block ciphers Modes of operation: many time key (CBC) Online Cryptography Course Dan Boneh Example applications: 1. File systems: Same.
Dan Boneh Collision resistance Introduction Online Cryptography Course Dan Boneh.
A Quick Tour of Cryptographic Primitives Anupam Datta CMU Fall A: Foundations of Security and Privacy.
1 Message authentication codes, modes of operation, and indifferentiability Kan Yasuda (NTT, Japan) ASK 2011 Aug. 31, Singapore.
Dan Boneh Message Integrity CBC-MAC and NMAC Online Cryptography Course Dan Boneh.
Giuseppe Bianchi Message Authentication: hash functions and hash-based constructions.
Lecture 5.1: Message Authentication Codes, and Key Distribution
Cryptography: Review Day David Brumley Carnegie Mellon University.
Message Authentication Codes (MACs) and Hashes David Brumley Carnegie Mellon University Credits: Many slides from Dan Boneh’s June 2012.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2014 Nitesh Saxena.
Dan Boneh Collision resistance The Merkle-Damgard Paradigm Online Cryptography Course Dan Boneh.
CS555Spring 2012/Topic 81 Cryptography CS 555 Topic 8: Pseudorandom Functions and CPA Security.
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
Ryan Henry I 538 /B 609 : Introduction to Cryptography.
Cryptography Lecture 9 Arpita Patra © Arpita Patra.
CS555Spring 2012/Topic 151 Cryptography CS 555 Topic 15: HMAC, Combining Encryption & Authentication.
Message Authentication Codes CSCI 5857: Encoding and Encryption.
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
CS555Spring 2012/Topic 141 Cryptography CS 555 Topic 14: CBC-MAC & Hash Functions.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
Lecture 3 Overview of Cryptography A Practitioner Perspective
Foundations of Network and Computer Security
Message Authentication Codes (MACs) and Hashes
PRPs and PRFs CS255: Winter 2017
Topic 11: Authenticated Encryption + CCA-Security
Cryptography Lecture 13.
Cryptography Lecture 10.
Cryptography Lecture 11 Arpita Patra © Arpita Patra.
Introduction to Symmetric-key and Public-key Cryptography
Fast and Secure CBC-type MACs
Topic 13: Message Authentication Code
Lecture 4.1: Hash Functions, and Message Authentication Codes
Cryptography Lecture 9 Arpita Patra © Arpita Patra.
Cryptography Lecture 13.
Cryptography Lecture 10.
Cryptography Lecture 9.
Presentation transcript:

1 Message Integrity CS255 Winter ‘06

2 Message Integrity Goal: provide message integrity. No confidentiality. –ex: Protecting public binaries on disk. Protecting ads. –Requires secret key k unknown to attacker. –Def: MAC I = (S,V) defined over (K,M,T) is a pair of algorithms:- S(k,m) outputs t  T, - V(k,m,t) outputs `yes’ or `no’ AliceBob k k Message mtag Generate tag: tag  S(k, m) Verify tag: V(k, m, tag) = `yes’ ?

3 Secure MACs Attacker’s power: chosen message attack. – for m 1,m 2,…,m q attacker is given t i  S(k,mi) Attacker’s goal: existential forgery. – produce some new valid message/tag pair (m,t). (m,t)  { (m 1,t 1 ), …, (m q,t q ) } Note:attacker cannot even produce a valid tag for a nonsensical message.

4 Secure MACs For a MAC I=(S,V) and adv. A we define a MAC game: Def: I=(S,V) is a secure MAC if for all “efficient” A: MAC Adv[A,I] = Pr[Chal. outputs 1] is “negligible.” Chal.Adv. kKkK (m,t) m i  M t i  S(k,m i ) b=1 when V(k,m,t) = `yes’ and (m,t)  { (m 1,t 1 ), …, (m q,t q ) } b=0 otherwise b

5 Any secure PRF is a secure MAC Let F be a PRF over (K,X,Y). Define a MAC I F = (S,V): –S(k,m) = F(k,m) –V(k,m,t): output `yes’ if t = F(k,m) and `no’ otherwise. Theorem: If F is a secure PRF and 1/|Y| is negligible then I F is a secure MAC. In particular, for any MAC adversary A attacking I F there exists a PRF adversary B attacking F s.t.: MAC Adv[A, I F ]  PRF Adv[B, F] + 1/|Y|  I F is secure as long as |Y| is large, say |Y| = 2 80.

6 Proof Sketch Intuition: –Adversary A issues chosen message queries m 1,m 2, … –Gets back F(k,m 1 ), F(k,m 2 ), … –Must guess F(k,m) for m  {m 1, m 2, … } –But F is a PRF, so prob A guesses F(k,m) is 1/|X| Truncating MACs: –Suppose MAC is a PRF outputting n-bit tags (|Y| = 2 n ). –It is OK to truncate the MAC output to w<n bits. … as long as 1/2 w is still negligible (say w  64)

7 Examples AES: a MAC for 16-byte messages. Main question: how to convert Small-MAC into a Big-MAC ? Two main constructions: –CBC-MAC (banking – ANSI X9.9, X9.19, FIPS 186-3) –HMAC (Internet protocols: SSL, IPsec, SSH, …) Both convert a small-PRF into a big-PRF.

8 Raw CBC Construction 1: (E) CBC-MAC F(k,  ) m[0]m[1]m[3]m[4]  F(k,  )  F(k 1,  ) tag Let F be PRF over (K,X,X) Define new PRF F CBC over (K 2, X L, X )

9 CBC-MAC: Analysis CBC-MAC Theorem: For any L>0, If F is a secure PRF over (K,X,X) then F CBC is a secure PRF over (K, X  L, X). In particular, for a q-query PRF adv. A attacking F CBC there exists a PRF adversary B s.t.: PRF Adv[A, F CBC ]  PRF Adv[B, F] + 2 q 2 L o(1) / |X| Note: CBC-MAC is secure as long as q << |X| 1/2

10 Why the last encryption step? Suppose we define a MAC I RAW = (S,V) where S(k,m) = RawCBC(k,m) Fact: I RAW is easily broken using a chosen msg attack. Adversary works as follows: –Pick an arbitrary one-block message m  M –Request tag for m. Get t = F(k,m) –Output t as MAC forgery for the message (m, t  m) Indeed: RawCBC ( k, (m, t  m) ) = F ( k, t  (t  m) ) = t Unimportant note: RawCBC is secure for prefix-free inputs.

11 CBC-MAC Padding What is length of m is not multiple of block-size? Bad idea: pad m with 0’s –Vulnerable to chosen message attack: ask for tag on m and obtain tag on m||0 ISO: pad with “1000  00”. Add new block if needed. –The “1” indicates beginning of pad. CMAC: different padding. Never adds an extra block.

12 Construction 2: PMAC CBC-MAC is sequential. PMAC – Parallel MAC. m[0]m[1]m[3]m[4]  F(k,  ) F(k 1,  ) tag  P(k,0)P(k,1) P(k,2) P(k,3)

13 PMAC: Analysis PMAC Theorem: For any L>0, If F is a secure PRF over (K,X,X) then F PMAC is a secure PRF over (K, X  L, X). In particular, for a q-query PRF adv. A attacking F PMAC there exists a PRF adversary B s.t.: PRF Adv[A, F PMAC ]  PRF Adv[B, F] + 2 q 2 L 2 / |X| Note: PMAC is secure as long as qL << |X| 1/2 Note: PMAC is incremental. Homework.

14 Construction 3: HMAC (Hash-MAC) Most widely used MAC on the Internet. … but, we first we discuss hash function.

15 Collision Resistant Hashing

16 Collision Resistance Let H: M  T be a hash function. A collision for H is a pair m 0, m 1  M such that: H(m 0 ) = H(m 1 ) and m 0  m 1 Def: A function H is collision resistant if for all (uniform) “efficient” algs. A: CR Adv[A,H] = Pr[ A outputs collision for H] is “negligible” Used to have lots of examples: MD5, SHA1, … Currently, only: SHA-256, SHA-512, Whirpool 44.5MB/sec, 11.4, MB/s 68

17 MACs from Collision Resistance Let I = (S,V) be a MAC for small messages over (K,M,T). Let H: M big  M Define: I big = (S big, V big ) over (K, M big, T) as: S big (k,m) = S(k,H(m)) ; V big (k,m,t) = V(k,H(m),t) Theorem: If I is a secure MAC and H is collision resistant then I big is a secure MAC. So: S(k,m) = AES(k, SHA-256(m)) is a secure MAC.