Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms
Gaëtan Leurent
Inria Rocquencourt, France
ASK 2015
- G. Leurent (Inria)
Generic Attacks against MAC algorithms ASK 2015 1 / 59
Generic Attacks against MAC algorithms G. Leurent (Inria) Generic - - PowerPoint PPT Presentation
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion Generic Attacks against MAC algorithms G. Leurent (Inria) Generic Attacks against MAC algorithms ASK 2015 1 / 59 Gatan Leurent Inria Rocquencourt,
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 1 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Email signature ▶ Software update ▶ Credit cards ▶ Sensor networks ▶ Remote control (e.g. garage door, car) ▶ Remote access (e.g. password authentication)
Generic Attacks against MAC algorithms ASK 2015 2 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 3 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ For a message chosen by the adversary: existential forgery ▶ For a challenge given to the adversary: universal forgery
▶ Distinguish MACH
▶ Distinguish MACH
Generic Attacks against MAC algorithms ASK 2015 4 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 5 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Assume that the block cipher is good, prove that the MAC is good ▶ Lower bound on the security of the mode
▶ Try to show non-random behavior
▶ Attack that work for any choice of the block cipher ▶ Upper bound on the security of the mode
Generic Attacks against MAC algorithms ASK 2015 6 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Assume that the block cipher is good, prove that the MAC is good ▶ Lower bound on the security of the mode
▶ Try to show non-random behavior
▶ Attack that work for any choice of the block cipher ▶ Upper bound on the security of the mode
Generic Attacks against MAC algorithms ASK 2015 6 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Assume that the block cipher is good, prove that the MAC is good ▶ Lower bound on the security of the mode
▶ Try to show non-random behavior
▶ Attack that work for any choice of the block cipher ▶ Upper bound on the security of the mode
Generic Attacks against MAC algorithms ASK 2015 6 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Assume that the block cipher is good, prove that the MAC is good ▶ Lower bound on the security of the mode
▶ Try to show non-random behavior
▶ Attack that work for any choice of the block cipher ▶ Upper bound on the security of the mode
Generic Attacks against MAC algorithms ASK 2015 6 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Query 2n/2 random short messages ▶ 1 internal collision expected, detected in the output
Generic Attacks against MAC algorithms ASK 2015 7 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Query 2n/2 random short messages ▶ 1 internal collision expected, detected in the output
Generic Attacks against MAC algorithms ASK 2015 7 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Query 2n/2 random short messages ▶ 1 internal collision expected, detected in the output
Generic Attacks against MAC algorithms ASK 2015 7 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Query 2n/2 random short messages ▶ 1 internal collision expected, detected in the output
Generic Attacks against MAC algorithms ASK 2015 7 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Bound meaningless when mq ≈ 2n/2
▶ Usually assumed that key-recovery attacks require more...
Generic Attacks against MAC algorithms ASK 2015 8 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 9 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Uses secret ofgsets to the block cipher input: L = Ek(0)
Generic Attacks against MAC algorithms ASK 2015 10 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Full block ▶ MAC(Ax) = E([x] ⊕ 1
▶ Partial block ▶ MAC(By) = E(pad([y]))
▶ The MAC collide ifg
▶ Deduce L ▶ Universal forgery attack
Generic Attacks against MAC algorithms ASK 2015 10 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 11 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 12 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 13 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 14 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ To provide authentication: ▶ SSL, IPSEC, ... ▶ To provide identification: ▶ Challenge-response protocols ▶ CRAM-MD5 authentication in SASL, POP3, IMAP, SMTP, ... ▶ For key-derivation: ▶ HMAC as a PRF in IPsec ▶ HMAC-based PRF in TLS
Generic Attacks against MAC algorithms ASK 2015 15 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Proof is tight for some security notions ▶ Existential forgery ▶ Distinguishing-R
▶ Generic distinguishing-H attack? ▶ Generic state-recovery attack? ▶ Generic universal forgery attack? ▶ Generic key-recovery attack?
Generic Attacks against MAC algorithms ASK 2015 16 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 17 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 18 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Some outputs are more likely than others ▶ With 2ℓ−𝜁 work, find a value x∗ with ℓ preimages (offmine)
Generic Attacks against MAC algorithms ASK 2015 19 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Some outputs are more likely than others ▶ With 2ℓ−𝜁 work, find a value x∗ with ℓ preimages (offmine)
Generic Attacks against MAC algorithms ASK 2015 19 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 20 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 20 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 20 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 21 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 21 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 21 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 21 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 21 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 22 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 23 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 23 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Cycles
Generic Attacks against MAC algorithms ASK 2015 24 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Cycles
Generic Attacks against MAC algorithms ASK 2015 24 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Cycles
Generic Attacks against MAC algorithms ASK 2015 24 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 25 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 25 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 26 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 26 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 26 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 27 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 27 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 27 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Both starting point are in the main component
▶ Both cycles are reached with less than 2ℓ/2 iterations
Generic Attacks against MAC algorithms ASK 2015 28 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 29 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 29 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 29 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ SHA-1 and HAVAL limit the message length to 264 bits
▶ Shorter cycles have a small component
Generic Attacks against MAC algorithms ASK 2015 30 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
skip details
Generic Attacks against MAC algorithms ASK 2015 31 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
skip details
Generic Attacks against MAC algorithms ASK 2015 31 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 32 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ How to test equality? Online chaining values unknown ▶ How many equality test do we need?
Generic Attacks against MAC algorithms ASK 2015 33 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 34 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 35 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 35 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 35 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 36 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 37 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 38 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 38 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 39 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 39 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 39 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 40 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 40 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 41 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 42 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 43 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 44 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ len(C) = 2s ▶ Oracle access to the MAC, can’t ask MAC(C)
▶ Unknown because of initial key and final key
Generic Attacks against MAC algorithms ASK 2015 45 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ len(C) = 2s ▶ Oracle access to the MAC, can’t ask MAC(C)
▶ Unknown because of initial key and final key
Generic Attacks against MAC algorithms ASK 2015 45 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ All internal states for challenge message are known!
▶ H(M) = H(C) ⟹ MAC(M) = H(M ‖ k) = H(C ‖ k) = MAC(C)
Generic Attacks against MAC algorithms ASK 2015 46 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ All internal states for challenge message are known!
▶ H(M) = H(C) ⟹ MAC(M) = H(M ‖ k) = H(C ‖ k) = MAC(C)
Generic Attacks against MAC algorithms ASK 2015 46 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ All internal states for challenge message are known!
▶ H(M) = H(C) ⟹ MAC(M) = H(M ‖ k) = H(C ‖ k) = MAC(C)
Generic Attacks against MAC algorithms ASK 2015 46 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ All internal states for challenge message are known!
▶ H(M) = H(C) ⟹ MAC(M) = H(M ‖ k) = H(C ‖ k) = MAC(C)
Generic Attacks against MAC algorithms ASK 2015 46 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ All internal states for challenge message are known!
▶ H(M) = H(C) ⟹ MAC(M) = H(M ‖ k) = H(C ‖ k) = MAC(C)
Generic Attacks against MAC algorithms ASK 2015 46 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Finalization function is known!
Generic Attacks against MAC algorithms ASK 2015 47 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Finalization function is known!
Generic Attacks against MAC algorithms ASK 2015 47 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Compute distance to cycle ▶ Use entropy loss of iterations
Generic Attacks against MAC algorithms ASK 2015 48 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Add zero blocks after the challenge
Generic Attacks against MAC algorithms ASK 2015 49 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 49 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 50 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 50 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Complexity 2ℓ−s, s ≤ ℓ/6
▶ Complexity 2ℓ−s, s ≤ ℓ/4
▶ Complexity 2ℓ−s , s ≤
▶ Complexity 2ℓ−s/2, s ≤ 2ℓ/5, t =
Generic Attacks against MAC algorithms ASK 2015 51 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 52 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ GOST-1994: n = ℓ = 256 ▶ GOST-2012: n ≤ ℓ = 512, HAIFA mode
▶ Larger state should increase the security
Generic Attacks against MAC algorithms ASK 2015 53 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Related-key attacks on the last block
Generic Attacks against MAC algorithms ASK 2015 54 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 55 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 55 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 55 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 55 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 55 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 56 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 57 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
▶ Most security proofs are up to the birthday bound ▶ Is 64-bit security enough?
▶ Generic key-recovery for envelope-MAC, AEZ, HMAC-GOST
Generic Attacks against MAC algorithms ASK 2015 58 / 59
Introduction Hash-based MACs State recovery Universal forgery Key-recovery Conclusion
Generic Attacks against MAC algorithms ASK 2015 59 / 59