90 likes | 200 Views
Online Cryptography Course Dan Boneh. Message Integrity. MACs based on PRFs. Review: Secure MACs. MAC: signing alg. S( k,m )⟶t and verification alg. V( k,m,t ) ⟶0,1 Attacker’s power: chosen message attack
E N D
Online Cryptography Course Dan Boneh Message Integrity MACs based on PRFs
Review: Secure MACs MAC: signing alg. S(k,m)⟶t and verification alg. V(k,m,t) ⟶0,1 Attacker’s power: chosen message attack • for m1,m2,…,mq attacker is given ti S(k,mi) Attacker’s goal: existential forgery • produce some new valid message/tag pair (m,t). (m,t) { (m1,t1) , … , (mq,tq) } ⇒ attacker cannot produce a valid tag for a new message
Secure PRF ⇒ Secure MAC For a PRF F: K × X ⟶ Y define a MAC IF = (S,V) as: • S(k,m) := F(k,m) • V(k,m,t): output `yes’ if t = F(k,m) and `no’ otherwise. message m tag Alice Bob tag F(k,m) accept msgif tag = F(k,m)
Suppose F: K × X ⟶ Y is a secure PRF with Y = {0,1}10 Is the derived MAC IF a secure MAC system? A bad example Yes, the MAC is secure because the PRF is secure No tags are too short: anyone can guess the tag for any msg It depends on the function F
Security • Thm: If F: K×X⟶Y is a secure PRF and 1/|Y| is negligible (i.e. |Y| is large)then IF is a secure MAC. In particular, for every eff. MAC adversary A attacking IFthere exists an eff. PRF adversary B attacking F s.t.: AdvMAC[A, IF] AdvPRF[B, F] + 1/|Y| IF is secure as long as |Y| is large, say |Y| = 280 .
Proof Sketch t1f(m1) m1 X (m,t) Suppose f: X ⟶ Y is a truly random function Then MAC adversary A must win the following game: A wins if t = f(m) and m {m1, … , mq} ⇒ Pr[A wins] = 1/|Y| m2 , …, mq Chal. Adv. f(m2) , …, f(mq) f in Funs[X,Y] same must hold for F(k,x)
Examples • AES: a MAC for 16-byte messages. • Main question: how to convert Small-MAC into a Big-MAC ? • Two main constructions used in practice: • CBC-MAC (banking – ANSI X9.9, X9.19, FIPS 186-3) • HMAC (Internet protocols: SSL, IPsec, SSH, …) • Both convert a small-PRF into a big-PRF.
Truncating MACs based on PRFs Easy lemma: suppose F: K × X ⟶ {0,1}nis a secure PRF. Then so is Ft(k,m) = F(k,m)[1…t] for all 1 ≤ t ≤ n ⇒ if (S,V) is a MAC is based on a secure PRF outputting n-bit tags the truncated MAC outputting w bits is secure … as long as 1/2w is still negligible (say w64)