Docsity

Message Authentication Codes (MCAs) - Luca Trevisan, UC Berkeley, Lecture notes of Mathematics

Toggle sidebar
bg1
U.C. Berkeley — CS276: Cryptography Handout N7
Luca Trevisan February 10, 2009
Notes for Lecture 7
Scribed by Mark Landry, posted February 15, 2009
Summary
Today we start to talk about message authentication codes (MACs). The goal of a
MAC is to guarantee to the recipient the integrity of a message and the identity of the
sender. We provide a very strong definition of security (existential unforgeability under
adaptive chosen message attack) and show how to achieve it using pseudorandom
functions.
Our solution will be secure, but inefficient in terms of length of the required authen-
tication information.
Next time we shall see a more space-efficient authentication scheme, and we shall
prove that given a CPA-secure encryption scheme and a secure MAC, one can get
a CCA-secure encryption scheme. (That is, an encryption scheme secure against an
adaptive chosen ciphertext and plaintext attack.)
1 Message Authentication
The goal of message authentication is for two parties (say, Alice and Bob) who share
a secret key to ensure the integrity and authenticity of the messages they exchange.
When Alice wants to send a message to Bob, she also computes a tag, using the secret
key, which she appends to the message. When Bob receives the message, he verifies
the validity of the tag, again using the secret key.
The syntax of an authentication scheme is the following.
Definition 1 (Authentication Scheme) An authentication scheme is a pair of al-
gorithms (T ag, V erif y), where T ag(·,·)takes in input a key K∈ {0,1}kand a mes-
sage Mand outputs a tag T, and V erif y(·,·,·)takes in input a key, a message, and
a tag, and outputs a boolean answers. We require that for every key K, and very
message M
V erif y(K, M , Tag (K, M)) = T r ue
if T ag(·,·)is deterministic, and we require
1
pf3
pf4
pf5

Partial preview of the text

Download Message Authentication Codes (MCAs) - Luca Trevisan, UC Berkeley and more Lecture notes Mathematics in PDF only on Docsity!

U.C. Berkeley — CS276: Cryptography Handout N Luca Trevisan February 10, 2009

Notes for Lecture 7

Scribed by Mark Landry, posted February 15, 2009

Summary

Today we start to talk about message authentication codes (MACs). The goal of a MAC is to guarantee to the recipient the integrity of a message and the identity of the sender. We provide a very strong definition of security (existential unforgeability under adaptive chosen message attack) and show how to achieve it using pseudorandom functions.

Our solution will be secure, but inefficient in terms of length of the required authen- tication information.

Next time we shall see a more space-efficient authentication scheme, and we shall prove that given a CPA-secure encryption scheme and a secure MAC, one can get a CCA-secure encryption scheme. (That is, an encryption scheme secure against an adaptive chosen ciphertext and plaintext attack.)

1 Message Authentication

The goal of message authentication is for two parties (say, Alice and Bob) who share a secret key to ensure the integrity and authenticity of the messages they exchange. When Alice wants to send a message to Bob, she also computes a tag, using the secret key, which she appends to the message. When Bob receives the message, he verifies the validity of the tag, again using the secret key.

The syntax of an authentication scheme is the following.

Definition 1 (Authentication Scheme) An authentication scheme is a pair of al- gorithms (T ag, V erif y), where T ag(·, ·) takes in input a key K ∈ { 0 , 1 }k^ and a mes- sage M and outputs a tag T , and V erif y(·, ·, ·) takes in input a key, a message, and a tag, and outputs a boolean answers. We require that for every key K, and very message M

V erif y(K, M, T ag(K, M )) = T rue

if T ag(·, ·) is deterministic, and we require

P[V erif y(K, M, T ag(K, M^ )) =^ T rue] = 1

if T ag(·, ·) is randomized.

In defining security, we want to ensure that an adversary who does not know the private key is unable to produce a valid tag. Usually, an adversary may attempt to forge a tag for a message after having seen other tagged messages, so our definition of security must ensure that seeing tagged messages does not help in producing a forgery. We provide a very strong definition of security by making sure that the adversary is able to tag no new messages, even after having seen tags of any other messages of her choice.

Definition 2 (Existential unforgeability under chosen message attack) We say that an authentication scheme (T ag, V erif y) is (t, )-secure if for every algorithm A of complexity at most t

P

K

[AT ag(K,·)^ = (M, T ) : (M, T) is a forge] ≤ 

where a pair (M, T ) is a “forge” if V erif y(K, M, T ) = T rue and M is none of the messages that A queried to the tag oracle.

This definition rules out any possible attack by an active adversary except a replay attack, in which the adversary stores a tagged message it sees on the channel, and later sends a copy of it. We still are guaranteed that any message we see was sent at some time by the right party. To protect against replay attacks, we could include a timestamp with the message, and reject messages that are too old. We’ll assume that replay attacks are handled at a higher level and will not worry about them.

2 Construction for Short Messages

Suppose F : { 0 , 1 }k^ × { 0 , 1 }m^ → { 0 , 1 }m^ is a pseudorandom function. A simple scheme is to use the pseudorandom function as a tag:

  • T ag(K, M ) := FK (M )
  • V erif y(K, M, T ) := T rue if T = FK (M ), F alse otherwise

This construction works only for short messages (of the same length as the input of the pseudorandom function), but is secure.

Example 6 T ag(K, M ) := r, FK (r, 1 , M 1 ),... , FK (r, , M). This scheme adds a randomized message identifier, and it prevents interleaving blocks from different mes- sages, but it still fails to protect the message from being truncated by the advisary.

The following construction works:

Let F : { 0 , 1 }k^ × { 0 , 1 }m^ → { 0 , 1 }m^ be a pseudorandom function, M be the message we want to tag, and write M = M 1 ,... , M` where each block Mi is m/4 bits long.

  • T ag(K, M ):
    • Pick a random r ∈ { 0 , 1 }m/^4 ,
    • output r, T 1 ,... , T`, where

Ti := FK (r, `, i, Mi)

  • V erif y(K, (M 1 ,... , M), (r, T 1 ,... , T):
    • Output T rue if and only if Ti = FK (r, `, i, Mi)

Theorem 7 If F is (t, )-secure, the above scheme is (Ω(t), +t^2 · 2 −m/^4 +2−m)-secure.

Proof: Define (T, V ) as the authentication scheme above. Define ( T ,¯ V¯ ) in the same way, except using a truly random function R in place of FK. Let A be an algorithm of complexity at most t.

Consider A T¯^. Note that A can make at most t oracle queries. Define FORGE as the event in which A T¯^ never queries M , and produces a tag T for which V¯ (M, T ) = yes. Define REP as the event in which, for two different oracle queries, A receives tags with same r.

Now,

P[REP] =^ P[∃^ a repetition among r 1 ,... , rt] ≤

i

j

P[ri =^ rj ]

= t^22 −m/^4

Consider the event FORGE ∧ ¬REP. Suppose our oracle queries, and the resulting random strings, were:

M 11 ,... , M (^) l^11 → r^1 M 12 ,... , M (^) l^22 → r^2

...

M 11 ,... , M (^) l^11 → r^1 M 12 ,... , M (^) l^22 → r^2

...

Then we know i 6 = j ⇒ ri^6 = rj^. Now, the algorithm outputs message

M 1 ,... , M`

with a valid tag

r, T 1 ,... , T`

Then there are the following cases:

  • Case1: r 6 = ri∀i. Then the algorithm computed T 1 = R(r, `, 1 , M 1 ) without having seen it before.
  • Case2: r was seen before, so it occured exactly once, in the Tag for the jth query. - Case 2a: j 6 =. Then we computed T 1 = R(r, , 1 , M 1 ) without having seen it before. - Case 2b:j = . We know M 6 = M j^ , so ∃i : M (^) ij 6 = Mi. thus we computed Ti = R(r,, i, Mi) without having seen it before

Thus, in the event FORGE ∧ ¬REP, we constructed some Ti = R(r, , i, Mi) without sending (r,, i, Mi) to the oracle. Since R is truely random, this can only occur with prbability 2−m.

Now,

P[A^

T¯ is a f orgery] = (^) P[FORGE] = (^) P[FORGE ∧ REP] + (^) P[FORGE ∧ ¬REP] ≤ (^) P[REP] + (^) P[FORGE ∧ ¬REP] ≤ t^22 −m/^4 + 2−m

So finally we have

P[AT^ ()^ is a f orgery]^ ≤^ |^ P[AT^ ()^ is a f orgery]^ −^ P[A^ T¯ () is a f orgery]| + (^) P[A T¯ () is a f orgery] ≤  + t^22 −m/^4 + 2−m