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.

From the lesson

Week 2

Computational Secrecy and Principles of Modern Cryptography

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

Maryland Cybersecurity Center

[SOUND] In this lecture we're going to

Â talk about the very important concept of, Pseudorandomness.

Â This is going to serve as an important building block for

Â computationally secret encryption schemes.

Â And it's actually an important concept that comes up very frequently

Â in cryptography.

Â Let's first step back for a moment, and ask ourselves, what does random mean?

Â Or more precisely, what do we mean by uniform?

Â And actually I'm going to use the term, the terms random and

Â uniform interchangeably.

Â But, when I want to be precise, when I want to be careful I'll real,

Â I'll only use the term uniform, when I mean the uniform distribution.

Â Well we can ask ourselves the following question, if I give you three bit strings,

Â which of these three bit strings is a uniform string?

Â Well the first one, has a pattern.

Â 010101 et cetera.

Â The third one, also has an even more obvious pattern.

Â It's just a string of all zeros.

Â So the second one, might look to you,

Â as if that's the only one of the three that should qualify as being uniform.

Â But in fact, if you generated a string uniformly at random,

Â then each of the three strings shown here,

Â occurs here with probability exactly 2 to the minus 16.

Â That is, each of these strings occurs with the same exact probability,

Â if we generate a 16-bit string uniformly at random.

Â So, we really can't say that any one of these strings is random,

Â and another one isn't, and in some sense they're all equally random.

Â What we see from this example, is that randomness is not a property of a string,

Â but rather it's a property of a distribution over strings.

Â What I mean by that is that no particular string, in the previous case no

Â particular 16-bit string, can be said to be anymore random or

Â anymore uniform, than any other 16-bit string.

Â But what we can talk about, is the uniformity of a distribution on strings,

Â a distribution that results in or generates, a 16-bit string.

Â Just to be a little bit more careful here, a distribution on n bit strings is

Â simply a function, called D here, that assigns to each possible

Â string of length n, a probability in the range of 0 to 1.

Â You can view this as defining, a random variable,

Â which takes on values that are n bit strings.

Â And furthermore we of course require the condition that the sum over all

Â these probabilities is equal to 1.

Â So we specify a distribution on n-bit strings, by specifying for

Â all, for each possible n-bit string,

Â what the probability is with which that string is sampled.

Â So a uniform distribution on n-bit strings is simply the distribution that I'll

Â denote by use of n, which assigns equal probability,

Â 2 to the minus n, to every n-bit string.

Â That is the distribution in which Un of x, the probability with which the string x

Â occurs, is 2 to the minus n, for every string x of length n.

Â Give this preceding discussion, what should we say that pseudorandom means?

Â Well intuitively, what we're trying to capture is the idea,

Â that a particular string is pseudorandom,

Â if it can't be distinguished from a uniform or a random string.

Â But as we saw before, if we try to ask ourselves, which of some set of strings or

Â which of these three strings, is pseudorandom.

Â It doesn't really make sense,

Â the question doesn't make sense the same way it didn't make sense before.

Â And again, what we see here, is that pseudorandomness,

Â is not going to be defined as a property of any particular string, but

Â rather pseudorandomness is a property of a distribution on strings.

Â So we can't really speak, of a pseudorandom string, but

Â what we can talk about is a pseudorandom distribution on strings.

Â Our first definition or our first candidate definition,

Â of pseudorandomness, might be something like the follow, like the following.

Â And this is actually what people, did historically.

Â When they were looking at the case of pseudorandomness back in the 1950s.

Â Let's fix some distribution D, on n-bit strings.

Â So we just defined what a distribution is a, a moment ago.

Â And we'll just fix any such distribution.

Â By way of notation, I'll write x left arrow D,

Â to refer to sampling the string x, according to distribution D.

Â That is picking a string according to distribution D,

Â and assigning that string to the variable x.

Â Again, historically speaking, D was considered to

Â be a pseudorandom distribution, if it passed a bunch of statistical tests, so

Â what do I mean by that.

Â Well what I mean by that is, if we look at for example the probability,

Â with which the first bit of x is 1, when we sample x according to distribution D.

Â Then that probability should approximate, the probability with which the first bit

Â of x would be 1, if x were chosen from the uniform distribution.

Â If x were chosen from the uniform distribution,

Â the probability that it's first bit would be equal to 1, would be exactly one-half.

Â So we require that when we sample x according to distribution D,

Â the first bit of x should be 1 with probability roughly one-half.

Â Similarly, if we look at the probability with which the parody, of the bits of x,

Â that is the XOR, of all the bits in x, is 1.

Â Well, if D is a pseudorandom distribution then that probability should

Â approximate the probability with which,

Â the parody of x is 1, when x is sampled from the uniform distribution.

Â That probability of exactly one-half.

Â So therefore if D is pseudorandom, the probability with which the parody of

Â x is 1 when x is sampled from D, should also be close to one-half.

Â And more generally we can fix, some set, of statistical tests.

Â That is, any kind of predicate, we define on a string x.

Â And we can look at or we can compare, the probability with which Ai of x is equal to

Â 1 when x is sampled from distribution D and the probability that A ek,

Â Ai of x is equal to 1, when x is sampled from the uniform distribution.

Â And those should be close.

Â And if we require that to hold, if we require closeness to,

Â to hold for say 20 different statistical tests A1 through A20,

Â then that can serve as our definition ,of what it means for D to be pseudorandom.

Â That is D is pseudorandom, if these probabilities are equal for

Â i equals 1 to 20 or are close rather, for i equals 1 to 20.

Â You should immediately see though, that this kind of a definition, while it may be

Â sufficient for some applications, is not going to be sufficient in cryptography,

Â where we have an adversary, who's specifically trying to distinguish.

Â Your string sampled from your distribution,

Â from string sampled from the uniform distribution.

Â That is, the definition on the previous slide,

Â is not going to suffice, in an adversarial setting.

Â And the reason for this is because we don't know,

Â what statistical test an attacker will come up with.

Â Right, we had defined on the previous slide that a distribution,

Â was pseudorandom, if it passed some set A1 through A20, of statistical tests.

Â But an attacker might come along with its own test, not a net set.

Â And if that test distinguishes the output the this string x chosen

Â from the uniform distribution from a string x sampled from your distribution D,

Â then D shouldn't count in the pseudorandom distribution.

Â So the cryptographic definition of pseudorandomness the modern definition,

Â is that a distribution D is pseudorandom, if it passes every,

Â efficient statistical test.

Â Now if we had left out the word efficient and

Â required it to be pseudorandom only if it passes every single statistical test,

Â it turns out that that's equivalent to requiring that D be uniform.

Â And therefore, uniform in pseudorandom would end up with the same meaning, and

Â we wouldn't get anywhere.

Â But as we've talked about, we're interested a computational relaxation, and

Â it's reasonable to restrict our attention, to only efficient attackers,

Â who can only perform efficient statistical tests.

Â And so, it'll suffice for our purposes if we define D in this way.

Â Concretely, if we try to formalize a definition on the previous slide,

Â using a concrete notion of security, we would get a definition like the following.

Â So fix some distribution D, on n bit strings.

Â Then we can say that the distribution D, is t epsilon pseudorandom.

Â If for all attackers A running in some, running in time at most t,

Â the probability with which A of x equals 1, when x is sampled according to D,

Â and the probability with which A of x is equal to 1,

Â when x is sampled from the uniform distribution.

Â Those two probabilities, are at most epsilon apart.

Â So the difference between those probabilities or

Â the absolute value of that difference, is at most epsilon.

Â This exactly corresponds to the intuitive notion we had on the previous slide.

Â If we view the attacker A, as being equivalent to

Â some kind of statistical test, on strings x sampled from the distribution.

Â Then we're requiring that no statistical test that runs in time, at most,

Â t, can distinguish between a string sampled from the uniform distribution, and

Â a string sampled from distribution D, with probability any better than epsilon.

Â The asymptotic definition of pseudorandomness which is the one we're

Â going to be using, from now on in the course, is a bit more complicated because

Â again we need to take into account this idea of having a security parameter.

Â So as before, we'll denote that security parameter by n.

Â And here the security parameter will correspond exactly,

Â to it will define for us some length of strings that we're considering.

Â So in addition to the security parameter n, we'll have some polynomial p, and

Â we'll let D sub n, be some distribution, over strings of length p of n.

Â So, that means that for every value of the security parameter n,

Â we're looking at distributions over string of length, over strings of length p of n.

Â You can think, if you like for now of p of n being equal to n.

Â But it will be more interesting later on if we let p of n be larger than n,

Â so you can think of p of n being n squared, for concreteness.

Â Now, in asymptotic setting,

Â pseudorandomness, will be a property of a sequence of dish, dis, distributions.

Â So rather than looking at any particular distribution,

Â DI, and looking at the probability with which some test can distinguish it.

Â What we're going to be interested in is the asymptotic probability with which any

Â efficient attacker, can distinguish D of n from a uniform distribution,

Â over strings of length p of n.

Â And again we're going to be interested in the asymptotic, performance here.

Â The asymptotic behavior of an algorithm or, or

Â of any algorithm trying to distinguish.

Â Or equivalently the asymptotic pseudorandomness,

Â of the distribution's Dn.

Â So I'm going to let this set Dn correspond to the set D1, D2, D3, et cetera.

Â So on up to infinity.

Â So we have now a sequence of distributions, defined or called Dn,

Â and we'll say that this sequence of distributions is pseudorandom.

Â If for every probabilistic, polynomial-time algorithm A,

Â there's some negligible function epsilon.

Â Such that if we look at the difference between the probability that A of x equals

Â 1 when x is sampled from distribution Dn, and the probability that A of x outputs 1,

Â when x is sampled from the uniform distribution.

Â The difference or the absolute value of the difference will be at most, epsilon n.

Â Okay. Let's break this

Â down a little bit further.

Â So on the left hand side of this inequality, we have a term,

Â a difference or

Â an absolute value of a difference between two values, which is a function of n.

Â Fixing some algorithm A, for every value of the security parameter n,

Â we can explicitly compute or

Â evaluate the probability with which A of x equals 1, when x is sampled from D of n.

Â And the probability that A of x equals 1, when x

Â is sampled from the uniform distribution, over strings of length p of n.

Â Note that the input to A in both cases, is of the same length.

Â Because in one case we're sampling from the distribution D of n,

Â which is a distribution over strings of length p of n.

Â And in the other case, we're sampling from the uniform distribution over strings of

Â length p of n.

Â So for every value of the security parameter n,

Â we can compute the two probabilities, take their difference, take the absolute value.

Â And we get a number.

Â So what's on the left hand side is, something which is a function of n.

Â For every value of n, we get a real number.

Â And what we're asking, or what we're requiring, is that that function,

Â be negligible, meaning that asymptotically it will decay to zero,

Â faster than any inverse polynomial function.

Â So again, the sequence D of n is pseudorandom if for every efficient

Â algorithm A, there's some negligible function, which may depend on A.

Â But which will still be guaranteed to be negligible, such that the probability with

Â which A outputs 1, when given a string sample according to D of n,

Â and the probability with which A outputs 1,

Â when given something sampled according to the uniform distribution,

Â is at most epsilon of n, is at most that negligible function.

Â In the next lecture,

Â we'll talk about pseudorandom generators, which are deterministic functions,

Â that allow us to sample from a pseudorandom distribution.

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