Top Banner
Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical Institute, Kolkata, India A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 1 / 47
172

Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Mar 12, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Symmetric Key Cryptography : Hash and MAC

Avijit Dutta

Cryptology and Security Research UnitIndian Statistical Institute, Kolkata, India

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 1 / 47

Page 2: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Outline

1 Hash Function

2 Message Authentication Code (MAC)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 2 / 47

Page 3: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Definition

A Hash Function H : 0, 1m → 0, 1n such that m >> n.

Definition

A Hash Function Family H := Hk : k ∈ K such that eachHk : 0, 1m → 0, 1n

Choosing a hash function h$←− H is equivalen to choose k

$←− K and thenset h← Hk

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 3 / 47

Page 4: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Definition

A Hash Function H : 0, 1m → 0, 1n such that m >> n.

Definition

A Hash Function Family H := Hk : k ∈ K such that eachHk : 0, 1m → 0, 1n

Choosing a hash function h$←− H is equivalen to choose k

$←− K and thenset h← Hk

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 3 / 47

Page 5: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Definition

A Hash Function H : 0, 1m → 0, 1n such that m >> n.

Definition

A Hash Function Family H := Hk : k ∈ K such that eachHk : 0, 1m → 0, 1n

Choosing a hash function h$←− H is equivalen to choose k

$←− K and thenset h← Hk

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 3 / 47

Page 6: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Properties of Hash Function

Pre-Image Resistant

Chalk ← K Adv

y

m : Hk(m) = y

ε-Pre-Image Secure ⇒ ∀ efficient A,Pr[A wins the game ] ≤ ε

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 4 / 47

Page 7: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Properties of Hash Function

Pre-Image Resistant

Chalk ← K Adv

y

m : Hk(m) = y

ε-Pre-Image Secure ⇒ ∀ efficient A,Pr[A wins the game ] ≤ ε

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 4 / 47

Page 8: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Properties of Hash Function

Second-Pre-Image Resistant

Chalk ← K Adv

mm′ : Hk(m

′) = Hk(m)

ε-Second-Pre-Image Secure ⇒ ∀ efficient A,Pr[A wins the game ] ≤ ε

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 5 / 47

Page 9: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Properties of Hash Function

Second-Pre-Image Resistant

Chalk ← K Adv

mm′ : Hk(m

′) = Hk(m)

ε-Second-Pre-Image Secure ⇒ ∀ efficient A,Pr[A wins the game ] ≤ ε

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 5 / 47

Page 10: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Properties of Hash Function

Collision Resistant

Chalk ← K Advm,m′ : Hk(m) = Hk(m

′)

ε-Collision Resistance ⇒ ∀ efficient A,Pr[A wins the game ] ≤ ε

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 6 / 47

Page 11: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Properties of Hash Function

Collision Resistant

Chalk ← K Advm,m′ : Hk(m) = Hk(m

′)

ε-Collision Resistance ⇒ ∀ efficient A,Pr[A wins the game ] ≤ ε

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 6 / 47

Page 12: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Properties of Hash Function

Facts

A Good Hash Function should be 2−n pre-image secure

A Good Hash Function should be 2−n second-pre-image secure

The success probability of finding a collision in a hash function is at

least q2

2n (Birthday Bound !)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 7 / 47

Page 13: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Properties of Hash Function

Facts

A Good Hash Function should be 2−n pre-image secure

A Good Hash Function should be 2−n second-pre-image secure

The success probability of finding a collision in a hash function is at

least q2

2n (Birthday Bound !)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 7 / 47

Page 14: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Properties of Hash Function

Facts

A Good Hash Function should be 2−n pre-image secure

A Good Hash Function should be 2−n second-pre-image secure

The success probability of finding a collision in a hash function is at

least q2

2n (Birthday Bound !)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 7 / 47

Page 15: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Birthday Bound

Problem Statement

How many people must there be in a room before there is a 50% chancethat two of them were boron on the same day of the year ?

Let us assume # of days is n.

If N = n + 1, probability of collision is 1 (Pigeonhole Principle)

To ensure probability 12 , is the number n/2 ?

The real answer is surprisingly small. Its about Ω(√

n)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 8 / 47

Page 16: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Birthday Bound

Problem Statement

How many people must there be in a room before there is a 50% chancethat two of them were boron on the same day of the year ?

Let us assume # of days is n.

If N = n + 1, probability of collision is 1 (Pigeonhole Principle)

To ensure probability 12 , is the number n/2 ?

The real answer is surprisingly small. Its about Ω(√

n)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 8 / 47

Page 17: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Birthday Bound

Problem Statement

How many people must there be in a room before there is a 50% chancethat two of them were boron on the same day of the year ?

Let us assume # of days is n.

If N = n + 1, probability of collision is 1 (Pigeonhole Principle)

To ensure probability 12 , is the number n/2 ?

The real answer is surprisingly small. Its about Ω(√

n)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 8 / 47

Page 18: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Birthday Bound

Problem Statement

How many people must there be in a room before there is a 50% chancethat two of them were boron on the same day of the year ?

Let us assume # of days is n.

If N = n + 1, probability of collision is 1 (Pigeonhole Principle)

To ensure probability 12 , is the number n/2 ?

The real answer is surprisingly small. Its about Ω(√

n)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 8 / 47

Page 19: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Collision Attack in Hash Function

Let H : 0, 1∗ → 0, 1n be a hash function.

Collision Finding Algorithm

1 Choose 2n/2 random message m ∈ 0, 1∗ (m1,m2, . . . ,m2n/2)message will be distinct with high probability.

2 for each of these messages compute t ← H(m)

3 if ∃i 6= j such that ti = tj return 1. else go to step 1

Analogy : 0, 1n is the set of days in the birthday paradox setting

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 9 / 47

Page 20: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Collision Attack in Hash Function

Let H : 0, 1∗ → 0, 1n be a hash function.

Collision Finding Algorithm

1 Choose 2n/2 random message m ∈ 0, 1∗ (m1,m2, . . . ,m2n/2)message will be distinct with high probability.

2 for each of these messages compute t ← H(m)

3 if ∃i 6= j such that ti = tj return 1. else go to step 1

Analogy : 0, 1n is the set of days in the birthday paradox setting

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 9 / 47

Page 21: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Relation between PR, 2-PR, and CR

CR⇒ 2-PR⇒ PR

Proof.

Proof in the contrapositive way.

If A attacks PR then ∃B attacks 2-PR

If B attacks 2-PR then ∃C attacks CR

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 10 / 47

Page 22: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Relation between PR, 2-PR, and CR

CR⇒ 2-PR⇒ PR

Proof.

Proof in the contrapositive way.

If A attacks PR then ∃B attacks 2-PR

If B attacks 2-PR then ∃C attacks CR

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 10 / 47

Page 23: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Relation between PR, 2-PR, and CR

CR⇒ 2-PR⇒ PR

Proof.

Proof in the contrapositive way.

If A attacks PR then ∃B attacks 2-PR

If B attacks 2-PR then ∃C attacks CR

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 10 / 47

Page 24: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Relation between PR, 2-PR, and CR

CR⇒ 2-PR⇒ PR

Proof.

Proof in the contrapositive way.

If A attacks PR then ∃B attacks 2-PR

If B attacks 2-PR then ∃C attacks CR

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 10 / 47

Page 25: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of a Hash Function

Q. How to construct a secure hash function ?

The general idea of building a higher primitive is to start from a lowerprimitive.

To construct a hash function, the lower primitive is the CompressionFunction

This Compression function is a fixed length primitive.f : 0, 1c × 0, 1b → 0, 1cFrom a fixed length compression function, design a variable lengthhash function by iterating the compression function

The most popular approach : Merkle-Damgard Technique of IteratingHash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 11 / 47

Page 26: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of a Hash Function

Q. How to construct a secure hash function ?

The general idea of building a higher primitive is to start from a lowerprimitive.

To construct a hash function, the lower primitive is the CompressionFunction

This Compression function is a fixed length primitive.f : 0, 1c × 0, 1b → 0, 1cFrom a fixed length compression function, design a variable lengthhash function by iterating the compression function

The most popular approach : Merkle-Damgard Technique of IteratingHash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 11 / 47

Page 27: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of a Hash Function

Q. How to construct a secure hash function ?

The general idea of building a higher primitive is to start from a lowerprimitive.

To construct a hash function, the lower primitive is the CompressionFunction

This Compression function is a fixed length primitive.f : 0, 1c × 0, 1b → 0, 1cFrom a fixed length compression function, design a variable lengthhash function by iterating the compression function

The most popular approach : Merkle-Damgard Technique of IteratingHash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 11 / 47

Page 28: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of a Hash Function

Q. How to construct a secure hash function ?

The general idea of building a higher primitive is to start from a lowerprimitive.

To construct a hash function, the lower primitive is the CompressionFunction

This Compression function is a fixed length primitive.f : 0, 1c × 0, 1b → 0, 1c

From a fixed length compression function, design a variable lengthhash function by iterating the compression function

The most popular approach : Merkle-Damgard Technique of IteratingHash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 11 / 47

Page 29: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of a Hash Function

Q. How to construct a secure hash function ?

The general idea of building a higher primitive is to start from a lowerprimitive.

To construct a hash function, the lower primitive is the CompressionFunction

This Compression function is a fixed length primitive.f : 0, 1c × 0, 1b → 0, 1cFrom a fixed length compression function, design a variable lengthhash function by iterating the compression function

The most popular approach : Merkle-Damgard Technique of IteratingHash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 11 / 47

Page 30: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of a Hash Function

Q. How to construct a secure hash function ?

The general idea of building a higher primitive is to start from a lowerprimitive.

To construct a hash function, the lower primitive is the CompressionFunction

This Compression function is a fixed length primitive.f : 0, 1c × 0, 1b → 0, 1cFrom a fixed length compression function, design a variable lengthhash function by iterating the compression function

The most popular approach : Merkle-Damgard Technique of IteratingHash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 11 / 47

Page 31: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Davis-Meyer Construction

How to construct a Compression function ?

The very old and popular method to construct a compression function outof a block-cipher is due to Davis and Meyer.

Davis-Meyer Compression Function

Let e : 0, 1n × 0, 1c → 0, 1c be a block-cipher and thus for anyK ∈ 0, 1n, eK := e(K , ·) is a permutation over 0, 1c . The Davis-MeyerCompression Function DMe : 0, 1c × 0, 1n → 0, 1c , defined asDMe(h,m) = em(h)⊕ h.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 12 / 47

Page 32: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Davis-Meyer Construction

How to construct a Compression function ?

The very old and popular method to construct a compression function outof a block-cipher is due to Davis and Meyer.

Davis-Meyer Compression Function

Let e : 0, 1n × 0, 1c → 0, 1c be a block-cipher and thus for anyK ∈ 0, 1n, eK := e(K , ·) is a permutation over 0, 1c . The Davis-MeyerCompression Function DMe : 0, 1c × 0, 1n → 0, 1c , defined asDMe(h,m) = em(h)⊕ h.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 12 / 47

Page 33: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Davis-Meyer Construction

How to construct a Compression function ?

The very old and popular method to construct a compression function outof a block-cipher is due to Davis and Meyer.

Davis-Meyer Compression Function

Let e : 0, 1n × 0, 1c → 0, 1c be a block-cipher and thus for anyK ∈ 0, 1n, eK := e(K , ·) is a permutation over 0, 1c . The Davis-MeyerCompression Function DMe : 0, 1c × 0, 1n → 0, 1c , defined asDMe(h,m) = em(h)⊕ h.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 12 / 47

Page 34: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Given a compression function f : 0, 1c × 0, 1b → 0, 1c , we definethe iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 13 / 47

Page 35: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Given a compression function f : 0, 1c × 0, 1b → 0, 1c , we definethe iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 13 / 47

Page 36: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Given a compression function f : 0, 1c × 0, 1b → 0, 1c , we definethe iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 13 / 47

Page 37: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Given a compression function f : 0, 1c × 0, 1b → 0, 1c , we definethe iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 13 / 47

Page 38: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Given a compression function f : 0, 1c × 0, 1b → 0, 1c , we definethe iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 13 / 47

Page 39: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Given a compression function f : 0, 1c × 0, 1b → 0, 1c , we definethe iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 13 / 47

Page 40: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Given a compression function f : 0, 1c × 0, 1b → 0, 1c , we definethe iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 13 / 47

Page 41: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Theorem

Let f be a fixed compression function and H f be the Merkle-DamgardIterated hash Function. If f is a collision resistant function then H f is alsoa collision resistant function

Proof.

Proof the contrapositive.

Remark

To design a collision resistant hash function, it is enough to design acollision resistant compression function

We cannot lift the preimage resistant or second preimage resistantsecurity to that of compression function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 14 / 47

Page 42: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Theorem

Let f be a fixed compression function and H f be the Merkle-DamgardIterated hash Function. If f is a collision resistant function then H f is alsoa collision resistant function

Proof.

Proof the contrapositive.

Remark

To design a collision resistant hash function, it is enough to design acollision resistant compression function

We cannot lift the preimage resistant or second preimage resistantsecurity to that of compression function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 14 / 47

Page 43: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Theorem

Let f be a fixed compression function and H f be the Merkle-DamgardIterated hash Function. If f is a collision resistant function then H f is alsoa collision resistant function

Proof.

Proof the contrapositive.

Remark

To design a collision resistant hash function, it is enough to design acollision resistant compression function

We cannot lift the preimage resistant or second preimage resistantsecurity to that of compression function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 14 / 47

Page 44: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Theorem

Let f be a fixed compression function and H f be the Merkle-DamgardIterated hash Function. If f is a collision resistant function then H f is alsoa collision resistant function

Proof.

Proof the contrapositive.

Remark

To design a collision resistant hash function, it is enough to design acollision resistant compression function

We cannot lift the preimage resistant or second preimage resistantsecurity to that of compression function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 14 / 47

Page 45: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Note

It was believed until 2005 that Merkle Damgard Iterated HashFunction is 2n preimage secure. But Kelsey and Schneier [2] inEurocrypt’05 showed 2n

` attack.

Theorem

Let f be a public random function and H f be the Merkle-Damgard IteratedHash Function. Let A be a preimage adversary (q, `, ε) breaks H f . Then,

ε ≤ q`

2n

.

Proof.

We shall look at the proof in later slide.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 15 / 47

Page 46: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Note

It was believed until 2005 that Merkle Damgard Iterated HashFunction is 2n preimage secure. But Kelsey and Schneier [2] inEurocrypt’05 showed 2n

` attack.

Theorem

Let f be a public random function and H f be the Merkle-Damgard IteratedHash Function. Let A be a preimage adversary (q, `, ε) breaks H f . Then,

ε ≤ q`

2n

.

Proof.

We shall look at the proof in later slide.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 15 / 47

Page 47: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Hash Function

Note

It was believed until 2005 that Merkle Damgard Iterated HashFunction is 2n preimage secure. But Kelsey and Schneier [2] inEurocrypt’05 showed 2n

` attack.

Theorem

Let f be a public random function and H f be the Merkle-Damgard IteratedHash Function. Let A be a preimage adversary (q, `, ε) breaks H f . Then,

ε ≤ q`

2n

.

Proof.

We shall look at the proof in later slide.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 15 / 47

Page 48: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Multi-Collision Attack(Joux [1])

Algorithm

set h0 = IV

for i = 1 to tcall C with hi−1, C will return B 6= B ′ such that

f (hi−1,B) = f (hi−1,B′).

set hi = f (hi−1,B)

Pad and output 2t messages of the form (b1, . . . , bt ,Pad) such thateach bi = Bi ,B

′i )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 16 / 47

Page 49: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Multi-Collision Attack(Joux [1])

Algorithm

set h0 = IV

for i = 1 to tcall C with hi−1, C will return B 6= B ′ such that

f (hi−1,B) = f (hi−1,B′).

set hi = f (hi−1,B)

Pad and output 2t messages of the form (b1, . . . , bt ,Pad) such thateach bi = Bi ,B

′i )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 16 / 47

Page 50: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Multi-Collision Attack(Joux [1])

Algorithm

set h0 = IV

for i = 1 to tcall C with hi−1, C will return B 6= B ′ such that

f (hi−1,B) = f (hi−1,B′).

set hi = f (hi−1,B)

Pad and output 2t messages of the form (b1, . . . , bt ,Pad) such thateach bi = Bi ,B

′i )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 16 / 47

Page 51: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Multi-Collision Attack(Joux [1])

Algorithm

set h0 = IV

for i = 1 to tcall C with hi−1, C will return B 6= B ′ such that

f (hi−1,B) = f (hi−1,B′).

set hi = f (hi−1,B)

Pad and output 2t messages of the form (b1, . . . , bt ,Pad) such thateach bi = Bi ,B

′i )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 16 / 47

Page 52: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Multi-Collision Attack(Joux [1])

Remark

The collision finding algorithm C on f may use generic birthdayattack or any other attack exploiting the weakness of f .

The above attack is possible when message block size is larger thanchaining variable size

In other case, one could merge two or more blocks until the mergedblock size becomes equal to the chaining variable size

Time Complexity

f : 0, 1n × 0, 1b → 0, 1n then the time complexity of the aboveattack is t × 2n/2

Application

Collision-Resistance on the Cascading Hash Function.

Pre-Image and Second-Pre-Image on the Cascading Hash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 17 / 47

Page 53: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Multi-Collision Attack(Joux [1])

Remark

The collision finding algorithm C on f may use generic birthdayattack or any other attack exploiting the weakness of f .

The above attack is possible when message block size is larger thanchaining variable size

In other case, one could merge two or more blocks until the mergedblock size becomes equal to the chaining variable size

Time Complexity

f : 0, 1n × 0, 1b → 0, 1n then the time complexity of the aboveattack is t × 2n/2

Application

Collision-Resistance on the Cascading Hash Function.

Pre-Image and Second-Pre-Image on the Cascading Hash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 17 / 47

Page 54: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Multi-Collision Attack(Joux [1])

Remark

The collision finding algorithm C on f may use generic birthdayattack or any other attack exploiting the weakness of f .

The above attack is possible when message block size is larger thanchaining variable size

In other case, one could merge two or more blocks until the mergedblock size becomes equal to the chaining variable size

Time Complexity

f : 0, 1n × 0, 1b → 0, 1n then the time complexity of the aboveattack is t × 2n/2

Application

Collision-Resistance on the Cascading Hash Function.

Pre-Image and Second-Pre-Image on the Cascading Hash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 17 / 47

Page 55: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Multi-Collision Attack(Joux [1])

Remark

The collision finding algorithm C on f may use generic birthdayattack or any other attack exploiting the weakness of f .

The above attack is possible when message block size is larger thanchaining variable size

In other case, one could merge two or more blocks until the mergedblock size becomes equal to the chaining variable size

Time Complexity

f : 0, 1n × 0, 1b → 0, 1n then the time complexity of the aboveattack is t × 2n/2

Application

Collision-Resistance on the Cascading Hash Function.

Pre-Image and Second-Pre-Image on the Cascading Hash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 17 / 47

Page 56: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Multi-Collision Attack(Joux [1])

Remark

The collision finding algorithm C on f may use generic birthdayattack or any other attack exploiting the weakness of f .

The above attack is possible when message block size is larger thanchaining variable size

In other case, one could merge two or more blocks until the mergedblock size becomes equal to the chaining variable size

Time Complexity

f : 0, 1n × 0, 1b → 0, 1n then the time complexity of the aboveattack is t × 2n/2

Application

Collision-Resistance on the Cascading Hash Function.

Pre-Image and Second-Pre-Image on the Cascading Hash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 17 / 47

Page 57: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Multi-Collision Attack(Joux [1])

Remark

The collision finding algorithm C on f may use generic birthdayattack or any other attack exploiting the weakness of f .

The above attack is possible when message block size is larger thanchaining variable size

In other case, one could merge two or more blocks until the mergedblock size becomes equal to the chaining variable size

Time Complexity

f : 0, 1n × 0, 1b → 0, 1n then the time complexity of the aboveattack is t × 2n/2

Application

Collision-Resistance on the Cascading Hash Function.

Pre-Image and Second-Pre-Image on the Cascading Hash Function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 17 / 47

Page 58: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

CR, PR and 2-PR on the Cascading Hash Function

Motivation

A Long Standing Open Problem : Is the concatenation of twoindependent hash values more secure than a single hash-value ?

Cascading of hash function was proposed in the PhD thesis ofB.Preneel to increase the security.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf /2+ng/2 collision resistant secure.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf +ng pre image and second pre image secure.

Joux Attack [1]

Collision : q ≈ ng × 2nf /2 + 2ng/2 if nf ≤ ng (respectivelynf × 2ng/2 + 2nf /2 if nf ≥ ng ).

Pre-Image and Second-Pre-Image : q ≈ ng × 2nf /2 + 2nf + 2ng ifnf ≤ ng (respectively nf × 2ng/2 + 2ng + 2nf if nf ≥ ng )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 18 / 47

Page 59: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

CR, PR and 2-PR on the Cascading Hash Function

Motivation

A Long Standing Open Problem : Is the concatenation of twoindependent hash values more secure than a single hash-value ?

Cascading of hash function was proposed in the PhD thesis ofB.Preneel to increase the security.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf /2+ng/2 collision resistant secure.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf +ng pre image and second pre image secure.

Joux Attack [1]

Collision : q ≈ ng × 2nf /2 + 2ng/2 if nf ≤ ng (respectivelynf × 2ng/2 + 2nf /2 if nf ≥ ng ).

Pre-Image and Second-Pre-Image : q ≈ ng × 2nf /2 + 2nf + 2ng ifnf ≤ ng (respectively nf × 2ng/2 + 2ng + 2nf if nf ≥ ng )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 18 / 47

Page 60: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

CR, PR and 2-PR on the Cascading Hash Function

Motivation

A Long Standing Open Problem : Is the concatenation of twoindependent hash values more secure than a single hash-value ?

Cascading of hash function was proposed in the PhD thesis ofB.Preneel to increase the security.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf /2+ng/2 collision resistant secure.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf +ng pre image and second pre image secure.

Joux Attack [1]

Collision : q ≈ ng × 2nf /2 + 2ng/2 if nf ≤ ng (respectivelynf × 2ng/2 + 2nf /2 if nf ≥ ng ).

Pre-Image and Second-Pre-Image : q ≈ ng × 2nf /2 + 2nf + 2ng ifnf ≤ ng (respectively nf × 2ng/2 + 2ng + 2nf if nf ≥ ng )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 18 / 47

Page 61: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

CR, PR and 2-PR on the Cascading Hash Function

Motivation

A Long Standing Open Problem : Is the concatenation of twoindependent hash values more secure than a single hash-value ?

Cascading of hash function was proposed in the PhD thesis ofB.Preneel to increase the security.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf /2+ng/2 collision resistant secure.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf +ng pre image and second pre image secure.

Joux Attack [1]

Collision : q ≈ ng × 2nf /2 + 2ng/2 if nf ≤ ng (respectivelynf × 2ng/2 + 2nf /2 if nf ≥ ng ).

Pre-Image and Second-Pre-Image : q ≈ ng × 2nf /2 + 2nf + 2ng ifnf ≤ ng (respectively nf × 2ng/2 + 2ng + 2nf if nf ≥ ng )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 18 / 47

Page 62: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

CR, PR and 2-PR on the Cascading Hash Function

Motivation

A Long Standing Open Problem : Is the concatenation of twoindependent hash values more secure than a single hash-value ?

Cascading of hash function was proposed in the PhD thesis ofB.Preneel to increase the security.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf /2+ng/2 collision resistant secure.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf +ng pre image and second pre image secure.

Joux Attack [1]

Collision : q ≈ ng × 2nf /2 + 2ng/2 if nf ≤ ng (respectivelynf × 2ng/2 + 2nf /2 if nf ≥ ng ).

Pre-Image and Second-Pre-Image : q ≈ ng × 2nf /2 + 2nf + 2ng ifnf ≤ ng (respectively nf × 2ng/2 + 2ng + 2nf if nf ≥ ng )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 18 / 47

Page 63: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

CR, PR and 2-PR on the Cascading Hash Function

Motivation

A Long Standing Open Problem : Is the concatenation of twoindependent hash values more secure than a single hash-value ?

Cascading of hash function was proposed in the PhD thesis ofB.Preneel to increase the security.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf /2+ng/2 collision resistant secure.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf +ng pre image and second pre image secure.

Joux Attack [1]

Collision : q ≈ ng × 2nf /2 + 2ng/2 if nf ≤ ng (respectivelynf × 2ng/2 + 2nf /2 if nf ≥ ng ).

Pre-Image and Second-Pre-Image : q ≈ ng × 2nf /2 + 2nf + 2ng ifnf ≤ ng (respectively nf × 2ng/2 + 2ng + 2nf if nf ≥ ng )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 18 / 47

Page 64: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

CR, PR and 2-PR on the Cascading Hash Function

Motivation

A Long Standing Open Problem : Is the concatenation of twoindependent hash values more secure than a single hash-value ?

Cascading of hash function was proposed in the PhD thesis ofB.Preneel to increase the security.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf /2+ng/2 collision resistant secure.

If F and G are two hash functions output nf and ng bits respectively,then F ||G seems to be 2nf +ng pre image and second pre image secure.

Joux Attack [1]

Collision : q ≈ ng × 2nf /2 + 2ng/2 if nf ≤ ng (respectivelynf × 2ng/2 + 2nf /2 if nf ≥ ng ).

Pre-Image and Second-Pre-Image : q ≈ ng × 2nf /2 + 2nf + 2ng ifnf ≤ ng (respectively nf × 2ng/2 + 2ng + 2nf if nf ≥ ng )

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 18 / 47

Page 65: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Collision-Resistance on the Cascading Hash Function

Attack Algorithm (Case nf ≤ ng )

set t to ng/2

Construct 2t multi collision for F . This would cost tot2nf /2 = ng/2× 2nf /2.

Since t ≥ ng 2, out of 2t = 2ng/2 messages there exists at least a pairof message collides for H.

Total query complexity q ≈ ng/2× 2nf /2 + 2ng/2 ≤ 2nf /2+ng/2.

Remark

Finding collision for H requires t × 2t evaluation of the compressionfunction of H. But due to the tree structure of 2t messages, it requires 2t

evaluatios of the compression function of H.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 19 / 47

Page 66: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Collision-Resistance on the Cascading Hash Function

Attack Algorithm (Case nf ≤ ng )

set t to ng/2

Construct 2t multi collision for F . This would cost tot2nf /2 = ng/2× 2nf /2.

Since t ≥ ng 2, out of 2t = 2ng/2 messages there exists at least a pairof message collides for H.

Total query complexity q ≈ ng/2× 2nf /2 + 2ng/2 ≤ 2nf /2+ng/2.

Remark

Finding collision for H requires t × 2t evaluation of the compressionfunction of H. But due to the tree structure of 2t messages, it requires 2t

evaluatios of the compression function of H.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 19 / 47

Page 67: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Collision-Resistance on the Cascading Hash Function

Attack Algorithm (Case nf ≤ ng )

set t to ng/2

Construct 2t multi collision for F . This would cost tot2nf /2 = ng/2× 2nf /2.

Since t ≥ ng 2, out of 2t = 2ng/2 messages there exists at least a pairof message collides for H.

Total query complexity q ≈ ng/2× 2nf /2 + 2ng/2 ≤ 2nf /2+ng/2.

Remark

Finding collision for H requires t × 2t evaluation of the compressionfunction of H. But due to the tree structure of 2t messages, it requires 2t

evaluatios of the compression function of H.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 19 / 47

Page 68: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Collision-Resistance on the Cascading Hash Function

Attack Algorithm (Case nf ≤ ng )

set t to ng/2

Construct 2t multi collision for F . This would cost tot2nf /2 = ng/2× 2nf /2.

Since t ≥ ng 2, out of 2t = 2ng/2 messages there exists at least a pairof message collides for H.

Total query complexity q ≈ ng/2× 2nf /2 + 2ng/2 ≤ 2nf /2+ng/2.

Remark

Finding collision for H requires t × 2t evaluation of the compressionfunction of H. But due to the tree structure of 2t messages, it requires 2t

evaluatios of the compression function of H.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 19 / 47

Page 69: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Collision-Resistance on the Cascading Hash Function

Attack Algorithm (Case nf ≤ ng )

set t to ng/2

Construct 2t multi collision for F . This would cost tot2nf /2 = ng/2× 2nf /2.

Since t ≥ ng 2, out of 2t = 2ng/2 messages there exists at least a pairof message collides for H.

Total query complexity q ≈ ng/2× 2nf /2 + 2ng/2 ≤ 2nf /2+ng/2.

Remark

Finding collision for H requires t × 2t evaluation of the compressionfunction of H. But due to the tree structure of 2t messages, it requires 2t

evaluatios of the compression function of H.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 19 / 47

Page 70: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Collision-Resistance on the Cascading Hash Function

Note

In this attack G is not neccessarily to be a iterated hash function

One can replace G with random oracle and the same attack will applywith the same query complexity

Cascading two good independent hash functions does not improve thecollision resistance.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 20 / 47

Page 71: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Collision-Resistance on the Cascading Hash Function

Note

In this attack G is not neccessarily to be a iterated hash function

One can replace G with random oracle and the same attack will applywith the same query complexity

Cascading two good independent hash functions does not improve thecollision resistance.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 20 / 47

Page 72: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Collision-Resistance on the Cascading Hash Function

Note

In this attack G is not neccessarily to be a iterated hash function

One can replace G with random oracle and the same attack will applywith the same query complexity

Cascading two good independent hash functions does not improve thecollision resistance.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 20 / 47

Page 73: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Pre-Image and Second-Pre-Image on the Cascading HashFunction

Attack Algorithmset t to ng

Construct 2t multi collision for F . This would cost tot2nf /2 = ng × 2nf /2.

Search for an additional block that maps to target value of F . Thiswould require 2nf call to the compression function of F .

Since t ≥ ng , out of 2t = 2ng messages there exists at least onemessage with probability 1 that hashes to the target value of H.

Return the message.

Total query complexity q ≈ ng × 2nf /2 + 2nf + 2ng ≤ 2nf +ng .

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 21 / 47

Page 74: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Pre-Image and Second-Pre-Image on the Cascading HashFunction

Attack Algorithmset t to ng

Construct 2t multi collision for F . This would cost tot2nf /2 = ng × 2nf /2.

Search for an additional block that maps to target value of F . Thiswould require 2nf call to the compression function of F .

Since t ≥ ng , out of 2t = 2ng messages there exists at least onemessage with probability 1 that hashes to the target value of H.

Return the message.

Total query complexity q ≈ ng × 2nf /2 + 2nf + 2ng ≤ 2nf +ng .

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 21 / 47

Page 75: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Pre-Image and Second-Pre-Image on the Cascading HashFunction

Attack Algorithmset t to ng

Construct 2t multi collision for F . This would cost tot2nf /2 = ng × 2nf /2.

Search for an additional block that maps to target value of F . Thiswould require 2nf call to the compression function of F .

Since t ≥ ng , out of 2t = 2ng messages there exists at least onemessage with probability 1 that hashes to the target value of H.

Return the message.

Total query complexity q ≈ ng × 2nf /2 + 2nf + 2ng ≤ 2nf +ng .

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 21 / 47

Page 76: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Pre-Image and Second-Pre-Image on the Cascading HashFunction

Attack Algorithmset t to ng

Construct 2t multi collision for F . This would cost tot2nf /2 = ng × 2nf /2.

Search for an additional block that maps to target value of F . Thiswould require 2nf call to the compression function of F .

Since t ≥ ng , out of 2t = 2ng messages there exists at least onemessage with probability 1 that hashes to the target value of H.

Return the message.

Total query complexity q ≈ ng × 2nf /2 + 2nf + 2ng ≤ 2nf +ng .

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 21 / 47

Page 77: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Pre-Image and Second-Pre-Image on the Cascading HashFunction

Attack Algorithmset t to ng

Construct 2t multi collision for F . This would cost tot2nf /2 = ng × 2nf /2.

Search for an additional block that maps to target value of F . Thiswould require 2nf call to the compression function of F .

Since t ≥ ng , out of 2t = 2ng messages there exists at least onemessage with probability 1 that hashes to the target value of H.

Return the message.

Total query complexity q ≈ ng × 2nf /2 + 2nf + 2ng ≤ 2nf +ng .

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 21 / 47

Page 78: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Pre-Image and Second-Pre-Image on the Cascading HashFunction

Attack Algorithmset t to ng

Construct 2t multi collision for F . This would cost tot2nf /2 = ng × 2nf /2.

Search for an additional block that maps to target value of F . Thiswould require 2nf call to the compression function of F .

Since t ≥ ng , out of 2t = 2ng messages there exists at least onemessage with probability 1 that hashes to the target value of H.

Return the message.

Total query complexity q ≈ ng × 2nf /2 + 2nf + 2ng ≤ 2nf +ng .

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 21 / 47

Page 79: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Pre-Image and Second-Pre-Image on Cascading HashFunction

Remark

G need not be iterated hash function. It could be replaced by randomoracle and the attack works !

Second-Pre-Image attack works in the same way.Attacker computesF ||G (M) and then invoke the attack algorithm with input F ||G (M)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 22 / 47

Page 80: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Pre-Image and Second-Pre-Image on Cascading HashFunction

Remark

G need not be iterated hash function. It could be replaced by randomoracle and the attack works !

Second-Pre-Image attack works in the same way.Attacker computesF ||G (M) and then invoke the attack algorithm with input F ||G (M)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 22 / 47

Page 81: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Finding 2nd preimage of a challenge message is soley based on the idea ofExpandable Message

Expandable Message

An Expandable Message is a pattern of messages of different lengthswhich all yield the same intermediate hash value after processing them

How to find a pair of colliding messages having unequal number ofmessage block. e.g. Find a colliding message pair (m,m′) such that|m| = 1 and |m′| = α

• Collision Finding Algorithm : FindColl(α, hin)

• # of compression function call : α− 1 + 2n/2+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 23 / 47

Page 82: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Finding 2nd preimage of a challenge message is soley based on the idea ofExpandable Message

Expandable Message

An Expandable Message is a pattern of messages of different lengthswhich all yield the same intermediate hash value after processing them

How to find a pair of colliding messages having unequal number ofmessage block. e.g. Find a colliding message pair (m,m′) such that|m| = 1 and |m′| = α

• Collision Finding Algorithm : FindColl(α, hin)

• # of compression function call : α− 1 + 2n/2+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 23 / 47

Page 83: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Finding 2nd preimage of a challenge message is soley based on the idea ofExpandable Message

Expandable Message

An Expandable Message is a pattern of messages of different lengthswhich all yield the same intermediate hash value after processing them

How to find a pair of colliding messages having unequal number ofmessage block. e.g. Find a colliding message pair (m,m′) such that|m| = 1 and |m′| = α

• Collision Finding Algorithm : FindColl(α, hin)

• # of compression function call : α− 1 + 2n/2+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 23 / 47

Page 84: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Finding 2nd preimage of a challenge message is soley based on the idea ofExpandable Message

Expandable Message

An Expandable Message is a pattern of messages of different lengthswhich all yield the same intermediate hash value after processing them

How to find a pair of colliding messages having unequal number ofmessage block. e.g. Find a colliding message pair (m,m′) such that|m| = 1 and |m′| = α

• Collision Finding Algorithm : FindColl(α, hin)

• # of compression function call : α− 1 + 2n/2+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 23 / 47

Page 85: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Finding 2nd preimage of a challenge message is soley based on the idea ofExpandable Message

Expandable Message

An Expandable Message is a pattern of messages of different lengthswhich all yield the same intermediate hash value after processing them

How to find a pair of colliding messages having unequal number ofmessage block. e.g. Find a colliding message pair (m,m′) such that|m| = 1 and |m′| = α

• Collision Finding Algorithm : FindColl(α, hin)

• # of compression function call : α− 1 + 2n/2+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 23 / 47

Page 86: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Finding 2nd preimage of a challenge message is soley based on the idea ofExpandable Message

Expandable Message

An Expandable Message is a pattern of messages of different lengthswhich all yield the same intermediate hash value after processing them

How to find a pair of colliding messages having unequal number ofmessage block. e.g. Find a colliding message pair (m,m′) such that|m| = 1 and |m′| = α

• Collision Finding Algorithm : FindColl(α, hin)

• # of compression function call : α− 1 + 2n/2+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 23 / 47

Page 87: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Building Full (k , k + 2k − 1) Expandable Message

• MakeExpandableMessage(hin, k)

• #. of compression function call : k × 2n/2+1 + 2k − 1.

Second Preimage attack

hexp be the internal hash chaining value of expandable message

Find Mlink such that f (hexp,Mlink) = hj , k + 1 ≤ j ≤ 2k + k − 1

Choose the expandable message M∗ of j blocks and returnM ∗ ||Mlink ||mj+1||mj+2|| . . . ||m2k+k−1

#. of compression function call : k × 2n/2+1 + 2n−k+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 24 / 47

Page 88: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Building Full (k , k + 2k − 1) Expandable Message

• MakeExpandableMessage(hin, k)

• #. of compression function call : k × 2n/2+1 + 2k − 1.

Second Preimage attack

hexp be the internal hash chaining value of expandable message

Find Mlink such that f (hexp,Mlink) = hj , k + 1 ≤ j ≤ 2k + k − 1

Choose the expandable message M∗ of j blocks and returnM ∗ ||Mlink ||mj+1||mj+2|| . . . ||m2k+k−1

#. of compression function call : k × 2n/2+1 + 2n−k+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 24 / 47

Page 89: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Building Full (k , k + 2k − 1) Expandable Message

• MakeExpandableMessage(hin, k)

• #. of compression function call : k × 2n/2+1 + 2k − 1.

Second Preimage attack

hexp be the internal hash chaining value of expandable message

Find Mlink such that f (hexp,Mlink) = hj , k + 1 ≤ j ≤ 2k + k − 1

Choose the expandable message M∗ of j blocks and returnM ∗ ||Mlink ||mj+1||mj+2|| . . . ||m2k+k−1

#. of compression function call : k × 2n/2+1 + 2n−k+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 24 / 47

Page 90: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Building Full (k , k + 2k − 1) Expandable Message

• MakeExpandableMessage(hin, k)

• #. of compression function call : k × 2n/2+1 + 2k − 1.

Second Preimage attack

hexp be the internal hash chaining value of expandable message

Find Mlink such that f (hexp,Mlink) = hj , k + 1 ≤ j ≤ 2k + k − 1

Choose the expandable message M∗ of j blocks and returnM ∗ ||Mlink ||mj+1||mj+2|| . . . ||m2k+k−1

#. of compression function call : k × 2n/2+1 + 2n−k+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 24 / 47

Page 91: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Building Full (k , k + 2k − 1) Expandable Message

• MakeExpandableMessage(hin, k)

• #. of compression function call : k × 2n/2+1 + 2k − 1.

Second Preimage attack

hexp be the internal hash chaining value of expandable message

Find Mlink such that f (hexp,Mlink) = hj , k + 1 ≤ j ≤ 2k + k − 1

Choose the expandable message M∗ of j blocks and returnM ∗ ||Mlink ||mj+1||mj+2|| . . . ||m2k+k−1

#. of compression function call : k × 2n/2+1 + 2n−k+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 24 / 47

Page 92: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Building Full (k , k + 2k − 1) Expandable Message

• MakeExpandableMessage(hin, k)

• #. of compression function call : k × 2n/2+1 + 2k − 1.

Second Preimage attack

hexp be the internal hash chaining value of expandable message

Find Mlink such that f (hexp,Mlink) = hj , k + 1 ≤ j ≤ 2k + k − 1

Choose the expandable message M∗ of j blocks and returnM ∗ ||Mlink ||mj+1||mj+2|| . . . ||m2k+k−1

#. of compression function call : k × 2n/2+1 + 2n−k+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 24 / 47

Page 93: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

2n

` Pre-Image Attack on Merkle Damgard Iterated HashFunction (Kelsey et al. [2].)

Building Full (k , k + 2k − 1) Expandable Message

• MakeExpandableMessage(hin, k)

• #. of compression function call : k × 2n/2+1 + 2k − 1.

Second Preimage attack

hexp be the internal hash chaining value of expandable message

Find Mlink such that f (hexp,Mlink) = hj , k + 1 ≤ j ≤ 2k + k − 1

Choose the expandable message M∗ of j blocks and returnM ∗ ||Mlink ||mj+1||mj+2|| . . . ||m2k+k−1

#. of compression function call : k × 2n/2+1 + 2n−k+1

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 24 / 47

Page 94: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Proof of 2n

` Second-Pre-Image Security of Merkle DamgardIterated Hash Function.

Theorem

Let f be a public random function and H f be the Merkle-DamgardIterated Hash Function. Let A be a second-preimage adversary (q, `, ε)breaks H f . Then,

ε ≤ q`

2n

.

Proof.

Given M, A will compute H f (M). Let hi0 be the chaining value,1 ≤ i0 ≤ ` for computing hash value of M. Success of A → Collision inH f . Let M ′ be the output of A : H f (M) = H f (M ′). We know, Collision inH f → Collision in hi0 , 1 ≤ i0 ≤ `.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 25 / 47

Page 95: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

HAIFA (A Framework for Iterative Hash Function) [1]

Given a compression function f : 0, 1s × 0, 1b × 0, 1c → 0, 1c , wedefine the iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (〈i〉s , hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 26 / 47

Page 96: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

HAIFA (A Framework for Iterative Hash Function) [1]

Given a compression function f : 0, 1s × 0, 1b × 0, 1c → 0, 1c , wedefine the iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (〈i〉s , hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 26 / 47

Page 97: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

HAIFA (A Framework for Iterative Hash Function) [1]

Given a compression function f : 0, 1s × 0, 1b × 0, 1c → 0, 1c , wedefine the iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (〈i〉s , hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 26 / 47

Page 98: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

HAIFA (A Framework for Iterative Hash Function) [1]

Given a compression function f : 0, 1s × 0, 1b × 0, 1c → 0, 1c , wedefine the iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (〈i〉s , hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 26 / 47

Page 99: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

HAIFA (A Framework for Iterative Hash Function) [1]

Given a compression function f : 0, 1s × 0, 1b × 0, 1c → 0, 1c , wedefine the iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (〈i〉s , hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 26 / 47

Page 100: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

HAIFA (A Framework for Iterative Hash Function) [1]

Given a compression function f : 0, 1s × 0, 1b × 0, 1c → 0, 1c , wedefine the iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (〈i〉s , hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 26 / 47

Page 101: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

HAIFA (A Framework for Iterative Hash Function) [1]

Given a compression function f : 0, 1s × 0, 1b × 0, 1c → 0, 1c , wedefine the iterated hash function as follows:

Given a message M ∈ 0, 1∗, if |M| 6= bk for some k , M ′ = M||〈l〉to make |M ′| = bk. Else M ′ = M.

Spilts the message M = (M1,M2, . . . ,M`) 3 |Mi | = b

Initialize h0 = IV ∈ 0, 1c a fixed publicly known value.

for i = 1 to `, hi = f (〈i〉s , hi−1,Mi )

Return h`

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 26 / 47

Page 102: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Proof of 2n Pre-Image Security of HAIFA [2]

Theorem

Let f be a public random function and H f be the HAIFA Iterated HashFunction. Let A be a preimage adversary (q, `, ε) breaks H f . Then,

ε ≤ q

2n

.

Proof.

A is given the challenge M and therefore A computes H f (M), storing allintermediate chaining values hi0 , 1 ≤ i0 ≤ `. Suppose A wins and outputsM ′.

when |M| 6= |M ′|, counter at the last invocation of the compressionfunctions are different.

When |M| = |M ′|, collision with the same counter value or collision inthe last invocation of the compression function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 27 / 47

Page 103: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Proof of 2n Pre-Image Security of HAIFA [2]

Theorem

Let f be a public random function and H f be the HAIFA Iterated HashFunction. Let A be a preimage adversary (q, `, ε) breaks H f . Then,

ε ≤ q

2n

.

Proof.

A is given the challenge M and therefore A computes H f (M), storing allintermediate chaining values hi0 , 1 ≤ i0 ≤ `. Suppose A wins and outputsM ′.

when |M| 6= |M ′|, counter at the last invocation of the compressionfunctions are different.

When |M| = |M ′|, collision with the same counter value or collision inthe last invocation of the compression function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 27 / 47

Page 104: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Proof of 2n Pre-Image Security of HAIFA [2]

Theorem

Let f be a public random function and H f be the HAIFA Iterated HashFunction. Let A be a preimage adversary (q, `, ε) breaks H f . Then,

ε ≤ q

2n

.

Proof.

A is given the challenge M and therefore A computes H f (M), storing allintermediate chaining values hi0 , 1 ≤ i0 ≤ `. Suppose A wins and outputsM ′.

when |M| 6= |M ′|, counter at the last invocation of the compressionfunctions are different.

When |M| = |M ′|, collision with the same counter value or collision inthe last invocation of the compression function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 27 / 47

Page 105: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Proof of 2n Pre-Image Security of HAIFA [2]

Theorem

Let f be a public random function and H f be the HAIFA Iterated HashFunction. Let A be a preimage adversary (q, `, ε) breaks H f . Then,

ε ≤ q

2n

.

Proof.

A is given the challenge M and therefore A computes H f (M), storing allintermediate chaining values hi0 , 1 ≤ i0 ≤ `. Suppose A wins and outputsM ′.

when |M| 6= |M ′|, counter at the last invocation of the compressionfunctions are different.

When |M| = |M ′|, collision with the same counter value or collision inthe last invocation of the compression function.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 27 / 47

Page 106: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Related Notion of Hash Function

ε-Universal Hash Function

• A hash family H is called ε-universal (or ε-U) ifmaxx 6=x ′ PrK[hK(x) = hK(x ′)] ≤ ε.

ε-AXU-Universal Hash Function

• A (K,D)-family H is called ε-Almost-XOR Universal hash function, iffor any two distinct x and x ′ in D and a δ ∈ 0, 1n, the δ-differentialprobability Prk [hk(x)⊕ hk(x ′) = δ] ≤ ε where the random variable k isuniformly distributed over the set K.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 28 / 47

Page 107: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Related Notion of Hash Function

ε-Universal Hash Function

• A hash family H is called ε-universal (or ε-U) ifmaxx 6=x ′ PrK[hK(x) = hK(x ′)] ≤ ε.

ε-AXU-Universal Hash Function

• A (K,D)-family H is called ε-Almost-XOR Universal hash function, iffor any two distinct x and x ′ in D and a δ ∈ 0, 1n, the δ-differentialprobability Prk [hk(x)⊕ hk(x ′) = δ] ≤ ε where the random variable k isuniformly distributed over the set K.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 28 / 47

Page 108: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Related Notion of Hash Function

ε-Universal Hash Function

• A hash family H is called ε-universal (or ε-U) ifmaxx 6=x ′ PrK[hK(x) = hK(x ′)] ≤ ε.

ε-AXU-Universal Hash Function

• A (K,D)-family H is called ε-Almost-XOR Universal hash function, iffor any two distinct x and x ′ in D and a δ ∈ 0, 1n, the δ-differentialprobability Prk [hk(x)⊕ hk(x ′) = δ] ≤ ε where the random variable k isuniformly distributed over the set K.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 28 / 47

Page 109: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Symmetric Key Cryptography : Message Authentication Code (MAC)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 29 / 47

Page 110: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

MAC used in Communication

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 30 / 47

Page 111: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Definition of MAC

A Message Authentication Code (MAC) scheme Π, defined over K,M, Tis a pair of algorithms (TG,VF) (possibly probabilistic) such that :

1 TF is an (possibly probabilistic) algorithm from K ×M→ T2 VG is a deterministic algorithm from K ×M× T → 0, 1

Correctness Condition : ∀k ∈ K,∀m ∈M and ∀t ∈ T withPr[TG(k,m) = t] > 0 such that VG(k,m, t) = 1

• Note: If TG is deterministic algorithm then the MAC is said to bedeterministic MAC, otherwise it is called Probabilistic MAC

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 31 / 47

Page 112: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Definition of MAC

A Message Authentication Code (MAC) scheme Π, defined over K,M, Tis a pair of algorithms (TG,VF) (possibly probabilistic) such that :

1 TF is an (possibly probabilistic) algorithm from K ×M→ T

2 VG is a deterministic algorithm from K ×M× T → 0, 1Correctness Condition : ∀k ∈ K,∀m ∈M and ∀t ∈ T withPr[TG(k,m) = t] > 0 such that VG(k,m, t) = 1

• Note: If TG is deterministic algorithm then the MAC is said to bedeterministic MAC, otherwise it is called Probabilistic MAC

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 31 / 47

Page 113: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Definition of MAC

A Message Authentication Code (MAC) scheme Π, defined over K,M, Tis a pair of algorithms (TG,VF) (possibly probabilistic) such that :

1 TF is an (possibly probabilistic) algorithm from K ×M→ T2 VG is a deterministic algorithm from K ×M× T → 0, 1

Correctness Condition : ∀k ∈ K,∀m ∈M and ∀t ∈ T withPr[TG(k,m) = t] > 0 such that VG(k,m, t) = 1

• Note: If TG is deterministic algorithm then the MAC is said to bedeterministic MAC, otherwise it is called Probabilistic MAC

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 31 / 47

Page 114: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Definition of MAC

A Message Authentication Code (MAC) scheme Π, defined over K,M, Tis a pair of algorithms (TG,VF) (possibly probabilistic) such that :

1 TF is an (possibly probabilistic) algorithm from K ×M→ T2 VG is a deterministic algorithm from K ×M× T → 0, 1

Correctness Condition : ∀k ∈ K,∀m ∈M and ∀t ∈ T withPr[TG(k,m) = t] > 0 such that VG(k,m, t) = 1

• Note: If TG is deterministic algorithm then the MAC is said to bedeterministic MAC, otherwise it is called Probabilistic MAC

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 31 / 47

Page 115: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Definition of MAC

A Message Authentication Code (MAC) scheme Π, defined over K,M, Tis a pair of algorithms (TG,VF) (possibly probabilistic) such that :

1 TF is an (possibly probabilistic) algorithm from K ×M→ T2 VG is a deterministic algorithm from K ×M× T → 0, 1

Correctness Condition : ∀k ∈ K,∀m ∈M and ∀t ∈ T withPr[TG(k,m) = t] > 0 such that VG(k,m, t) = 1

• Note: If TG is deterministic algorithm then the MAC is said to bedeterministic MAC, otherwise it is called Probabilistic MAC

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 31 / 47

Page 116: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Security Game of MAC

Power of the Adversary with respect to attacking MAC: AdaptiveChosen Message Attack

A queries the MAC oracle with messages mi and the oracle returns thevalid tag ti = F (k ,mi ) ∀1 ≤ i ≤ q.

Goal of the Adversary : Existential Forgery

A produces a valid (m∗, t∗) pair such that m∗ /∈ m1, . . . ,mq andV (k ,m∗, t∗) = 1

Adv A wins if m∗ /∈ m1,m2, . . . ,mq and Vrfy(m∗, t∗) = 1.

Advmac(A) := Pr[A wins the game ]

Advmac(q, `, t) := maxAAdvmac(A)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 32 / 47

Page 117: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Security Game of MAC

Power of the Adversary with respect to attacking MAC: AdaptiveChosen Message Attack

A queries the MAC oracle with messages mi and the oracle returns thevalid tag ti = F (k ,mi ) ∀1 ≤ i ≤ q.

Goal of the Adversary : Existential Forgery

A produces a valid (m∗, t∗) pair such that m∗ /∈ m1, . . . ,mq andV (k ,m∗, t∗) = 1

Adv A wins if m∗ /∈ m1,m2, . . . ,mq and Vrfy(m∗, t∗) = 1.

Advmac(A) := Pr[A wins the game ]

Advmac(q, `, t) := maxAAdvmac(A)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 32 / 47

Page 118: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Security Game of MAC

Power of the Adversary with respect to attacking MAC: AdaptiveChosen Message Attack

A queries the MAC oracle with messages mi and the oracle returns thevalid tag ti = F (k ,mi ) ∀1 ≤ i ≤ q.

Goal of the Adversary : Existential Forgery

A produces a valid (m∗, t∗) pair such that m∗ /∈ m1, . . . ,mq andV (k ,m∗, t∗) = 1

Adv A wins if m∗ /∈ m1,m2, . . . ,mq and Vrfy(m∗, t∗) = 1.

Advmac(A) := Pr[A wins the game ]

Advmac(q, `, t) := maxAAdvmac(A)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 32 / 47

Page 119: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Security Game of MAC

Power of the Adversary with respect to attacking MAC: AdaptiveChosen Message Attack

A queries the MAC oracle with messages mi and the oracle returns thevalid tag ti = F (k ,mi ) ∀1 ≤ i ≤ q.

Goal of the Adversary : Existential Forgery

A produces a valid (m∗, t∗) pair such that m∗ /∈ m1, . . . ,mq andV (k ,m∗, t∗) = 1

Adv A wins if m∗ /∈ m1,m2, . . . ,mq and Vrfy(m∗, t∗) = 1.

Advmac(A) := Pr[A wins the game ]

Advmac(q, `, t) := maxAAdvmac(A)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 32 / 47

Page 120: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Security Game of MAC

Power of the Adversary with respect to attacking MAC: AdaptiveChosen Message Attack

A queries the MAC oracle with messages mi and the oracle returns thevalid tag ti = F (k ,mi ) ∀1 ≤ i ≤ q.

Goal of the Adversary : Existential Forgery

A produces a valid (m∗, t∗) pair such that m∗ /∈ m1, . . . ,mq andV (k ,m∗, t∗) = 1

Adv A wins if m∗ /∈ m1,m2, . . . ,mq and Vrfy(m∗, t∗) = 1.

Advmac(A) := Pr[A wins the game ]

Advmac(q, `, t) := maxAAdvmac(A)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 32 / 47

Page 121: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

More Definitions Related to MAC

Stateful MAC : Holds the state and with each message update thestate. (Nonce based MAC)(e.g XMACC)

Stateless MAC : Doesn’t require to hold any state (e.g, XMACR,LightMAC, CBC, HMAC)

Single Forgery : A will be allowed to submit only one verificationquery.

Multiple Forgery : A will be allowed to submit multiple verificationquery and MAC queries, verification queries are interleaved.

Weak Unforgeability : If A queries MAC oracle with M, then itcannot submit M to the verification oracle.

Strong unforgeability : If A queries to MAC oracle with M, it can alsosubmit M to the verification oracle

Result

UF-1 ; UF-M. But in Stronger Unforgeability model SUF-1 ⇐⇒ SUF-Mdue to Bellare et al. [3]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 33 / 47

Page 122: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

More Definitions Related to MAC

Stateful MAC : Holds the state and with each message update thestate. (Nonce based MAC)(e.g XMACC)

Stateless MAC : Doesn’t require to hold any state (e.g, XMACR,LightMAC, CBC, HMAC)

Single Forgery : A will be allowed to submit only one verificationquery.

Multiple Forgery : A will be allowed to submit multiple verificationquery and MAC queries, verification queries are interleaved.

Weak Unforgeability : If A queries MAC oracle with M, then itcannot submit M to the verification oracle.

Strong unforgeability : If A queries to MAC oracle with M, it can alsosubmit M to the verification oracle

Result

UF-1 ; UF-M. But in Stronger Unforgeability model SUF-1 ⇐⇒ SUF-Mdue to Bellare et al. [3]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 33 / 47

Page 123: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

More Definitions Related to MAC

Stateful MAC : Holds the state and with each message update thestate. (Nonce based MAC)(e.g XMACC)

Stateless MAC : Doesn’t require to hold any state (e.g, XMACR,LightMAC, CBC, HMAC)

Single Forgery : A will be allowed to submit only one verificationquery.

Multiple Forgery : A will be allowed to submit multiple verificationquery and MAC queries, verification queries are interleaved.

Weak Unforgeability : If A queries MAC oracle with M, then itcannot submit M to the verification oracle.

Strong unforgeability : If A queries to MAC oracle with M, it can alsosubmit M to the verification oracle

Result

UF-1 ; UF-M. But in Stronger Unforgeability model SUF-1 ⇐⇒ SUF-Mdue to Bellare et al. [3]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 33 / 47

Page 124: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

More Definitions Related to MAC

Stateful MAC : Holds the state and with each message update thestate. (Nonce based MAC)(e.g XMACC)

Stateless MAC : Doesn’t require to hold any state (e.g, XMACR,LightMAC, CBC, HMAC)

Single Forgery : A will be allowed to submit only one verificationquery.

Multiple Forgery : A will be allowed to submit multiple verificationquery and MAC queries, verification queries are interleaved.

Weak Unforgeability : If A queries MAC oracle with M, then itcannot submit M to the verification oracle.

Strong unforgeability : If A queries to MAC oracle with M, it can alsosubmit M to the verification oracle

Result

UF-1 ; UF-M. But in Stronger Unforgeability model SUF-1 ⇐⇒ SUF-Mdue to Bellare et al. [3]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 33 / 47

Page 125: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

More Definitions Related to MAC

Stateful MAC : Holds the state and with each message update thestate. (Nonce based MAC)(e.g XMACC)

Stateless MAC : Doesn’t require to hold any state (e.g, XMACR,LightMAC, CBC, HMAC)

Single Forgery : A will be allowed to submit only one verificationquery.

Multiple Forgery : A will be allowed to submit multiple verificationquery and MAC queries, verification queries are interleaved.

Weak Unforgeability : If A queries MAC oracle with M, then itcannot submit M to the verification oracle.

Strong unforgeability : If A queries to MAC oracle with M, it can alsosubmit M to the verification oracle

Result

UF-1 ; UF-M. But in Stronger Unforgeability model SUF-1 ⇐⇒ SUF-Mdue to Bellare et al. [3]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 33 / 47

Page 126: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

More Definitions Related to MAC

Stateful MAC : Holds the state and with each message update thestate. (Nonce based MAC)(e.g XMACC)

Stateless MAC : Doesn’t require to hold any state (e.g, XMACR,LightMAC, CBC, HMAC)

Single Forgery : A will be allowed to submit only one verificationquery.

Multiple Forgery : A will be allowed to submit multiple verificationquery and MAC queries, verification queries are interleaved.

Weak Unforgeability : If A queries MAC oracle with M, then itcannot submit M to the verification oracle.

Strong unforgeability : If A queries to MAC oracle with M, it can alsosubmit M to the verification oracle

Result

UF-1 ; UF-M. But in Stronger Unforgeability model SUF-1 ⇐⇒ SUF-Mdue to Bellare et al. [3]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 33 / 47

Page 127: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

More Definitions Related to MAC

Stateful MAC : Holds the state and with each message update thestate. (Nonce based MAC)(e.g XMACC)

Stateless MAC : Doesn’t require to hold any state (e.g, XMACR,LightMAC, CBC, HMAC)

Single Forgery : A will be allowed to submit only one verificationquery.

Multiple Forgery : A will be allowed to submit multiple verificationquery and MAC queries, verification queries are interleaved.

Weak Unforgeability : If A queries MAC oracle with M, then itcannot submit M to the verification oracle.

Strong unforgeability : If A queries to MAC oracle with M, it can alsosubmit M to the verification oracle

Result

UF-1 ; UF-M. But in Stronger Unforgeability model SUF-1 ⇐⇒ SUF-Mdue to Bellare et al. [3]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 33 / 47

Page 128: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

UF-1 ; UF-M (Bellare et al. [3])

• Π1 = (KG,TG,VG) be a MAC

• Construct Π2 = (KG,TG′,VG

′) be a MAC which is UF-1 but not UF-M

Tag-generation

1 On querym, t ← TGk(m)

2 t ′ ← t||〈0〉3 return t ′.

Verification

1 On a query (m, t′)

2 Parse t′

into t′ ||〈i〉, where

i ∈ 0, 1, . . . , |k |3 b ← VFk(m, t)

4 if b = 0 or i = 0, return b

5 if b = 1 and i ≥ 1, return k[i ]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 34 / 47

Page 129: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

UF-1 ; UF-M (Bellare et al. [3])

• Π1 = (KG,TG,VG) be a MAC

• Construct Π2 = (KG,TG′,VG

′) be a MAC which is UF-1 but not UF-M

Tag-generation

1 On querym, t ← TGk(m)

2 t ′ ← t||〈0〉3 return t ′.

Verification

1 On a query (m, t′)

2 Parse t′

into t′ ||〈i〉, where

i ∈ 0, 1, . . . , |k |3 b ← VFk(m, t)

4 if b = 0 or i = 0, return b

5 if b = 1 and i ≥ 1, return k[i ]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 34 / 47

Page 130: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

UF-1 ; UF-M (Bellare et al. [3])

• Π1 = (KG,TG,VG) be a MAC

• Construct Π2 = (KG,TG′,VG

′) be a MAC which is UF-1 but not UF-M

Tag-generation

1 On querym, t ← TGk(m)

2 t ′ ← t||〈0〉3 return t ′.

Verification

1 On a query (m, t′)

2 Parse t′

into t′ ||〈i〉, where

i ∈ 0, 1, . . . , |k |3 b ← VFk(m, t)

4 if b = 0 or i = 0, return b

5 if b = 1 and i ≥ 1, return k[i ]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 34 / 47

Page 131: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

UF-1 ; UF-M (Bellare et al. [3])

• Π1 = (KG,TG,VG) be a MAC

• Construct Π2 = (KG,TG′,VG

′) be a MAC which is UF-1 but not UF-M

Tag-generation

1 On querym, t ← TGk(m)

2 t ′ ← t||〈0〉3 return t ′.

Verification

1 On a query (m, t′)

2 Parse t′

into t′ ||〈i〉, where

i ∈ 0, 1, . . . , |k |3 b ← VFk(m, t)

4 if b = 0 or i = 0, return b

5 if b = 1 and i ≥ 1, return k[i ]

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 34 / 47

Page 132: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

UF-1 ; UF-M (Bellare et al. [3])

Attack

A submits m, obtains t ← TG′k(m)

for i = 0 to |k | − 1 do

A constructs t = t||〈i〉A queries (m, t) to the verification oracle

A obtains k[i ]

Endfor

A recovers the whole key k .

A constructs a new (m, t) pair and forge with probability 1.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 35 / 47

Page 133: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Types of MAC

Probabilistic and Stateless MAC (e.g, XMACR, RMAC, EhtM etc.)

Deterministic and Stateless MAC (e.g CBC-MAC, PMAC, LightMAC,PCS etc)

Deterministic and Stateful MAC (e.g XMACC, Carter-Wegman MAC)

Probabilistic and Stateful MAC (not useful in practice)

Note: We only discuss about Case (2).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 36 / 47

Page 134: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Types of MAC

Probabilistic and Stateless MAC (e.g, XMACR, RMAC, EhtM etc.)

Deterministic and Stateless MAC (e.g CBC-MAC, PMAC, LightMAC,PCS etc)

Deterministic and Stateful MAC (e.g XMACC, Carter-Wegman MAC)

Probabilistic and Stateful MAC (not useful in practice)

Note: We only discuss about Case (2).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 36 / 47

Page 135: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Types of MAC

Probabilistic and Stateless MAC (e.g, XMACR, RMAC, EhtM etc.)

Deterministic and Stateless MAC (e.g CBC-MAC, PMAC, LightMAC,PCS etc)

Deterministic and Stateful MAC (e.g XMACC, Carter-Wegman MAC)

Probabilistic and Stateful MAC (not useful in practice)

Note: We only discuss about Case (2).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 36 / 47

Page 136: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Types of MAC

Probabilistic and Stateless MAC (e.g, XMACR, RMAC, EhtM etc.)

Deterministic and Stateless MAC (e.g CBC-MAC, PMAC, LightMAC,PCS etc)

Deterministic and Stateful MAC (e.g XMACC, Carter-Wegman MAC)

Probabilistic and Stateful MAC (not useful in practice)

Note: We only discuss about Case (2).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 36 / 47

Page 137: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Types of MAC

Probabilistic and Stateless MAC (e.g, XMACR, RMAC, EhtM etc.)

Deterministic and Stateless MAC (e.g CBC-MAC, PMAC, LightMAC,PCS etc)

Deterministic and Stateful MAC (e.g XMACC, Carter-Wegman MAC)

Probabilistic and Stateful MAC (not useful in practice)

Note: We only discuss about Case (2).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 36 / 47

Page 138: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Types of MAC

Probabilistic and Stateless MAC (e.g, XMACR, RMAC, EhtM etc.)

Deterministic and Stateless MAC (e.g CBC-MAC, PMAC, LightMAC,PCS etc)

Deterministic and Stateful MAC (e.g XMACC, Carter-Wegman MAC)

Probabilistic and Stateful MAC (not useful in practice)

Note: We only discuss about Case (2).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 36 / 47

Page 139: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

How to design a secure-MAC

Can a secure Hash Function be used as a MAC ?

Theorem

Let F : K × X → Y be a secure PRF. We define MAC = (S, V) as follows: S(k ,m) = F (k ,m) and V (k ,m, t) = 1 if t = S(k ,m) else

V (k ,m, t) = 0. Then, AdvmacF (q, `, t) ≤ AdvprfF (q, `, t) + 1

|Y | .

Proof.

Proof is by Reduction Game

Corollary

To design a secure MAC, it is enough to design a secure PRF. That meansif the distinguishability advantage of PRF is negligible then as 1

|Y | isnegligible the MAC advantage would be negligible

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 37 / 47

Page 140: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

How to design a secure-MAC

Can a secure Hash Function be used as a MAC ?

Theorem

Let F : K × X → Y be a secure PRF. We define MAC = (S, V) as follows: S(k ,m) = F (k ,m) and V (k ,m, t) = 1 if t = S(k ,m) else

V (k ,m, t) = 0. Then, AdvmacF (q, `, t) ≤ AdvprfF (q, `, t) + 1

|Y | .

Proof.

Proof is by Reduction Game

Corollary

To design a secure MAC, it is enough to design a secure PRF. That meansif the distinguishability advantage of PRF is negligible then as 1

|Y | isnegligible the MAC advantage would be negligible

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 37 / 47

Page 141: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

How to design a secure-MAC

Can a secure Hash Function be used as a MAC ?

Theorem

Let F : K × X → Y be a secure PRF. We define MAC = (S, V) as follows: S(k ,m) = F (k ,m) and V (k ,m, t) = 1 if t = S(k ,m) else

V (k ,m, t) = 0. Then, AdvmacF (q, `, t) ≤ AdvprfF (q, `, t) + 1

|Y | .

Proof.

Proof is by Reduction Game

Corollary

To design a secure MAC, it is enough to design a secure PRF. That meansif the distinguishability advantage of PRF is negligible then as 1

|Y | isnegligible the MAC advantage would be negligible

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 37 / 47

Page 142: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

How to design a secure-MAC

Can a secure Hash Function be used as a MAC ?

Theorem

Let F : K × X → Y be a secure PRF. We define MAC = (S, V) as follows: S(k ,m) = F (k ,m) and V (k ,m, t) = 1 if t = S(k ,m) else

V (k ,m, t) = 0. Then, AdvmacF (q, `, t) ≤ AdvprfF (q, `, t) + 1

|Y | .

Proof.

Proof is by Reduction Game

Corollary

To design a secure MAC, it is enough to design a secure PRF. That meansif the distinguishability advantage of PRF is negligible then as 1

|Y | isnegligible the MAC advantage would be negligible

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 37 / 47

Page 143: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Are these constructions secure PRF ?

Secure PRF ?/ Secure MAC ?

Let f , g be two random functions and h be a hash function. We ask thefollowing :

Ff (r ,m) = f (r)⊕m

Ff ,g (r ,m) = f (r)⊕ g(m)

Ff ,h(r ,m) = f (r)⊕ h(m)

Ff ,g ,h(r ,m) = f (r)⊕ g(h(m))

Ff ,g (r ,m) = f (r)⊕ g(r ⊕m)

Ff ,g ,h(r ,m) = f (r)⊕ g(r ⊕ h(m)).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 38 / 47

Page 144: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Are these constructions secure PRF ?

Secure PRF ?/ Secure MAC ?

Let f , g be two random functions and h be a hash function. We ask thefollowing :

Ff (r ,m) = f (r)⊕m

Ff ,g (r ,m) = f (r)⊕ g(m)

Ff ,h(r ,m) = f (r)⊕ h(m)

Ff ,g ,h(r ,m) = f (r)⊕ g(h(m))

Ff ,g (r ,m) = f (r)⊕ g(r ⊕m)

Ff ,g ,h(r ,m) = f (r)⊕ g(r ⊕ h(m)).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 38 / 47

Page 145: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Are these constructions secure PRF ?

Secure PRF ?/ Secure MAC ?

Let f , g be two random functions and h be a hash function. We ask thefollowing :

Ff (r ,m) = f (r)⊕m

Ff ,g (r ,m) = f (r)⊕ g(m)

Ff ,h(r ,m) = f (r)⊕ h(m)

Ff ,g ,h(r ,m) = f (r)⊕ g(h(m))

Ff ,g (r ,m) = f (r)⊕ g(r ⊕m)

Ff ,g ,h(r ,m) = f (r)⊕ g(r ⊕ h(m)).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 38 / 47

Page 146: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Are these constructions secure PRF ?

Secure PRF ?/ Secure MAC ?

Let f , g be two random functions and h be a hash function. We ask thefollowing :

Ff (r ,m) = f (r)⊕m

Ff ,g (r ,m) = f (r)⊕ g(m)

Ff ,h(r ,m) = f (r)⊕ h(m)

Ff ,g ,h(r ,m) = f (r)⊕ g(h(m))

Ff ,g (r ,m) = f (r)⊕ g(r ⊕m)

Ff ,g ,h(r ,m) = f (r)⊕ g(r ⊕ h(m)).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 38 / 47

Page 147: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Are these constructions secure PRF ?

Secure PRF ?/ Secure MAC ?

Let f , g be two random functions and h be a hash function. We ask thefollowing :

Ff (r ,m) = f (r)⊕m

Ff ,g (r ,m) = f (r)⊕ g(m)

Ff ,h(r ,m) = f (r)⊕ h(m)

Ff ,g ,h(r ,m) = f (r)⊕ g(h(m))

Ff ,g (r ,m) = f (r)⊕ g(r ⊕m)

Ff ,g ,h(r ,m) = f (r)⊕ g(r ⊕ h(m)).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 38 / 47

Page 148: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Are these constructions secure PRF ?

Secure PRF ?/ Secure MAC ?

Let f , g be two random functions and h be a hash function. We ask thefollowing :

Ff (r ,m) = f (r)⊕m

Ff ,g (r ,m) = f (r)⊕ g(m)

Ff ,h(r ,m) = f (r)⊕ h(m)

Ff ,g ,h(r ,m) = f (r)⊕ g(h(m))

Ff ,g (r ,m) = f (r)⊕ g(r ⊕m)

Ff ,g ,h(r ,m) = f (r)⊕ g(r ⊕ h(m)).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 38 / 47

Page 149: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Are these constructions secure PRF ?

Secure PRF ?/ Secure MAC ?

Let f , g be two random functions and h be a hash function. We ask thefollowing :

Ff (r ,m) = f (r)⊕m

Ff ,g (r ,m) = f (r)⊕ g(m)

Ff ,h(r ,m) = f (r)⊕ h(m)

Ff ,g ,h(r ,m) = f (r)⊕ g(h(m))

Ff ,g (r ,m) = f (r)⊕ g(r ⊕m)

Ff ,g ,h(r ,m) = f (r)⊕ g(r ⊕ h(m)).

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 38 / 47

Page 150: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Approaches of Different Constructions

Mainly, three types of approaches of MAC constructions exists

Universal Hash Based MAC Construction (e.g UMAC)

Compression Function Based MAC Construction (e.g HMAC)

Iterated Block Cipher Based MAC Construction (e.g CBC-MAC,PMAC, CMAC, GCBC etc.)

Note: We discuss here only two candidates : (a) HMAC and (b)CBC-MAC

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 39 / 47

Page 151: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Approaches of Different Constructions

Mainly, three types of approaches of MAC constructions exists

Universal Hash Based MAC Construction (e.g UMAC)

Compression Function Based MAC Construction (e.g HMAC)

Iterated Block Cipher Based MAC Construction (e.g CBC-MAC,PMAC, CMAC, GCBC etc.)

Note: We discuss here only two candidates : (a) HMAC and (b)CBC-MAC

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 39 / 47

Page 152: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Approaches of Different Constructions

Mainly, three types of approaches of MAC constructions exists

Universal Hash Based MAC Construction (e.g UMAC)

Compression Function Based MAC Construction (e.g HMAC)

Iterated Block Cipher Based MAC Construction (e.g CBC-MAC,PMAC, CMAC, GCBC etc.)

Note: We discuss here only two candidates : (a) HMAC and (b)CBC-MAC

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 39 / 47

Page 153: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Approaches of Different Constructions

Mainly, three types of approaches of MAC constructions exists

Universal Hash Based MAC Construction (e.g UMAC)

Compression Function Based MAC Construction (e.g HMAC)

Iterated Block Cipher Based MAC Construction (e.g CBC-MAC,PMAC, CMAC, GCBC etc.)

Note: We discuss here only two candidates : (a) HMAC and (b)CBC-MAC

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 39 / 47

Page 154: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Approaches of Different Constructions

Mainly, three types of approaches of MAC constructions exists

Universal Hash Based MAC Construction (e.g UMAC)

Compression Function Based MAC Construction (e.g HMAC)

Iterated Block Cipher Based MAC Construction (e.g CBC-MAC,PMAC, CMAC, GCBC etc.)

Note: We discuss here only two candidates : (a) HMAC and (b)CBC-MAC

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 39 / 47

Page 155: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Composition Theorem : PRF(U) ≡ PRF

Theorem (Shoup [4])

Let GK1,K2 := FK2 hK1 : D → 0, 1n where h is an ε-universal hash overD. Then,

AdvprfG (t, q, `) ≤ AdvprfF (t ′, q, `) +

(q

2

)× ε,

where t ′ = t +O(qT ) and T denotes the maximum time for computing h.

Proof.

Output of the function is indistinguishable from random until the collisionoccurs in the input of FK2 .

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 40 / 47

Page 156: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Iterated Hash Construction

Objective

Develop a Hash function H(·) with larger domain from a Hash functionh(·) with smaller domain.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 41 / 47

Page 157: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Merkle-Damgard Iterated Hash Construction

Objective

Develop a Hash function H(·) with larger domain from a Hash functionh(·) with smaller domain.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 41 / 47

Page 158: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of Hash-Based-MAC (HMAC)

HMAC is a Hash-Function Based Mac designed by H. Krawczyk, M.Bellare and R. Canetti (1997).

Widely used in internet.

HMAC is built based on the technique of Merkle-DamgardConstruction

Instantiated with SHA-256 hash Function, output is 256 bits.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 42 / 47

Page 159: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of Hash-Based-MAC (HMAC)

HMAC is a Hash-Function Based Mac designed by H. Krawczyk, M.Bellare and R. Canetti (1997).

Widely used in internet.

HMAC is built based on the technique of Merkle-DamgardConstruction

Instantiated with SHA-256 hash Function, output is 256 bits.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 42 / 47

Page 160: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of Hash-Based-MAC (HMAC)

HMAC is a Hash-Function Based Mac designed by H. Krawczyk, M.Bellare and R. Canetti (1997).

Widely used in internet.

HMAC is built based on the technique of Merkle-DamgardConstruction

Instantiated with SHA-256 hash Function, output is 256 bits.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 42 / 47

Page 161: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of Hash-Based-MAC (HMAC)

HMAC is a Hash-Function Based Mac designed by H. Krawczyk, M.Bellare and R. Canetti (1997).

Widely used in internet.

HMAC is built based on the technique of Merkle-DamgardConstruction

Instantiated with SHA-256 hash Function, output is 256 bits.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 42 / 47

Page 162: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of Hash-Based-MAC (HMAC)

HMAC is a Hash-Function Based Mac designed by H. Krawczyk, M.Bellare and R. Canetti (1997).

Widely used in internet.

HMAC is built based on the technique of Merkle-DamgardConstruction

Instantiated with SHA-256 hash Function, output is 256 bits.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 42 / 47

Page 163: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of Cipher Block Chaining MAC (CBC-MAC)

Iterated block cipher based MAC, specified by US Govt. StandardFIPS PUB 113 Computer Data Authentication(2000) using DES as ablock-cipher

Standard in Crypto Community and widely used in practice.Sequential in nature. Thus efficieny wise it is not attractive.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 43 / 47

Page 164: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of Cipher Block Chaining MAC (CBC-MAC)

Iterated block cipher based MAC, specified by US Govt. StandardFIPS PUB 113 Computer Data Authentication(2000) using DES as ablock-cipherStandard in Crypto Community and widely used in practice.

Sequential in nature. Thus efficieny wise it is not attractive.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 43 / 47

Page 165: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of Cipher Block Chaining MAC (CBC-MAC)

Iterated block cipher based MAC, specified by US Govt. StandardFIPS PUB 113 Computer Data Authentication(2000) using DES as ablock-cipherStandard in Crypto Community and widely used in practice.Sequential in nature. Thus efficieny wise it is not attractive.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 43 / 47

Page 166: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Construction of Cipher Block Chaining MAC (CBC-MAC)

Iterated block cipher based MAC, specified by US Govt. StandardFIPS PUB 113 Computer Data Authentication(2000) using DES as ablock-cipherStandard in Crypto Community and widely used in practice.Sequential in nature. Thus efficieny wise it is not attractive.

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 43 / 47

Page 167: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Encrypted Cipher Block Chaining MAC (ECBC-MAC)

CBC-MAC is not secure when message length is not fixed

To overcome this, we encrypt the output of the last block with differentkey. Thus the construction is called Encrypted-CBC MAC (ECBC-MAC)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 44 / 47

Page 168: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Encrypted Cipher Block Chaining MAC (ECBC-MAC)

CBC-MAC is not secure when message length is not fixedTo overcome this, we encrypt the output of the last block with differentkey. Thus the construction is called Encrypted-CBC MAC (ECBC-MAC)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 44 / 47

Page 169: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Encrypted Cipher Block Chaining MAC (ECBC-MAC)

CBC-MAC is not secure when message length is not fixedTo overcome this, we encrypt the output of the last block with differentkey. Thus the construction is called Encrypted-CBC MAC (ECBC-MAC)

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 44 / 47

Page 170: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

Thanks

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 45 / 47

Page 171: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

References

Antoine Joux. Multicollisions in Iterated Hash Functions. Applicationto Cascaded Constructions. In Matthew K. Franklin, editor, CRYPTO2004, Volume 3152 of LNCS, pages 306-316. Springer, 2004.

John Kelsey and Bruce Schneier. Second Preimages on n-Bit HashFunctions for Much Less than 2n Work. In Ronald Cramer, editor,EUROCRYPT 2005, Volume 3494 of LNCS, pages 474-490. Springer,2005.

Mihir Bellare and Oded Goldreich and Anton Mityagin. The Power ofVerification Queries in Message Authentication and AuthenticatedEncryption. http://eprint.iacr.org/2004/309, Volume 2004, pages 309,2004.

Victor Shoup. Sequences of games: a tool for taming complexity insecurity proofs. IACR Cryptology ePrint Archive, 2004:332, 2004

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 46 / 47

Page 172: Symmetric Key Cryptography : Hash and MACrcbose/internship/lectures2016/...Symmetric Key Cryptography : Hash and MAC Avijit Dutta Cryptology and Security Research Unit Indian Statistical

References

E. Biham, O. Dunkelman, A Framework for Iterative Hash FunctionsHAIFA, Cryptology ePrint Archive, Report 2007/278,http://eprint.iacr.org/2007/278 (August 2425 2006)

Bouillaguet, C., Fouque, P.: Practical hash functions constructionsresistant to generic second preimage attacks beyond the birthdaybound (2010), submitted to Information Processing Letters

A. Dutta (Indian Stat. Inst.) Symmetric Key Cryptography : Hash and MAC 47 / 47