This course will introduce you to the foundations of modern cryptography, with an eye toward practical applications.

Loading...

From the course by University of Maryland, College Park

Cryptography

415 ratings

This course will introduce you to the foundations of modern cryptography, with an eye toward practical applications.

- Jonathan KatzProfessor, University of Maryland, and Director, Maryland Cybersecurity Center

Maryland Cybersecurity Center

[SOUND] In the last lecture we introduced

Â the notion of message authentication codes.

Â In this lecture I want to explore a relatively simple construction of

Â a message authentication code for short, fixed-length messages.

Â Intuitively, we're looking for a keyed function Mac, such that the following

Â properties hold: Given Mack of m1, Mack of m2, etc.,

Â where the key k is chosen uniformly.

Â It should be infeasible for an attacker to predict the value of Mac k of m for

Â any message m not equal to m1, m2, m3 et cetera.

Â If you think about this a little bit, you'll notice that this seems

Â very similar to a primitive we've seen before, namely a pseudorandom function.

Â That's not to say that the requirements we

Â have here are equivalent to a pseudorandom function.

Â What I am claiming however is that a pseudorandom function would in

Â particularly imply the properties we have stated here.

Â And the reason for why that's the case is as follows.

Â If we have a pseudorandom function then we know that it's indistinguishable from

Â a random function.

Â And a random function has exactly the property that if we

Â learn the value of f of m1, f of m2 etc.

Â We learn nothing about the value of f evaluated on any additional point.

Â And this is exactly the property we're looking for here.

Â So that means we have the following construction.

Â Let's let F denote a length-preserving pseudorandom function, i.e a block cipher.

Â We can define the following message authentication code Pi.

Â The key generation algorithm will choose a uniform key k for F.

Â And Mac k of m will simply output Fk of m.

Â To verify a tag t on a message M with respect to the key k,

Â we simply reevaluate Fk of m and output one if and

Â only if that's equal to the tag t that we've been presented with.

Â The theorem we can prove and we will prove in a moment.

Â Is that if F is indeed a pseudorandom function,

Â then this construction Pi is a secure message authentication code.

Â As usual, we're going to give a proof by reduction.

Â So imagine we have some attacker A,

Â who's attacking the message authentication code Pi that we've just constructed.

Â What we're going to do is use that attacker as a subroutine,

Â in a distinguisher D, who's going to be interacting with either a random function

Â or the pseudorandom function F with with a uniform key k.

Â The reduction here is really the natural one.

Â What D is going to do is run the attacker as a subroutine inside of it,

Â and every time the attacker requests a tag on some message, m1 say,

Â D will simply forward m1 to its oracle and get back a value t1,

Â which it will give to the attacker.

Â This will go on as long as the attacker wishes.

Â Every time the attacker requests a tag on some message m, we forward D,

Â D will forward that to its oracle, get back the corresponding value and

Â give that value back to the attacker.

Â Finally, the attacker outputs its forgery.

Â It outputs a pair m,t, where t is supposed to represent a valid tag on m.

Â Let's assume, without really any loss of generality,

Â that m is not equal to any of the previous messages that the attacker on,

Â on which the attacker has requested a tag.

Â If the attacker can't succeed, if m is equal to one of his prior messages, so

Â we can assume that for simplicity.

Â What D will do is simply forward m to its external oracle, and get back a value t*.

Â Now if t is equal to t*, right,

Â if the value that the attacker output as its valid tag as its claimed valid tag,

Â is equal to the value t* that D got back from its oracle, then D outputs 1.

Â And otherwise it outputs 0.

Â Let's analyse the behavior of D.

Â So when D interacts with F-sub-k for the uniform k,

Â that means we're in the pseudorandom case, and D is interacting with a pseudorandom

Â function, then the view of the attacker being run as a subroutine inside of D.

Â Is identical to its view in the real MAC experiment.

Â Right, every message, for which the attacker requests a tag,

Â is responded to with the tag Fk of M.

Â And when the attacker outputs m,t it

Â succeeds exactly when Fk of m is equal to t.

Â So that means that the probability that D outputs 1, when D is interacting with

Â F of k is exactly equal to the probability that forge output 1.

Â It's exactly equal to the success probability of the attacker

Â when interacting with Pi.

Â On the other hand, when D interacts with the uniform function F,

Â then what we know is that after observing the values of f(m1),

Â f(m2), et cetera, D cannot possibly predict the value of f(m).

Â Right because m is not equal to any of the m1, m2, m3 etc.

Â And because f is a random function, the value of f of m is completely uniform.

Â And so the probability with which t the value output by the attacker being

Â run as a sub routine within D, happens to be equal to the value t*.

Â That is the value that D gets back from its oracle, is exactly 2 to the minus n.

Â So here, we're assuming that we have a length preserving pseudorandom function,

Â f, whose input and output length are both end bit strings.

Â Whose input and output range and domain are both end bit strings.

Â So the probability that we can predict in advance, the value,

Â of the n-bit string t* is exactly 2 to the -n.

Â We're almost done.

Â By assumption that F is a pseudorandom function,

Â we know that the difference between the probability with which D outputs 1 when

Â interacting with Fk and the probability that D outputs 1 when interacting with

Â a random function must be negligible.

Â And so, plugging in what we have from the previous slide,

Â we see that the probability that the attacker succeeds

Â in the forage experiment, which is equal to the probability with which D outputs 1

Â when interacting with F sub k, is at most 2 to the minus n plus negligible.

Â And because 2 to the minus n is itself a negligible function.

Â That means that indeed we've shown that the probability that the attacker can

Â succeed in the original forgery experiment is negligible.

Â Does this mean that we're done?

Â Well, if you think about it a little bit, and

Â what this would mean in terms of practice, recall that typical block ciphers,

Â have short, fixed length block size.

Â For example, AES has a 128 bit block size.

Â So what the construction we've just shown would give us,

Â is a message authentication code for 128 bit messages.

Â And this is actually quite a limitation.

Â Most messages that we're going to send in practice,

Â are first of all going to be much longer than 128 bits long.

Â And secondly, in the general case we'd like to be able to authenticate messages

Â of different length.

Â And the construction we've just set, we've just shown,

Â assumes that every message being authenticated is exactly 128 bits long.

Â So in the next few lectures, we're going to see,

Â how we can take this idea that we've explored here, which gives us a Mac for

Â short, fixed-length messages, and turn that into a more robust and more useful

Â message authentication code that can handle long and variable length messages.

Â Coursera provides universal access to the worldâ€™s best education,
partnering with top universities and organizations to offer courses online.