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] We're going to look here at cyclic groups which

Â give rise to another class of assumptions on

Â which public key cryptography can be based.

Â Let's begin by defining a cyclic group.

Â So let G be a finite group of order m, and

Â here we're going to write G using multiplicative notation.

Â Let little g be an element of the group G.

Â We can then consider the set of all powers of g, that is,

Â g to the 0 which is simply the identity element 1, g to the 1,

Â which is g itself, g squared, g cubed, et cetera.

Â Now we know from Fermat's little theorem that g to the m is equal to 1,

Â which is equal to g to the 0.

Â So that means that this set of elements will start to cycle.

Â And in particular, the set can have at most m elements.

Â And of course that has to be the case because we know that the group g itself

Â only has m elements.

Â Now if the set of powers of g has exactly m elements, then it must be all of g.

Â And in that case, we'll call g a generator of the group.

Â And if the group G has any element which is a generator,

Â then it will say that the group G is cyclic.

Â Let's see a simple example.

Â Let's consider the additive group, ZN.

Â So, here, we're switching notation to additive notation.

Â I claim that this group is cyclic for any value of N, and the reason for

Â that is that the element 1 is always a generator.

Â To see that, let's consider the powers of one,

Â which in this case are going to correspond to multiples of 1.

Â So 0 times 1 is 0, the identity in ZN, 1 times 1 is 1,

Â 2 times 1 is 2, all the way up to N minus 1.

Â And you see that we've enumerated exactly all the elements of ZN.

Â And so 1 is always a generator, and ZN is always cyclic.

Â To see a concrete example,

Â let's consider an equal of eight, and look at the item group the eight.

Â We know this group is cyclic, as we just said.

Â But let's look at whether particular elements of this group are generators.

Â Consider the element 3, is 3 a generator?

Â Well, we can look at all multiples of 3, and we have 0, 3, 6,

Â 3 times 3 is 9, which is one modulo 8.

Â We then get 4, 7, 2, and 5.

Â And what you can see is that indeed every element of

Â Z8 appears somewhere on this list.

Â Of course the elements don't appear in order, but

Â we never said that they had to appear in order.

Â All we cared about is that every element of the group is eventually generated

Â as a power of three.

Â So 3 is indeed a generator of the Z8.

Â But not every element is a generator.

Â For example, consider the element 2.

Â If we look at multiples of 2, we get 0, 2, 4, 6.

Â And then if 4 times 2 is 8, which is 0 mod 8.

Â So in fact 2 does not generate Z8, and 2 is not a generator.

Â So the fact that a group is cyclic means that it has a generator, but

Â it need not be the case that every element of the group is a generator.

Â And in general, it will not be the case.

Â Two important examples of cyclic groups are given by the following theorems.

Â Which we're not going to prove here, we're just going to state them.

Â The first theorem is that any group of prime order is cyclic, and

Â moreover in a cyclic group of prime order

Â every element except the identity is a generator.

Â This is a very useful theorem because it tells you that you don't care about any

Â details of what the underlying group is if it's prime, if it's order is prime,

Â then it's cyclic.

Â Another example of a cyclic group is given by Zp star for p prime.

Â Important examples * Theorem: Any group of prime order is cyclic, and

Â every non-identity element is a generator * Theorem: If p is prime,

Â then Z*p is cyclic (of order p-1).

Â So remember that Zp star is the multiplicative group, modular p.

Â And if P is prime, then this contains every element from 1 to p-1.

Â So this gives an example of a cyclic group.

Â Now it's easy to be confused here because p is prime, but

Â the order of the group Zp star is not prime, it's in fact, it's p-1 which for

Â p greater than 3 will not be a prime.

Â So this case is not covered by the previous theorem.

Â Now, one point I want to make is that if we have a group which is cyclic of or,

Â of order m, and it has to generate a g,

Â then it's easy to sample a uniform element in the group.

Â And the way you do that is by sampling a uniform exponent and

Â then computing g to the, to that exponent.

Â And the reason this gives you a uniform element of the group G is because there's

Â a one to one correspondent, correspondence between the exponents from

Â zero to m minus 1 and the elements of the group.

Â And this is very useful when we want to sample an elephant,

Â an element uniformly from the group.

Â And we'll rely on this implicitly whenever we use such uniform sampling in

Â the algorithms that we construct.

Â We're now ready to define the discrete-logarithm problem,

Â at least informally.

Â Fix some cyclic group G of order m, and generator g.

Â So we know, therefore, that the powers of g, that is, the set g to the 0,

Â g to the 1, up to g to the m minus 1, is exactly the group G itself.

Â That is, every element of the group appears somewhere on that list.

Â What this means is that for every h in the group, there's a unique exponent x in Zm,

Â that is the range of zero to m minus 1 such that g to the x is equal to h.

Â And we'll define the discrete logarithm of h with respect to g to be this value x.

Â And we'll write that as log h sub g.

Â So this is the discrete-logarithm of h with respect to G in the given group.

Â So the group here is going to be left implicit typically,

Â although when you talk about the discrete logarithm of some element,

Â you need to be clear what group you're working in.

Â The discrete logarithm problem in G roughly speaking is the following.

Â Given a generator g and

Â an element h, compute the discreet logarithm of h with respect to g.

Â And the discreet logarithm assumption is that solving the discreet

Â logarithm problem in g is hard.

Â That is, cannot be done in polynomial time.

Â More formally, let's, let script g here be a group generation algorithm.

Â By which I mean that on input the security parameter,

Â it will output the description of some cyclic group g along with

Â its order that I'm here going to denote by q, and a generator g of that group.

Â And we're going to require that the order of the group the,

Â the bit length of the order of the group should n, the security parameter.

Â For any such group generation algorithm and

Â any algorithm A, we can define the following discrete log experiment.

Â What we do is we first run this group generation algorithm on

Â the security parameter to generate our group G, or the description of the group,

Â it's order queue, and the generator G.

Â We then choose a uniform element h from that group.

Â And as we said a few slides ago, this is always easy to do efficiently.

Â We then provide to the algorithm A, the description of the group, the order q,

Â the generator, g, and it's element, h.

Â And we ask it to output for us the discrete log of h with respect to g.

Â So h wise, and, and outputs some value, x.

Â And the experiment evaluates to 1, or A succeeds, if that's the correct answer.

Â I.e.,

Â if g to the x is equal to h.

Â And we'll say that the discrete logarithm problem is hard relative to

Â this group generation algorithm G.

Â If for all probabilistic polynomial time algorithm is A, the probability with

Â which A can successfully compute this discrete logarithm, that is,

Â a discrete logarithm of a uniform element of the group, is negligible.

Â Now, it's very useful to define problems that are based on, but

Â not known to be equivalent to, the discrete logarithm problem.

Â And these are the so-called Diffie-Hellman problems.

Â Named after Diffie and Hellman, who first introduced the problems.

Â Although implicitly, in their paper from 1978.

Â So fix as usual a group G with a generator little g.

Â And within I'm going to define a bit of notation.

Â We're going to define DH sub G of h1 and h2, where h1 and

Â h2 are just elements of the group G.

Â We're going to define that as g to the xy.

Â Where x is the discrete log of h1 with respect to g, and

Â y is the discrete log of h2 with respect to g.

Â That is, to evaluate the function DH sub g on h1 and h2,

Â we first evaluate or we compute the discrete log of x the discreet log,

Â sorry the discreet log of h1 which is x, the discreet log of h2 which is y.

Â And then compute g to the xy.

Â The computational Diffie-Hellman problem asks to compute DH sub g of h1, h2.

Â That is given a generator g and

Â two elements h1, h2, compute the Diffie-Hellman of h1, h2.

Â Now, we said a moment ago that this could be computed by

Â computing the discreet logarithms of h1 and h2.

Â But of course if the discrete logarithm problem is hard, then it's not

Â going to give an efficient way to solve the computational Diffie-Hellman problem.

Â The decisional Diffie-Hellman problem, roughly speaking, asks for

Â something stronger.

Â It requires a given g, h1, and h2.

Â It's even hard to distinguish the correct answer DH of h1,

Â h2 from a completely uniform and independent element of G.

Â And we're going to define this more formally on the following slide.

Â We won't define formally the computational Diffie-Hellman problem, although I trust

Â that by now you would be able to come up with a formal definition on your own.

Â So it's a formally defined the decisional Diffie-Helman or DDH problem.

Â We'll gain let script g be a group generation algorithm.

Â And we'll say that the DDH problem is hard relative to this group generation

Â algorithm G, and for all probabilistic polynomial times, time algorithm A.

Â The difference in the following two probabilities is negligible.

Â And those probabilities are, in the first case, we run our

Â group generation algorithm to obtain a group g, it's order q and a generator g.

Â And then, give it, give to a, those parameters, along with g to the x,

Â g to the y, and g to the z.

Â Where all those values are chosen uniformly at random.

Â And in the second case, we do the same experiment,

Â although now rather than giving a three uncorrelated elements, g to the x,

Â g to the y, g to the z, we give it instead g to the x,

Â g to the y, and then the correct solution g to the x y.

Â And I see here that there's a typo on the slide,

Â which I'll correct when I post them online.

Â So intuitively, this this notion corresponds exactly to

Â what we said on the previous slide.

Â Namely, that it's hard for any algorithm A to distinguish the correct solution,

Â g to the xy, from a completely uniform element, g to the z.

Â If Z is uniform, then G to the Z is also uniform, and

Â as we said it's completely uncorrelated with G to the X and G to the Y.

Â [SOUND] Now it's useful to think about how the Diffie-Hellman problems relate to

Â each other as well as the to the discrete logarithm problem.

Â So if we fix some group generation algorithm, G.

Â Then as we said a moment ago if the discrete-logarithm problem is easy,

Â with respect to this group generation algorithm, then so

Â is the computational Diffie-Hellman problem.

Â And again, that's because if we can solve the discreet logarithm problem,

Â then given H1 and H2 we can compute the discreet logarithm of one of them.

Â And then compute the required solution g to the xy.

Â Similarly if the computational Diffie-Hellman problem is easy then so

Â is the decisional Diffie-Hellman problem.

Â And the reason for

Â this is simply that if we can compute the correct answer DH of h1, h2.

Â Then in particular we're able to identify the correct answer if it's given to us.

Â Put differently, this means that the DDH assumption is a stronger assumption

Â than the computational Diffie-Hellman assumption, and

Â the CDH assumption is in turn stronger that the discrete logarithm assumption.

Â So if we want to make the weakest possible assumption here,

Â then we're looking at the discrete-logarithm assumption.

Â And if we're willing to make the strongest possible assumption,

Â that would be the DDH assumption.

Â Now, for cryptographic applications, we have to discuss what kind of

Â groups are there for which all these problems are conjectured to be hard.

Â And the first think I'll note is that,

Â in general, it's best to use groups of prime order, and this is why it was so

Â important earlier when I mentioned that prime-order groups are always cyclic.

Â I don't want to get into the full reasons for this, but one thing I will say is

Â that if you take a nonprime-order group, then it certainly is possible for

Â the discrete logarithm problem to be hard in such a group.

Â However, it turns out that the discrete logarithm problem in non prime-order

Â groups is somehow easier than the discrete logarithm in prime-order groups.

Â So again this does not mean the discrete logarithm problem is easy,

Â it just means that it's easier if the group does not have prime-order.

Â And again, this relies on some results that I'm not presenting here, and

Â it's just meant to be an informal statement.

Â It turns out that in cryptography, there are really only two common classes of

Â groups that people use when they want to group that satisfies the discreet log or

Â Diffie-Hellman assumptions.

Â The first one is really relatively easy to talk about, and

Â this is prime order subgroups of Zp star for p prime.

Â So remember that Zp star itself is cyclic.

Â But because we want to work in a prime order group, we're going to restrict

Â ourselves to a subset of the group, a subgroup of Zp star which has prime order.

Â And one way that this can be generated, or

Â actually the canonical way in which this is generated, is as follows.

Â If we take p equals to tq plus 1 for q prime and p prime.

Â So you have to find p and q and, and t with these properties.

Â Then we can take the subgroup of Zp star, consisting of all t'th powers.

Â That is, we're going to take, we can consider the group,

Â G, containing the t'th power of every element of Zp star.

Â It's not very difficult to show that this is group.

Â It's not hard to show that it's closed.

Â And all the other properties actually follow pretty straightforwardly from

Â the fact that Zp star is a group.

Â It's a little bit more difficult, but not terribly so, to show that the order of

Â this group is exactly p minus 1 divided by t, which is equal to q.

Â And by construction, q is prime.

Â Since Q is prime,

Â we can rely on our previous result and say that this group is in fact cyclic.

Â So if we work in the subgroup of t'th powers modular p,

Â then we do indeed get a cyclic group of prime order in which the discreet

Â logarithm problem and Diffie-Hellman problems are conjectured to be hard.

Â Now, I'll throw in an advanced comment, which I don't expect all of you will know,

Â but for those of you who do, this may be useful or

Â may be useful to think about things this way.

Â A generalization of this is to consider prime-order subgroups

Â of the multiplicative group of a finite field of large characteristic.

Â So Zp star is kind of is an example of a finite field of large characteristic.

Â Zp star is the prime order subgroup rather of the field fp.

Â And you can generalize this to to other fields as well besides Zp star itself.

Â If you don't understand that that's fine.

Â I don't assume that people know fields.

Â You don't have to know anything about fields to follow anything else

Â from here on out.

Â Another example of groups in which the discrete logarithm problem and

Â Diffie-Hellman problems are conjectured to be hard,

Â are prime order subgroups of an elliptic curve group.

Â And if you've ever heard of elliptic curve cryptography,

Â then this is simply this is exactly what it means.

Â It means cryptography based on the discreet log rhythm problem, or

Â Diffie-Hellman problems in such groups.

Â Now, I'm not going to go into any detail at all about elliptic curves.

Â And the reason for

Â that is that the require a bit more group theory than we've developed.

Â Nevertheless, for our purposes, we're going to generally describe algorithms in

Â abstract groups where the exact details of the underlying group are irrelevant.

Â This means two things.

Â First of all, if you're not interested in implementing it yourself and

Â you're just interested in understanding it at a high level,

Â then you can safely ignore the details of the underlying group.

Â It doesn't really matter from that perspective,

Â what underlying group you're working in as long as the underlying group is

Â one in which these computational problems are hard.

Â Even if you're interested in implementing these algorithms.

Â What it means is that you can take the algorithm that's des,

Â that's described abstractly and

Â instantiate the underlying group with any appropriate group of your choice.

Â Where by appropriate here, I mean one where the corresponding cryptographic

Â problem is assumed to be hard.

Â You can of course plug in any cyclic group you like, but

Â if the cyclic group you plug in is not one for which the problems are hard,

Â then you won't get anything that's cryptographically secure.

Â Now, in the next lecture,

Â we'll talk a little bit about choosing concrete parameters for

Â these different groups, as well as for the RSA problem.

Â And you'll see a little bit about why people are so

Â excited about elliptic cryptography.

Â And why it seems to give better efficiency as compared to the other

Â algorithms we've talked about so far.

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