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 talk about formal definitions of security for

Â Digital signatures.

Â First of all, we'll define a digital signature scheme.

Â A signature scheme, as we've seen already,

Â is defined by three probabilistic polynomial time algorithms.

Â The key generation algorithm, the signing algorithm, and the verification algorithm.

Â The key generation algorithm takes as input the security parameter as usual, and

Â outputs a pair of keys, a public and private key.

Â The signing algorithm takes as input the private key and a message m, and

Â outputs a signature sigma.

Â And they'll often denote it this way with the private key sub-scripted,

Â as we've see for other algorithms as well.

Â The verification algorithm takes as input the public key pk, a message m, and

Â a signature sigma and then outputs either 1 or 0.

Â Where as we've said already a one indicates acceptance or

Â validity, and a zero indicates rejection or invalidity.

Â And of course the correctness condition says that for all messages m and

Â all public private key pairs output by the key generation algorithm.

Â If we sign a message m using the private key, and then verify m along with

Â that signature using the public key, then verification should, should succeed, i.e.,

Â verification should output 1.

Â Now the Security model for digital signatures is exactly analogous to

Â the Security model we've seen already for message authentication codes.

Â In fact the definition of Security here for digital signatures came first, and

Â message authentication codes were patterned after signatures.

Â So recall that the Threat model is that of an adaptive chosen message attack.

Â That is, we assume that the attacker can induce the sender to sign messages of

Â the attacker's choice, and the Security goal is Existential Unforgeability.

Â That is, the attacker should be unable to forge a valid signature on

Â any message that was not explicitly signed by the sender.

Â And the main difference between our setting and the setting of

Â message authentication codes, is that because we're in the public key setting,

Â we're again always going to assume that the attacker is given the public key.

Â And it can use that public key when it tries to generate messages for

Â the sender to authenticate.

Â It can also use that public key when it's trying to construct its forgery, and

Â this makes the problem, of course, harder.

Â Formally, if we fix a signature scheme pi, and then some attacker A,

Â we can define the randomized experiment Forge based on A and pi.

Â On security parameter n, what this experiment does is first run

Â the key generation algorithm to obtain a public and private key pair.

Â And the attacker A is then given the public key, and

Â also given the ability to interact with a signing oracle.

Â The singing oracle is parametrized by the private key generated in the first step,

Â and it allows the attacker to submit messages m, and

Â get back their corresponding signatures.

Â We can let capital M denote the set of all messages that the attacker sends to

Â this oracle i.e.,

Â all messages whose signature the attacker has obtained.

Â After this interaction the attacker outputs a pair containing a message and

Â a signature sigma.

Â And we'll say that the attacker succeeds and the experiment evaluates to 1 if

Â first of all, the message signature pair that the attacker output is valid.

Â That is, if we verify the message signature pair using the public key

Â generated in the first step, then that will result in output of 1.

Â And furthermore, the message M should be a message whose signature the attacker has

Â now previously obtained.

Â So the message M should not be in the set capital M

Â of messages whose that the attacker sent to the signing oracle.

Â And then of course we'll, we'll define that the scheme pi is secure if for

Â all probabilistic polynomial time attackers A.

Â There's a negligible function epsilon such that the probability that the forge

Â experiment we've just seen outputs one, is negligible.

Â Now again, as in the case of message authentication codes,

Â the definition we've just given does not take into account Replay attacks at all.

Â And of course, does nothing preventing an attacker from taking a prior

Â message signature pair, and replaying that to a recipient.

Â And the receiver will then verify that, just as they did the first time around.

Â Now in many settings, this can be problematic.

Â For example, imagine the patch distribution case that we

Â talked about in the previous lecture.

Â And imagine that the software company issues a new patch.

Â And what the attacker does is to replace that new patch with a patch from

Â last year.

Â Well that patch was signed a year ago.

Â That signature is still going to appear valid, and so

Â the client may in fact install the year old patch.

Â And that may have the effect actually of rolling back the client to

Â a previous version of a software.

Â That doesn't violate the definition of security of a signature scheme.

Â And if we did want to prevent that sort of an attack,

Â we would have to handle it by some other mechanism.

Â In this particular setting it would not be hard to do that.

Â We could, for example, include a date inside what we sign, and

Â then the client would check that the date on the patch is later than the date on

Â the last patch that it applied.

Â The point is, however, that we can't handle this using signatures alone.

Â We have to instead handle it using some higher level mechanism.

Â The last thing I

Â want to talk about in this lecture is the Hash-and-sign paradigm.

Â And in fact, we've already seen this paradigm in the context of message au,

Â message authentication codes as well.

Â However, in the case of message authentication codes it's the case in

Â practice that not every message authentication code requires that

Â paradigm, or in fact, not every message authentication code uses that paradigm.

Â We've seen actually in this, in this course that CBC-MAC doesn't need

Â to use any hashing before generating a message authentication code

Â whereas HMAC does that as part of its processing anyway.

Â In the context of signatures, Hash-and-sign is really ubiquitous.

Â And we'll explore why in just a minute, it will be sort of obvious, actually.

Â The basic idea is that we're given a signature scheme pi that can handle, say,

Â short messages of length n.

Â The exact length is not important, but

Â it has to be long enough that it can serve as the output length of a Hash function H.

Â So in addition to the scheme we have a Hash function that

Â say can map arbitrary length inputs to strings of length n.

Â We can then construct a signature scheme,

Â pi prime, that can handle, that can sign arbitrary-length messages.

Â The key generation algorithm in this modified scheme is the same.

Â The signing algorithm now,

Â rather than signing the rather then, then trying to sign the long message m.

Â What it does simply is to first hash the message m to this short end bit string,

Â and then apply the underlying signing algorithm for the original scheme pi.

Â Verification of a signature sigma on a message m,

Â works by simply running the verification algorithm of

Â the underlying signature scheme on the hash of the message.

Â And the theorem we can prove here is that if the original scheme pi is secure for,

Â for signing short messages, and if the hash function H is collision-resistant.

Â Then the modified scheme pi prime,

Â that can handle arbitrary length messages, is itself a secure signature scheme.

Â And we can go through the proof at a very high level.

Â So imagine that the sender authenticates some messages m1, m2, m3 etc.

Â And let's denote h i to be the hash of the ith message.

Â When the attacker outputs it's forgery m comma sigma, we know that it, for

Â the attacker to be successful it must be the case that this message m

Â is different from mi for all i.

Â Well there are two cases now and we can just do a case analysis.

Â If H of m is equal to h i for some i,

Â then we have a collision in the hash function, right?

Â Because m is not equal to mi, but yet H of m is equal to the hash of mi, and so

Â that means that the attacker has managed to find a collision in H.

Â But that's something that shouldn't happen except with negligible probability,

Â if H is a collision-resistant hash function.

Â The other possibility is that H of m is not equal to h i for all i.

Â But in that case what's happened is that the attacker has

Â effectively obtained signatures on the quote messages h1, h2, h3, etc.

Â And then forged a valid signature on the message H of m,

Â which is distinct from everything that was signed prior to that.

Â And what means is that the attacker has effectively been able to

Â forge a signature on a new message in the underlying signature scheme.

Â And if the underlying signature scheme for short messages was secure by assumption,

Â then this happens only with negligible probability.

Â So putting it together, either way the attacker tries to defeat our modified

Â scheme pi prime, it will not be able to do so except with negligible probability.

Â Now, one thing to note about the Hash-and-sign paradigm is that it's

Â sort of Analogous to hybrid encryption in the sense that what it

Â gives us is the functionality of digital signatures at the asymptotic cost of

Â a symmetric-key operation.

Â And I say that because if the message that you're signing is very,

Â very long, then the time to sign will start

Â becoming dominated by the time to compute the hash over that long message.

Â And hashing is a symmetric-key operation, so it's going to be very fast.

Â And in that sense it's analogous to hybrid encryption that gave us a functionality of

Â public key encryption at the asymptotic cost of private key encryption.

Â And as I said a few minutes ago,

Â the hash-and-sign paradigm is used extensively in practice.

Â And really I, I, I just about any signature scheme that would be

Â used to find actual content would use the hash-and-sign paradigm to do that.

Â In the next lecture we'll begin exploring some constructions of signatures.

Â And we'll start here by looking at signatures based on the RSA problem.

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