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] Recall the three

Â principles of modern cryptography.

Â Definitions, proofs, and assumptions.

Â We've already spent quite a bit of time building up definitions of

Â secure encryption.

Â Both for the case of perfect secrecy and then for

Â our relaxation, of computational secrecy.

Â We've also seen a little bit of proof.

Â We had in particular, the proof that the one time pad encryption scheme,

Â satisfied our definition of perfect secrecy.

Â We haven't yet had the opportunity to explore the use of assumptions.

Â In the last few lectures, we've defined computational secrecy and

Â talked about how by relaxing the definition of perfect secrecy,

Â we can hope to circumvent the inherent lower bounds and

Â impossibility results that perfect secrecy comes with.

Â We've also defined, or introduced, the pseudo one time pad encryption scheme.

Â And our goal in this lecture is to rigorously prove that the pseudo one

Â time pad encryption scheme, meets our definition of computational secrecy.

Â Unfortunately, we're unable to prove this statement unconditionally.

Â We can't prove unconditionally, that the pseudo one time pad encryption scheme,

Â is computationally secret.

Â For one thing, such a proof is beyond our current techniques.

Â As I've mentioned several times already, proving unconditionally, that some

Â encryption scheme which is not perfectly secret, is computationally secret,

Â would imply in particular a proof that P is not equal to NP.

Â A longstanding unresolved question, in complexity theory

Â which seems completely beyond our current techniques to address.

Â There's also something a little bit more fundamental than,

Â that which is that the pseudo one time patent encryption scheme, as we defined it

Â depended, or was defined based on some underlying component G.

Â G was a function that took a small input and produced a larger output.

Â In the case of a pseudo one time pad, it took as input the key, that the two

Â parties shared and expanded that into a pseudo pad that the party the parties then

Â XOR with the message to encrypt and XOR with the ciphertext in order to decrypt.

Â Though we can't really hope to claim anything about the pseudo one

Â time pad in general, unless there's something about the particular G

Â that we used with which to instantiate the scheme.

Â So security of the pseudo one time pad must depend somehow on what

Â particular function G we plug in.

Â Or and, and or, what properties that function G has.

Â So, what we can hope to prove is security of the one time pad, sorry,

Â of the pseudo one time pad encryption scheme,

Â under the assumption that G is a pseudorandom generator.

Â This actually tells us a couple of things, right?

Â First of all it tells us that if, we begin, with a secure,

Â with a pseudorandom generator G and then build the pseudo one

Â time pad encryption scheme from that, then the scheme is secure.

Â It also tells us that we can feel free to swap in different functions G.

Â We can put in any function G that we like,

Â as long as it satisfies the property of being a pseudorandom generator.

Â And given that assumption, the scheme will be secure.

Â Now before we turn to details of the proof, let me just revisit the definition

Â of pseudorandom generators in a little bit of different form,

Â than what we've seen before.

Â I wanted to go through it actually pictures, because part of the proof

Â of the pseudo one time pad encryption scheme is going to be my picture.

Â So remember that we have some fixed, function G which is an efficient,

Â deterministic function and let's assume for concreteness, that G

Â is length doubling, so that means that its output, is twice the length of its input.

Â We can now view our function G,

Â as being involved in an experiment of the following form.

Â Somebody comes along with an algorithm D, D here stands for distinguisher,

Â this algorithm D takes as input a string Y and outputs a bit B.

Â And we can think of these as D taking of input some string, some long string.

Â [COUGH] And trying to determine whether Y was chosen uniformly at random, or whether

Â Y was output by running the pseudorandom generator G on some uniform input.

Â So that means in one case, we have Y being sampled uniformly from a dis,

Â from strings of length and we can look at it the behavior of D,

Â when it's fed with a string Y sample, according to that distribution.

Â So in particular right,

Â we can calculate the probability with which D outputs one, right?

Â The probability with which B is equal to one, where that probability has taken over

Â the choice of Y, according to the uniform distribution on strings of length 2N.

Â And, also over any randomness internal to the algorithm D itself.

Â We're allowing, the possibility, that D itself can be a randomized algorithm.

Â So we can compute that probability.

Â It's a well defined probability for each value of the security parameter N.

Â Ultimately, we can look at a second case.

Â We can look at the case where, what we have is an experiment in

Â which we first sample a uniform N bit string, K and

Â we then feed that as input, to our function G and

Â take the output call it Y and feed that to our algorithm D.

Â So now, we can again look at the probability with which D

Â outputs the bit B equals one.

Â Where the probability is now taken over the uniform choice of K,

Â chosen uniformly from strings of length N.

Â And again, that's a well defined, probability for each value of N.

Â If G is a pseudorandom generator, that means that for any efficient D,

Â any efficient distinguishing algorithm D.

Â The probability, that D outputs one in the first case,

Â when Y is sampled uniformly from strings of length 2N,

Â is very close to the probability with which D outputs one in the second case,

Â when we sampled k uniformly and then it compute Y equals G of k.

Â That's the definition of what it means for G to be a pseudorandom generator.

Â It's a pseudorandom generator if and only if, this holds for any efficient D.

Â Before going into the details of the proof, I want to discuss,

Â at a high level, how proofs by reduction work.

Â Proofs by reduction are very common and

Â we'll see them very frequently, throughout the rest of the course.

Â Here I'll walk through a high level description of how the proof by

Â reduction is going to work.

Â For a specific example,

Â with the pseudo one time pad based on a pseudorandom generator G.

Â What we do is we start with the assumption,

Â that G is a pseudorandom generator.

Â Then, let's say or

Â let's assume toward a contradiction, that there's some efficient attacker A,

Â who breaks the pseudo one time pad scheme, whereby breaks, I mean very specifically,

Â that it violates the definition of computational security, right?

Â That means we have an efficient attacker A,

Â whose success probability in the experiment that we defined,

Â is not bounded by one half, plus a negligible function.

Â What we'll then do, is use this algorithm A as a subroutine,

Â to build an efficient algorithm D.

Â That breaks the pseudorandomness of G.

Â And here again, I mean breaks actually in a very formal sense,

Â in terms of the formal definition of what it means for G to be pseudorandom.

Â Now we, what we'll do is we'll relate, the probability with which

Â D can break the pseudorandomness of G, to the probability with which A,

Â can break the security of the pseudo one time pad encryption scheme.

Â And show that if A indeed breaks the pseudo one time pad scheme,

Â then D breaks the pseudorandomness of G.

Â But we know, by assumption that G is pseudorandom,

Â that no such distinguisher D can exist.

Â There cannot be an efficient D that breaks the pseudorandomness of G.

Â This is again by our assumption, that G is a pseudorandom generator.

Â And this implies that our initial assumption of A,

Â must have been false and there could not exist such an A, in the first place.

Â One important point here and we'll see again in the actual proof,

Â is that we don't make any assumption whatsoever, about how A works.

Â The only thing we assume in step two, is that we have some A who somehow or

Â another, is able to break the pseudo one time pad scheme.

Â And we show that the existence of such an A,

Â would imply the existence of a D, that break the pseudorandomness of G.

Â And again because no such D can exist, that implies that no such A can exist.

Â [SOUND] An alternate way of viewing what we just said,

Â is rather than working by a proof towards a proof by contradiction,

Â as we did on the previous slide we can work in the other direction.

Â So this is really just a reframing of the, of what we had on a previous slide.

Â What we can do and

Â this is actually more along the lines of the proof we're actually going to show.

Â Again, we'll start with the assumption that G is a pseudorandom generator.

Â We'll then fix some arbitrary efficient A, attacking the pseudo one time pad scheme.

Â Here we're not assuming anything about the success probability of A,

Â in attacking the scheme.

Â We're just given that at some arbitrary A, who is efficient, i.e,

Â running in, probabilistic polynomial time.

Â We then use A as a subroutine, to build an efficient, distinguisher D attacking G.

Â And as before, were going to relate the distinguishing probability of D,

Â in attacking the pseudorandom generator, to the success probability of A,

Â in attacking the pseudo one time pad scheme.

Â By assumption, right by the assumption that G is a pseudorandom generator and

Â because D is an efficient algorithm,

Â we know that the distinguishing probability of D, must be negligible.

Â All right, the gap, between the probabilities with which D outputs one

Â in the two cases, must be negligible.

Â Using our relation between the distinguishing probability of D and

Â the success probability of A, we will then directly conclude a bound on the success

Â probability of A, as desired, i.e, would show immediately, directly, that

Â the success probability of A, can be at most one half plus a negligible function.

Â This will make more sense after we complete the analysis of the reduction,

Â in the following few slides.

Â [SOUND] Let's recall the pseudo one time pad just so

Â we have it in, in our minds as we go through the proof.

Â We have the two parties sharing an end bit key that I've denoted here by k.

Â And to encrypt a message of length 2n,

Â what they what the sender will do is to, pass k as input to G.

Â Take the resulting string.

Â The output of G.

Â Which is a string of length 2n.

Â And that with the message.

Â And this gives the ciphertext.

Â [SOUND] The theory we're going to prove is that if,

Â the function G used in the previous slide.

Â Is a pseudorandom generator, then the pseudo one time pad, IED

Â encryption scheme in the previous slide, is computationally indistinguishable.

Â Here's the reduction, so again, we're going to take some arbitrary,

Â algorithm A, adversary A, who runs in polynomial time.

Â This A, is attacking our pseudo one time pad encryption scheme.

Â We know nothing about how it works.

Â We know nothing about what it does.

Â We don't even know a priori anything about its success probability.

Â The only thing we're given, is that it's efficient.

Â And that it is trying to attack, the pseudo one time pad encryption scheme.

Â In the sense of our definition of computational secrecy.

Â Which means that this adversary is going to output a pair of messages,

Â be given back a ciphertext and then output a bit, with which it's trying to

Â guess which of those two messages that it output, was the one that was encrypted.

Â We're going to construct from this A, a distinguisher D,

Â that uses A as a subroutine.

Â So I've drawn the picture here as if D is some,

Â you can think about it as a black box that contains A inside.

Â Or you can think about D as some piece of code,

Â that makes subroutine calls out to the function implementing the attacker A.

Â Either way we imagine in this picture,

Â that A is being run inside of D as some kind of a subroutine.

Â D is going to be a distinguisher, trying to distinguish whether it's given

Â uniform strings, or strings that were output by the pseudorandom generator G.

Â So the interface of D, is that it's going to accept, strings Y as input.

Â And then going to output, a bit, b or, or a bit, rather determining whether or not

Â it thinks that it's input, was uniform or the output of the pseudorandom generator.

Â D works in the following way, what D is going to do,

Â is start running A as a subroutine, to obtain two messages in zero and one.

Â These are the two messages that A, select.

Â At this point, D is going to simulate the experiment of computational secrecy for A.

Â So what that means is that D, is going to, on it's own sample uniform bit b,

Â determining which of those two messages it's going to take.

Â And it's then going to excor the message m sub b,

Â that it selected, with its input string Y.

Â We can call that C, just a variable name.

Â But it's meant to indicate that we're thinking of this as a ciphertext.

Â And it gives that ciphertext as input to A.

Â So, remember A, believes it's attacking the encryption scheme.

Â So from As point of view, this exactly matches what it expects to see, because A,

Â indeed output two messages and got back a cipher text.

Â A will then output some bit, b, which

Â is supposed to represent it's guess, as to which of the two messages were encrypted.

Â And what D then does, is to check whether or not b and b prime are equal, right?

Â D chose b itself, D got b prime as output from the attacker A, so

Â D can certainly check whether those two bits are equal.

Â And D, will output the bit one, if and only if b and

Â b are equal, and zero otherwise.

Â So this completes our description of D.

Â D is well defined, given any algorithm A as a subroutine.

Â The first thing to look at or

Â to check, is that given that A runs in polynomial time, so does D.

Â All D is doing is running A once as a sub routine and

Â then doing some very minimal processing on top of that.

Â So, if A indeed runs in polynomial time, then so

Â does D, i.e if A is efficient, then D is also.

Â [SOUND] In the analysis of the distinguishing probability,

Â the distinguishing gap, of D it's useful to define as a piece of notation,

Â the function Mu of n, to be equal to the probability, with which A succeeds,

Â in the computational secrecy experiment, right?

Â Remember that we defined this experiment PrivK, in an earlier lecture and

Â basically this corresponds exactly to the probability, with which b

Â is equal to b prime, when, using the pseudo one time pad encryption scheme.

Â So, pi here, refers to the pseudo one time pad encryption scheme.

Â So first of all we can look at what happens when the input given to D,

Â is psuedorandom, meaning that we determined the input

Â to D by choosing a uniform feed giving it to the pseudorandom generator,

Â calling the result Y and then giving that value as input to D.

Â If the input Y is generated in that way, then I claim that the view of A,

Â when it's being run as a subroutine by D,

Â is exactly identical to the view of A in the experiment PrivKA pi.

Â And I'll show that pictorially on the next slide.

Â But assuming that's the case, that means that the probability that D outputs one,

Â when Y is generated pseudorandomly,

Â i.e, when we generate the input to D, by choosing a uniform feed X.

Â And then computing G of x and feeding the result into D.

Â That probability is then exactly equal to the probability with which b,

Â is equal to b prime, which is exactly by definition, equal to the probability

Â that A, succeeds in experiment PrivKey A pi, which we define to be mu of n.

Â So, let's look at this claim that when the input Y is pseudorandom,

Â the view of A is exactly the same as an experiment PrivK A pi.

Â So here's the picture similar to what we had two slides ago,

Â although now I've changed the way, or

Â I've explicitly denoted rather the way that Y is being sampled.

Â So here, we're working under the assumption that we're in the cave,

Â where Y is sampled by choosing a uniform seed k, running it through G and

Â letting the output be denoted as Y and feeding that in as input to D.

Â Well, in that case, if we just draw our box a little bit differently,

Â we see that inside this top box that, that we just put here

Â this corresponds exactly to an experiment where A,

Â outputs two messages, a uniform bit is chosen and then if you look at the what,

Â what's going on with m sub b, where we have it being exhorted with the string Y.

Â That is exactly syntactically identical to what we would get if we

Â chose a uniform key k and then, used the encryption scheme of pi, i.e.,

Â the encryption scheme of the pseudo one time pad,

Â to encrypt the message m sub b, right?

Â And you can take a look at that again.

Â So here we're we just have the picture where we take key, run it through G.

Â Get a string Y and then exsore that with m sub b.

Â But remember, that is exactly what we do in the encryption scheme for

Â the pseudo 110 pad.

Â So we can replace that with a box for encryption in the pseudo 110 pad.

Â And this picture here, is precisely the picture of the experiment prides key A pi.

Â Right again, A is outputting two messages.

Â One is uniform only at random.

Â If they're encrypted using the encryption scheme of pi and

Â A uniform key, the cypher text is given to A and then we look at whether or

Â not a at the bit b prime output by A.

Â And we know that the probability with which b is equal to b prime,

Â is by definition, the success probability of A in attacking pi.

Â That's what we said a moment ago.

Â For the next step, we look at the other case.

Â We look at what the behavior of D is, when its input Y is chosen uniformly at random.

Â Well, in this case I claim that A will succeed with probability exactly one half.

Â So that means the probability with which As prime is equal to b,

Â is exactly one half because D, outputs one only when b is equal to b prime.

Â That means the probability with which D of Y outputs one,

Â when Y is sampled uniformly, is exactly one half.

Â And we can look at this picture as well, so here I have the same picture but

Â now sampling Y as a two uniform two end bit string.

Â And if we draw out picture again a little bit differently and

Â replace this part here with encryption, using the one time pad scheme

Â right not the pseudo one time pad scheme, the one time pad scheme.

Â Because now the key Y, is here uniformly random uniform to n bit string.

Â So then, this is exactly a picture of the experiment in which A,

Â is attacking the one time pad encryption scheme.

Â But we know that the one time pad encryption scheme,

Â is perfectly secret and that's stronger than being computationally secret.

Â So we know that the probability with which A can output b prime,

Â equal to b in this experiment, is precisely one half.

Â Now we're almost done.

Â So, we've determined or we've related the probability with which D,

Â outputs one in each of those two cases.

Â Two in one case the probability with which A,

Â succeeds when attacking the pseudo one time pad and

Â then the other case, we've explicitly calculated it to be equal to one half.

Â Now by the assumption that G is pseudorandom and because D is efficient,

Â because D is polynomial time, we know that the difference in probabilities with which

Â D1 outputs one in those two cases, must be bounded by some negligible function.

Â Or more exactly,

Â the absolute value of a difference has to be bounded by some negligible function.

Â So there exists a negligible function epsilon n,

Â such that of n minus one half absolute value is at most epsilon n.

Â And just substituting in terms and rearranging and

Â doing some algebra, we see that this implies that the success probability of A,

Â in attacking pi, is bounded by one half plus epsilon N.

Â For epsilon N, a negligible function.

Â And that completes the proof, right?

Â What we want it to show is that, the pseudo one time pad encryption scheme pi,

Â meets our notion of computational secret, of computational secrecy,

Â we showed this because we started with an arbitrary efficient algorithm A and

Â proved that regardless of what A, is doing, as long as its efficient, there's

Â some negatives where function epsilon, such that the success probability of A,

Â in attacking pi, is almost one half of epsilon.

Â So, let's step back a little bit and ask ourselves what this all means.

Â So importantly, we've now proven that the pseudo one time pad is secure.

Â The point again being that, we have a provably secure scheme which is

Â much better than having a heuristic construction that just looks secure,

Â of one that we don't see any obvious way to attack it.

Â On the other hand, this proof does come with some caveats and

Â I don't want to downplay these.

Â So the proof is under the assumption that G is a pseudorandom generator and

Â of course, the proof is always relative to our definitions and

Â what we proved is exactly, what the theorem said,

Â which is the pseudo one time pad, achieves our notion of computational secrecy.

Â Now, what this means is that,

Â on the one hand, we're guaranteed that the only ways to break our scheme or

Â to break the pseudo one time pad scheme, are either to find a weakness in G, or

Â if the definition of computational secrecy isn't sufficiently strong, the fir,

Â the first of these, a weakness being found in G, is a concern in practice.

Â However, for the most part, what an implementer would do,

Â is choose some standard algorithm G, which is widely believed to

Â be a pseudorandom generator and it's therefore, relatively unlikely.

Â That weaknesses will be found in G.

Â This is obviously more true when G is something that stood the test of time and

Â been around and analyzed a lot longer, but nevertheless, its an, relatively speaking

Â unlikely for weaknesses to be found in G and moreover, if a weakness is

Â found in some particular function G, then the implementor can always swap out,.

Â That function G for another function G prime,

Â that's believed to be more secure as a pseudorandom generator.

Â More problematic, is the issue of the definition.

Â So the definition of computational secrecy that we,

Â that we've been using, in fact isn't really strong enough for

Â most applications of cryptography, in the real world.

Â Or most applications of encryption in the real world.

Â And this is a real issue and

Â one that we're going to start exploring in the next lecture

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