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 this lecture we'll explore constructions of signature scans based on

Â the RSA assumption.

Â Let's first recall the RSA assumption.

Â If we have a party who chooses two random equal length primes, P and Q.

Â And then multiplies them to compute a modulus N.

Â That party can also then choose two integers e and

Â d such that e times d is equal to one modulo phi of n.

Â And they can do that of course because they can compute phi of n

Â given their knowledge of the prime factors p and q.

Â They can then compute the eth root of any value m modulo N

Â by simply computing m to the d mod N.

Â And as we've seen previously, this works because if we take the value m to the d,

Â and then raise it to the eth power, we get m to the de.

Â Which is equal to M to the ED mod phi of N.

Â Which is then equal to N to the one, or N itself.

Â So the value M to the D is indeed, the Eth root of M modulo N.

Â On the other hand, the RSA assumption says that if we're given only N and E.

Â And not the factors of N, and not D itself,

Â then it's hard to compute the Eth root of a uniform value M in ZN star.

Â And this naturally suggests a signature scheme based on

Â RSA assumption that I'll call plain RSA, and the way this works is as follows.

Â One party will generate a public private key pair by running

Â an RSA generation algorithm to generate a modulus n along with integers e and

Â d having the relationship on the previous slide.

Â The public key will then be the modulus n and the public exponent e, and

Â the private key will be d.

Â And they can then send that to any other entity,

Â any other party who wants to verify their signatures.

Â To sign a message m, what that party will do is simply compute the dth root of m,

Â and that will give a signature, sigma.

Â A recipient, obtaining m and

Â sigma can easily verify that sigma is the eth root of m, by simply

Â computing sigma to the e and verifying whether that does indeed give the value m.

Â Why should this be secure?

Â Well we just said two slides ago that computing eth roots.

Â Modulo n is hard.

Â Right? Given only the public key which contains

Â exactly the modulus n and the exponent e, the rsa assumption says that it's hard to

Â compute eth routes of random m, modulo sorry, random m And

Â since the signature on m is the eth root of m, well it should be difficult then for

Â anybody only having the public key, to compute signatures on messages.

Â Is this a proof of security?

Â Well of course it's not, but it goes beyond that in fact this intuition is

Â really completely wrong in several respects.

Â First of all, it's very easy to sign specific messages.

Â For example it's very easy to compute the eth root, of the message M equals 1.

Â Right?

Â The eth root of 1 is simply 1 and

Â so a valid signature on the message 1 is simply the signature 1.

Â And fundamentally, the issue is that the RSA assumption tells us that

Â computing eth roots of random messages, of random M, is hard but

Â it says nothing about the difficulty of computing eth roots.

Â Of nine random messages.

Â Of small messages for example, or of n equals 1 in this case.

Â Another attack results from the fact that an attacker,

Â is able to generate signatures on random messages as often as he likes.

Â And the way this works is as follows.

Â So we described the scheme as having the signer take a message m

Â that they wanted to sign and then compute the eth root.

Â But an attacker can work backward.

Â What an attacker can do is start with an arbitrary value sigma, and

Â then let the message be determined from sigma as sigma to the e, mod N.

Â So that is the attacker starts with the signature that he's going to for

Â which he doesn't know the corresponding message.

Â And only later computes the message m equals sigma to the e.

Â Now of course sigma is a valid signature on m.

Â Because sigma is of course an eeth root of m.

Â So, you might think this is not much of an attack, because here

Â the attacker doesn't have any control over what message, m, is being signed.

Â Never the less,

Â this would violate our definition of existential unforageablility,

Â because the attacker is able to come up with a signature on some message.

Â An even more damaging attack, it to combine two signatures to obtain a third.

Â And here the attacker can in fact manipulate things so

Â as to obtain a signature on any message of his choice.

Â The way the attack works is as follows.

Â Let's say, that the attacker was able to obtain valid signatures,

Â sigma one and sigma two, on m1 and m2 respectively.

Â What the attacker can then do, is take the product of those two signatures.

Â Call it sigma prime.

Â And that will be a valid signature on the message m prime equal to the product of

Â the two messages.

Â And you can check this yourself to see that it works out.

Â If we take the signature, sigma prime, and raise it to the eth power, well,

Â that's exactly equal to sigma one to the e times sigma 2two to the e.

Â And because sigma one and

Â sigma two are valid signatures on m one and m two respectively.

Â We know that sigma one to the e is going to be equal to m one.

Â And sigma two to the e is going to be equal to m two.

Â And therefore the product is equal to m one times m two as claimed.

Â So again the attacker has been able to piece together two signatures on

Â two other messages.

Â And combine them to attain, obtain a signature on a third message.

Â If the attacker can really obtain signatures on any messages m1 and

Â m2 of his choice, then the attacker can set things up exactly in such a way

Â as to pick two messages m1 and m2 who's product is equal to some message m prime,

Â whose signature the attacker wishes to forge.

Â So this is a really damaging attack that allows the attacker to potentially

Â generate a signature on a message of his choice.

Â As long as he can fool the signer into signing arbitrary messages of

Â the attackers choice.

Â Now the RSA FDH signature scheme was constructed exactly to

Â prevent these kinds of attacks.

Â FDH here stands for

Â Full Domain Hash, and you'll see why it has that name in a moment.

Â The basic idea of this scheme, and the intuition for it's security,

Â is that what we're going to do is apply some cryptographic transformation

Â to a message before signing it like we did in the planar ASIC signature scheme.

Â And in particular, we'll have the same public key and private key as before.

Â But now, when we find a message M, rather than computing the Eth root of M itself,

Â what we'll do instead is to compute H of M for some cryptographic function H.

Â And then compute an eth root of that.

Â Right, so we take H of m,

Â we view it as an element of Z n star, and then we raise that to the d.

Â Thereby obtaining an, the, thereby obtaining the eth root of H of m.

Â We can verify that very easily.

Â Given a claimed signature on a message m, we simply compute H of m ourselves.

Â And then check whether sigma is an eth root of that.

Â That is, we simply check whether sigma to the e is equal to H of m.

Â It's interesting to observe that this scheme actually naturally handles long

Â messages, so we don't have to use hash and sign here.

Â In effect, we're using hash and

Â sign already with the underlying [INAUDIBLE] signature scheme.

Â But I want to make clear that this is not an extenuation of the hash and

Â sign approach because the [INAUDIBLE] signature scheme is insecure.

Â So, we're actually trying to bootstrap a secure scheme out of an insecure one by

Â using a cryptographic transformation and it happens to have the side benefit of

Â allowing, of naturally handling arbitrarily length messages.

Â Now, for intuition as to the security, I think the best thing to do is to

Â look at the three previous attacks and why they failed here.

Â The first attack was generating a signature on a message like m equals 1,

Â for which it's easy to compute the eth root,

Â and the issue here is that it's not clear.

Â Why it would ever be easy to compute the eth root of some output of H and,

Â in particular, if we try looking at what a signature on the message M = 1 might be,

Â well, that would correspond to the eth root of H(1), but

Â H(1) is going to be some arbitrary value in ZN Star.

Â Not likely to be easy to compute the eth root of that.

Â Moreover if the attacker tries the second attack where they first choose sigma and

Â then try to work backward and find a corresponding message.

Â They can try to do that.

Â But if they choose sigma and compute sigma to the e,

Â how will they then find a message m whose hash is equal to sigma to the e.

Â They would have to find a message m such that H of m is equal to sigma to the e.

Â Now this tells you in particular in we want the scheme, the RSAFDH scheme to be

Â secure, then in particular it had better be difficult to compute inverses under H.

Â Because otherwise this attack would work,

Â the attacker compute sigma to the e, and then compute and inverse of H.

Â That is an input such that H of m is equal to sigma of the e.

Â But as H is a cryptographic hash function say, then it will be hard to invert.

Â And that attack simply won't work.

Â The last attack we saw was one where the attacker combined signatures on

Â two messages to obtain a signature on a third.

Â And if you just try doing the natural sort of thing here,

Â you'll see quickly that it doesn't work.

Â So, for example, if the attacker gets a signature sigma 1 on a message m1.

Â And a signature sigma 2 on a message m2,

Â well, the product of those two signatures is not going to be a signature on m1m2.

Â And the reason for that is that sigma 1 to the e times sigma 2 to the e

Â is going to be equal to H of m1 times H of m2.

Â But that's not going to be equal to H applied to m1 and two.

Â If H is a good cryptographic pass function,

Â a good cryptographic transformation,

Â then it won't have any such homomorphic properties like what I've shown here.

Â And there's no reason to expect that it will in general.

Â And not only that, but it'll even be hard for

Â an attacker to find any two messages, an m1 and m2.

Â Such that H of m1 times H of m2 is equal to H of m1 times m2.

Â So the three previous attacks simply don't apply here.

Â Now that doesn't mean that it's secure.

Â We still have to prove that there are no other attacks that can work

Â on this scheme.

Â And in fact, this can be proved under suitable assumptions.

Â And in particular, what it's possible to show.

Â Is that if the RSA assumption holds, and if we model H as a random function

Â mapping messages informally onto Z N star, then the RSA-FDH of function is secure.

Â Now we've talked very briefly about this idea of

Â modeling cryptographic hash functions as random functions before.

Â We haven't discussed that formally, we're not going to do that here,

Â it's a little bit more advanced than something that I want to get into in

Â this course, however if you're interested you can see my book for example for

Â a proof of this theorem, as well as a full discussion of this random oracle model.

Â Now in practice, what we do is we instantiate this function H.

Â With a modified cryptographic hash function.

Â And then we simply are treating in our security analysis,

Â that half function as a random function, mapping onto z n star.

Â Now one thing I do want to point out about this,

Â from an implementation point of view, is that it's not enough to

Â simply take a cryptographic hash function off the shelf and use it here.

Â And the reason for that is that the range of typical cryptographic hash

Â functions is simply going to be too small.

Â For example a, a hash function now a days might have an output length of 256 bits.

Â But the modulus N might be 1,000 or 2,000 bits long.

Â And so hashing on to even a uniform 256 bit string,

Â is not going to give you anything close to a uniform element in a range n.

Â Where n is a thousand bit or 2000 bit integer.

Â So instead what you need to do is take your function.

Â And modify it in some way to give you longer output.

Â Such that the range of H is mapping roughly uniformly onto ZN star,

Â as required by the theorem.

Â We're not going to go into this again in very much detail.

Â However, you are welcome to look at the standards for RSA-FDH and

Â related schemes, and see how it's done there.

Â An in practice the scheme is used in the sense that

Â the RSA PCKS number 1 v2.1 standard included a signature scheme that

Â can be viewed as being inspired by RSA-FDH.

Â In fact what it really gives you is a scheme that can be paramaterized.

Â And it allows the signer to use randomness, but if the signer chooses to

Â use no randomness, then essentially you'll get a scheme that's very close to RSA-FDH.

Â So the point is that RSA-FDH and things built on RSA-FDH and

Â inspired by it really are used in practice.

Â In the next lecture, we'll begin talking about identification schemes.

Â This is going to be a little bit of a detour from the signature schemes, but

Â it does give a very important mechanism for constructing signature schemes.

Â And in fact, one that we're going to use in the lecture after that

Â to construct signature schemes based on the discreet logarithm assumptions.

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