Integrity Annotated
Integrity Annotated
Message integrity
Dan Boneh
Message Integrity
Goal: integrity, no confidentiality.
Examples:
– Protecting public binaries on disk.
– Protecting banner ads on web pages.
Dan Boneh
Message integrity: MACs
k message m tag
k
Alice Bob
m1 M m2 , …, mq
Chal. Adv.
kK t1 S(k,m1) t2 , …, tq
(m,t)
b
b=1 if V(k,m,t) = `yes’ and (m,t) { (m1,t1) , … , (mq,tq) }
b=0 otherwise
Dan Boneh
Online Cryptography Course Dan Boneh
Message Integrity
Dan Boneh
Review: Secure MACs
MAC: signing alg. S(k,m)⟶t and verification alg. V(k,m,t) ⟶0,1
message m tag
Alice Bob
m1 X m2 , …, mq
Chal. Adv.
t1 f(m1) f(m2) , …, f(mq)
f in
Funs[X,Y] (m,t)
Dan Boneh
End of Segment
Dan Boneh
Online Cryptography Course Dan Boneh
Message Integrity
Dan Boneh
MACs and PRFs
Recall: secure PRF F ⇒ secure MAC, as long as |Y| is large
S(k, m) = F(k, m)
Our goal:
given a PRF for short messages (AES)
construct a PRF for long messages
Dan Boneh
Construction 1: encrypted CBC-MAC
raw CBC
m[0] m[1] m[3] m[4]
F(k,) F(k,) F(k,) F(k,)
cascade
m[0] m[1] m[3] m[4]
k t
> F > F > F > F t ll fpad
> F
Let F: K × X ⟶ K be a PRF k1
tag
Define new PRF FNMAC : K2 × X≤L ⟶ K
Dan Boneh
Why the last encryption step in ECBC-MAC and NMAC?
S(k,m) = cascade(k, m)
S(k,m) = rawCBC(k,m)
>
rawCBC
tag
r
rand. r in X
⇒ For 3DES: can sign q=232 msgs with one key Dan Boneh
Comparison
ECBC-MAC is commonly used as an AES-based MAC
• CCM encryption mode (used in 802.11i)
• NIST standard called CMAC
Dan Boneh
End of Segment
Dan Boneh
Online Cryptography Course Dan Boneh
Message Integrity
MAC padding
Dan Boneh
Recall: ECBC-MAC
F(k,) F(k,) F(k,) F(k,)
F(k,) F(k,) F(k,) F(k,)
tag
F(k1,)
Dan Boneh
CBC MAC padding
Bad idea: pad m with 0’s
m[0] m[1] m[0] m[1] 0000
Dan Boneh
CMAC (NIST standard)
k1 k2
Dan Boneh
End of Segment
Dan Boneh
Online Cryptography Course Dan Boneh
Message Integrity
PMAC and
Carter-Wegman MAC
Dan Boneh
• ECBC and NMAC are sequential.
Dan Boneh
Construction 3: PMAC – parallel MAC
P(k, i): an easy to compute function
m[0] m[1] m[2] m[3]
key = (k, k1)
P(k,0) P(k,1) P(k,2) P(k,3)
Padding similar
to CMAC F(k1,) F(k1,) F(k1,)
Let F: K × X ⟶ X be a PRF
F(k1,) tag
Define new PRF FPMAC : K2 × X≤L ⟶ X
Dan Boneh
PMAC: Analysis
PMAC Theorem: For any L>0,
If F is a secure PRF over (K,X,X) then
FPMAC is a secure PRF over (K, XL, X).
m1 M
Chal. Adv.
kK t1 S(k,m1)
(m,t)
b
b=1 if V(k,m,t) = `yes’ and (m,t) ≠ (m1,t1)
b=0 otherwise
We show: given S( key, msg1 ) adv. has no info about S( key, msg2 )
Dan Boneh
One-time security (unconditional)
Thm: the one-time MAC on the previous slide satisfies (L=msg-len)
Dan Boneh
CW( (k1,k2), m) = (r, F(k1,r) ⨁ S(k2,m) )
Dan Boneh
Further reading
• J. Black, P. Rogaway: CBC MACs for Arbitrary-Length Messages: The Three-
Key Constructions. J. Cryptology 18(2): 111-131 (2005)
• M. Bellare: New Proofs for NMAC and HMAC: Security Without Collision-
Resistance. CRYPTO 2006: 602-619
Dan Boneh