cryptanalysis of hmac/nmac-whirlpool · jian guo, yu sasaki, lei wang, shuang wu asiacrypt,...

26
Cryptanalysis of HMAC/NMAC-Whirlpool Jian Guo , Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013

Upload: others

Post on 12-Oct-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Cryptanalysis of HMAC/NMAC-Whirlpool

Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu

ASIACRYPT, Bangalore, India4 December 2013

Page 2: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Talk Overview

1 IntroductionHMAC and NMACThe Whirlpool Hash FunctionMotivation

2 Key Recovery Attacks

3 Conclusion

Page 3: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

HMAC and NMAC

Designed by Mihir Bellare, Ran Canetti and HugoKrawczyk in Crypto 1996Standarized by ANSI, IETF, ISO, NIST from 1997The most widely deployed hash-based MAC construction.

NMAC

Page 4: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

HMAC and NMAC

Designed by Mihir Bellare, Ran Canetti and HugoKrawczyk in Crypto 1996Standarized by ANSI, IETF, ISO, NIST from 1997The most widely deployed hash-based MAC construction.

HMAC

Page 5: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Whirlpool

designed by Barreto and Rijmen in 2000 with 512-bit digest

standarized by ISO/IEC, approved by NESSIE (New EuropeanSchemes for Signatures, Integrity, and Encryption).

follows Merkle-Damgard strengthening, and Miyaguchi-Preneelmode, i.e., f (H,M) = EH(M)⊕ H ⊕M

both state and key follow the AES-like process, with 10 rounds.

Key: AC ◦MR ◦ SC ◦ SB; State: AK ◦MR ◦ SC ◦ SB

Page 6: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Whirlpool

designed by Barreto and Rijmen in 2000 with 512-bit digest

standarized by ISO/IEC, approved by NESSIE (New EuropeanSchemes for Signatures, Integrity, and Encryption).

follows Merkle-Damgard strengthening, and Miyaguchi-Preneelmode, i.e., f (H,M) = EH(M)⊕ H ⊕M

both state and key follow the AES-like process, with 10 rounds.

Key: AC ◦MR ◦ SC ◦ SB; State: AK ◦MR ◦ SC ◦ SB

Page 7: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Motivation

AES,1998 Whirlpool, 2000⇓ ⇓

First CryptanalysisFerguson et al. 2000, etc. Mendel et al. 2009, etc.

⇓ ⇓Analysis on MAC Applications

follows naturally Ours

Page 8: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

6-round HMAC-Whirlpool — Attack Overview

1 Derive many P

2 Derive corresponding C3 Recover Kout from known Ps and Cs4 Recover the original key K from Kout

5 Recover Kin (or K1) for NMAC only.

Page 9: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

6-round HMAC-Whirlpool — Attack Overview

1 Derive many P2 Derive corresponding C

3 Recover Kout from known Ps and Cs4 Recover the original key K from Kout

5 Recover Kin (or K1) for NMAC only.

Page 10: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

6-round HMAC-Whirlpool — Attack Overview

1 Derive many P2 Derive corresponding C3 Recover Kout from known Ps and Cs

4 Recover the original key K from Kout

5 Recover Kin (or K1) for NMAC only.

Page 11: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

6-round HMAC-Whirlpool — Attack Overview

1 Derive many P2 Derive corresponding C3 Recover Kout from known Ps and Cs4 Recover the original key K from Kout

5 Recover Kin (or K1) for NMAC only.

Page 12: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

6-round HMAC-Whirlpool — Attack Overview

1 Derive many P2 Derive corresponding C3 Recover Kout from known Ps and Cs4 Recover the original key K from Kout

5 Recover Kin (or K1) for NMAC only.

Page 13: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 1: Derive P

1 Gaetan just showed us how to derive h = H(K ⊕ ipad‖Ma) forsome long message Ma of around 2n/2 blocks.

2 Unbalanced Meet-in-the-Middle attack against H(K ⊕ ipad‖Mc),with H(K ⊕ ipad‖Ma‖Pa‖Mb) = f (f (f (h,Pa),Mb),Pb),by repeating many one-block Mb and Mc . Then we knowh′ = H(K ⊕ ipad‖Mc), henceP = H(K ⊕ ipad‖Mc‖Pc‖Md ) = f (f (h′,Pc),Md ), for any Md withpadding satisfied, due to length-extension property ofMerkle-Damgard structure.

Page 14: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 1: Derive P

1 Gaetan just showed us how to derive h = H(K ⊕ ipad‖Ma) forsome long message Ma of around 2n/2 blocks.

2 Unbalanced Meet-in-the-Middle attack against H(K ⊕ ipad‖Mc),with H(K ⊕ ipad‖Ma‖Pa‖Mb) = f (f (f (h,Pa),Mb),Pb),by repeating many one-block Mb and Mc . Then we knowh′ = H(K ⊕ ipad‖Mc), henceP = H(K ⊕ ipad‖Mc‖Pc‖Md ) = f (f (h′,Pc),Md ), for any Md withpadding satisfied, due to length-extension property ofMerkle-Damgard structure.

Page 15: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 2: Derive C

The ProblemWith known Tag value, and fixed message block Pout , find inputchaining value C.

The SolutionPrecompute a table T = f (C,Pout) to obtain many pairs of(C,T )

Page 16: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 2: Derive C

The ProblemWith known Tag value, and fixed message block Pout , find inputchaining value C.

The SolutionPrecompute a table T = f (C,Pout) to obtain many pairs of(C,T )

Page 17: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 3: Recover Kout

C = f (Kout ,P) = EKout (P)⊕ P ⊕ Kout

Page 18: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 3: Recover Kout

C = f (Kout ,P) = EKout (P)⊕ P ⊕ Kout

Page 19: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 3: 6-Round Chosen Plaintext Attack

Given many (P,C) pairs, filter for 3-collision with strctured differencein diagonal of V = MR−1(P ⊕ C).

Page 20: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 4: Recover K

The ProblemWith input chaining IV, output chaining Kout , recover K .

The SolutionPreimage attack by Sasaki et al. ASIACRYPT 2012.

Page 21: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 4: Recover K

The ProblemWith input chaining IV, output chaining Kout , recover K .

The SolutionPreimage attack by Sasaki et al. ASIACRYPT 2012.

Page 22: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 5: Recover Kin

The ProblemWith known Kout , chosen M1, recover Kin.

The SolutionExactly the same procedure as recovering Kout .

Page 23: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Step 5: Recover Kin

The ProblemWith known Kout , chosen M1, recover Kin.

The SolutionExactly the same procedure as recovering Kout .

Page 24: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Conclusion

Target Attack Mode #Rounds SourceHMAC/NMAC-Whirlpool Key Recovery 6 OursHMAC/NMAC-Whirlpool Distinguishing-H full Ours

Whirlpool Collision 5 Lamberger et al. AC 2009Whirlpool Preimage 6 Sasaki et al. AC 2012

Stay tuned for universal forgery (equivalent key recovery)attacks against HMAC with 7-round Whirlpool.

Page 25: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Conclusion

Target Attack Mode #Rounds SourceHMAC/NMAC-Whirlpool Key Recovery 6 OursHMAC/NMAC-Whirlpool Distinguishing-H full Ours

Whirlpool Collision 5 Lamberger et al. AC 2009Whirlpool Preimage 6 Sasaki et al. AC 2012

Stay tuned for universal forgery (equivalent key recovery)attacks against HMAC with 7-round Whirlpool.

Page 26: Cryptanalysis of HMAC/NMAC-Whirlpool · Jian Guo, Yu Sasaki, Lei Wang, Shuang Wu ASIACRYPT, Bangalore, India 4 December 2013. Talk Overview 1 Introduction HMAC and NMAC The Whirlpool

Thank you!

Questions?