39
Outline ElGamal Integrity/Authenticity Algorithms Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 11 October 4, 2017 CPSC 467, Lecture 11 1/39

CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

  • Upload
    buimien

  • View
    225

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

CPSC 467: Cryptography and Computer Security

Michael J. Fischer

Lecture 11October 4, 2017

CPSC 467, Lecture 11 1/39

Page 2: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

ElGamal Cryptosystem

Message Integrity and AuthenticityMessage authentication codesAsymmetric digital signaturesImplications of Digital Signatures

Digital Signature AlgorithmsSignatures from commutative cryptosystemsSignatures from non-commutative cryptosystems

Security of Digital SignaturesForgery

CPSC 467, Lecture 11 2/39

Page 3: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

ElGamal Cryptosystem

CPSC 467, Lecture 11 3/39

Page 4: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

A variant of DH key exchange

A variant protocol has Bob going first followed by Alice.

Alice Bob

Choose random y ∈ Zφ(p).

b = g y mod p.

Send b to Alice.

Choose random x ∈ Zφ(p).

a = g x mod p.

Send a to Bob.

ka = bx mod p. kb = ay mod p.

ElGamal Variant of Diffie-Hellman Key Exchange.

CPSC 467, Lecture 11 4/39

Page 5: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Comparison with first DH protocol

The difference here is that Bob completes his action at thebeginning and no longer has to communicate with Alice.

Alice, at a later time, can complete her half of the protocol andsend a to Bob, at which point Alice and Bob share a key.

CPSC 467, Lecture 11 5/39

Page 6: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Turning D-H into a public key cryptosystem

This is just the scenario we want for public key cryptography. Bobgenerates a public key (p, g , b) and a private key (p, g , y).

Alice (or anyone who obtains Bob’s public key) can complete theprotocol by sending a to Bob.

This is the idea behind the ElGamal public key cryptosystem.

CPSC 467, Lecture 11 6/39

Page 7: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

ElGamal cryptosystem

Assume Alice knows Bob’s public key (p, g , b). To encrypt amessage m:

I She first completes her part of the key exchange protocol toobtain numbers a and k .

I She then computes c = mk mod p and sends the pair (a, c)to Bob.

I When Bob gets this message, he first uses a to complete hispart of the protocol and obtain k .

I He then computes m = k−1c mod p.

CPSC 467, Lecture 11 7/39

Page 8: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Combining key exchange with underlying cryptosystem

The ElGamal cryptosystem uses the simple encryption functionEk(m) = mk mod p to actually encode the message.

Any symmetric cryptosystem would work equally well.

An advantage of using a standard system such as AES is that longmessages can be sent following only a single key exchange.

CPSC 467, Lecture 11 8/39

Page 9: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

A hybrid ElGamal cryptosystem

A hybrid ElGamal public key cryptosystem.

I As before, Bob generates a public key (p, g , b) and a privatekey (p, g , y).

I To encrypt a message m to Bob, Alice first obtains Bob’spublic key and chooses a random x ∈ Zφ(p).

I She next computes a = g x mod p and k = bx mod p.

I She then computes E(p,g ,b)(m) = (a, Ek(m)) and sends it to

Bob. Here, E is the encryption function of the underlyingsymmetric cryptosystem.

I Bob receives a pair (a, c).

I To decrypt, Bob computes k = ay mod p and then computesm = Dk(c).

CPSC 467, Lecture 11 9/39

Page 10: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Randomized encryption

We remark that a new element has been snuck in here. TheElGamal cryptosystem and its variants require Alice to generate arandom number which is then used in the course of encryption.

Thus, the resulting encryption function is a random function ratherthan an ordinary function.

A random function is one that can return different values eachtime it is called, even for the same arguments.

Formally, we view a random function as returning a probabilitydistribution on the output space.

CPSC 467, Lecture 11 10/39

Page 11: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Remarks about randomized encryption

With E(p,g ,b)(m) each message m has many different possibleencryptions. This has some consequences.

An advantage: Eve can no longer use the public encryptionfunction to check a possible decryption.

Even if she knows m, she cannot verify m is the correct decryptionof (a, c) simply by computing E(p,g ,b)(m), which she could do for adeterministic cryptosystem such as RSA.

Two disadvantages:

I Alice must have a source of randomness.

I The ciphertext is longer than the corresponding plaintext.

CPSC 467, Lecture 11 11/39

Page 12: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Message Integrity and Authenticity

CPSC 467, Lecture 11 12/39

Page 13: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Protecting messages

Encryption protects message confidentiality.

We also wish to protect message integrity and authenticity.

I Integrity means that the message has not been altered.

I Authenticity means that the message is genuine.

The two are closely linked. The result of a modification attack byan active adversary could be a message that fails either integrity orauthenticity checks (or both).

In addition, it should not be possible for an adversary to come upwith a forged message that satisfies both integrity and authenticity.

CPSC 467, Lecture 11 13/39

Page 14: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Protecting integrity and authenticity

Authenticity is protected using symmetric or asymmetric digitalsignatures.

A digital signature (or MAC) is a string s that binds an individualor other entity A with a message m.

The recipient of the message verifies that s is a valid signature ofA for message m.

It should hard for an adversary to create a valid signature s ′ for amessage m′ without knowledge of A’s secret information.

This also protects integrity, since a modified message m′ will notlikely verify with signature s (or else (m′, s) would be a successfulforgery).

CPSC 467, Lecture 11 14/39

Page 15: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Message authentication codes

Message authentication codes (MACs)

A Message Authentication Code or MAC is a digital signatureassociated with a symmetric (one-key) signature scheme.

A MAC is generated by a function Ck(m) that can be computed byanyone knowing the secret key k.

It should be hard for an attacker, without knowing k , to find anypair (m, ξ) such that ξ = Ck(m).

This should remain true even if the attacker knows a set of validMAC pairs {(m1, ξ1), . . . , (mt , ξt)} so long as m itself is not themessage in one of the known pairs.

CPSC 467, Lecture 11 15/39

Page 16: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Message authentication codes

Creating an authenticated message

Alice has a secret key k .

I Alice protects a message m (encrypted or not) by attaching aMAC ξ = Ck(m) to the message m.

I The pair (m, ξ) is an authenticated message.

I To produce a MAC requires possession of the secret key k .

CPSC 467, Lecture 11 16/39

Page 17: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Message authentication codes

Verifying an authenticated message

Bob receives an authenticated message (m′, ξ′). We assume Bobalso knows k.

I Bob verifies the message’s integrity and authenticity byverifying that ξ′ = Ck(m′).

I If his check succeeds, he accepts m′ as a valid message fromAlice.

I To verify a MAC requires possession of the secret key k .

Assuming Alice and Bob are the only parties who share k, thenBob knows that m′ came from Alice.

CPSC 467, Lecture 11 17/39

Page 18: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Message authentication codes

Cheating

Mallory successfully cheats if Bob accepts a message m′ as validthat Alice never sent.

Assuming a secure MAC scheme, Mallory can not cheat withnon-negligible success probability, even knowing a set of validmessage-MAC pairs previously sent by Alice.

If he could, he would be able to construct valid forgedauthenticated messages, violating the assumed properties of aMAC.

CPSC 467, Lecture 11 18/39

Page 19: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Message authentication codes

Computing a MAC

A block cipher such as AES can be used to compute a MAC bymaking use of CBC or CFB ciphertext chaining modes.

In these modes, the last ciphertext block ct depends on all tmessage blocks m1, . . . ,mt , so we define

Ck(m) = ct .

Note that the MAC is only a single block long. This is in generalmuch shorter than the message.

A MAC acts like a checksum for preserving data integrity, but ithas the advantage that an adversary cannot compute a valid MACfor an altered message.

CPSC 467, Lecture 11 19/39

Page 20: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Message authentication codes

Protecting both privacy and authenticity

If Alice wants both privacy and authenticity, she can encrypt mand use the MAC to protect the ciphertext from alteration.

I Alice sends c = Ek(m) and ξ = Ck(c).

I Bob, after receiving c ′ and ξ′, only decrypts c ′ after firstverifying that ξ′ = Ck(c ′).

I If it verifies, then Bob assumes c ′ was produced by Alice, sohe also assume that m′ = Dk(c ′) is Alice’s message m.

CPSC 467, Lecture 11 20/39

Page 21: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Message authentication codes

Another possible use of a MAC

Another possibility is for Alice to send c = Ek(m) and ξ = Ck(m).Here, the MAC is computed from m, not c .

Bob, upon receiving c ′ and ξ′, first decrypts c ′ to get m′ and thenchecks that ξ′ = Ck(m′), i.e., Bob checks ξ′ = Ck(Dk(c ′))

Does this work just as well?

In practice, this might also work, but its security does not followfrom the assumed security property of the MAC.

CPSC 467, Lecture 11 21/39

Page 22: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Message authentication codes

The problem

The MAC property says Mallory cannot produce a pair (m′, ξ′) foran m′ that Alice never sent.

It does not follow that he cannot produce a pair (c ′, ξ′) that Bobwill accept as valid, even though c ′ is not the encryption of one ofAlice’s messages.

If Mallory succeeds in convincing Bob to accept (c ′, ξ′), then Bobwill decrypt c ′ to get m′ = Dk(c ′) and incorrectly accept m′ ascoming from Alice.

CPSC 467, Lecture 11 22/39

Page 23: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Message authentication codes

Example of a flawed use of a MAC

Here’s how Mallory might find (c ′, ξ′) such that ξ′ = Ck(Dk(c ′)).

Suppose the MAC function Ck is derived from underlying blockencryption function Ek using the CBC or CFB chaining modes asdescribed earlier, and Alice also encrypts messages using Ek withthe same chaining rule.

Then the MAC is just the last ciphertext block c ′t , and Bob willalways accept (c ′, c ′t) as valid.

CPSC 467, Lecture 11 23/39

Page 24: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Asymmetric digital signatures

Asymmetric digital signatures

An asymmetric (public-key) digital signature can be viewed as a2-key MAC, just as an asymmetric (public-key) cryptosystem is a2-key version of a classical cryptosystem.

In the literature, the term digital signature generally refers to theasymmetric version.

CPSC 467, Lecture 11 24/39

Page 25: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Asymmetric digital signatures

Asymmetric digital signatures

Let M be a message space and S a signature space.

A signature scheme consists of a private signing key d , a publicverification key e, a signature function Sd :M→ S, and averification predicate Ve ⊆M×S.1

A signed message is a pair (m, s) ∈M× S. A signed message isvalid if Ve(m, s) holds, and we say that (m, s) is signed withrespect to e.

1As with RSA, we denote the private component of the key pair by theletter d and the public component by the letter e, although they no longerhave same mnemonic significance.

CPSC 467, Lecture 11 25/39

Page 26: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Asymmetric digital signatures

Fundamental property of a signature scheme

Basic requirement:

The signing function always produces a valid signature, that is,

Ve(m,Sd(m)) (1)

holds for all m ∈M.

Assuming e is Alice’s public verification key, and only Alice knowsthe corresponding signing key d , then a signed message (m, s) thatis valid under e identifies Alice with m (possibly erroneously, as weshall see).

CPSC 467, Lecture 11 26/39

Page 27: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Implications of Digital Signatures

What does a digital signature imply?

We like to think of a digital signature as a digital analog to aconventional signature.

I A conventional signature binds a person to a document.Barring forgery, a valid signature indicates that a particularindividual performed the action of signing the document.

I A digital signature binds a signing key to a document. Barringforgery, a valid digital signature indicates that a particularsigning key was used to sign the document.

However, there is an important difference. A digital signature onlybinds the signing key to the document.

Other considerations must be used to bind the individual to thesigning key.

CPSC 467, Lecture 11 27/39

Page 28: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Implications of Digital Signatures

Disavowal

An individual can always disavow a signature on the grounds thatthe private signing key has become compromised.

Here are two ways that this can happen.

I Her signing key might be copied, perhaps by keystrokemonitors or other forms of spyware that might have infectedher computer, or a stick memory or laptop containing the keymight be stolen.

I She might deliberately publish her signing key in order torelinquish responsibility for documents signed by it.

For both of these reasons, one cannot conclude without areasonable doubt that a digitally signed document was indeedsigned by the purported holder of the signing key.

CPSC 467, Lecture 11 28/39

Page 29: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Implications of Digital Signatures

Practical usefulness of digital signatures

This isn’t to say that digital signatures aren’t useful; only that theyhave significantly different properties than conventional signatures.

In particular, they are subject to disavowal by the signer in a waythat conventional signatures are not.

Nevertheless, they are still very useful in situations where disavowalis not a problem.

CPSC 467, Lecture 11 29/39

Page 30: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Digital Signature Algorithms

CPSC 467, Lecture 11 30/39

Page 31: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Signatures from commutative cryptosystems

RSA digital signature scheme

Let n be an RSA modulus and (e, d) an RSA key pair.e is public and d is private as usual.

I Signing function: Sd(m) = Dd(m)

I Verification predicate: Ve(m, s)⇔ m = Ee(s).

Must verify that Ve(m, Sd(m)) holds for all messages m, i.e., thatm = Ee(Dd(m)) holds.

This is the reverse of the requirement for RSA to be a validcryptosystem, viz. m = Dd(Ee(m)) for all m ∈ Zm.

RSA satisfies both conditions since

m ≡ Dd(Ee(m)) ≡ (me)d ≡ (md)e ≡ Ee(Dd(m)) (mod n).

CPSC 467, Lecture 11 31/39

Page 32: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Signatures from commutative cryptosystems

Commutative cryptosystems

A cryptosystem with this property that Dd ◦ Ee = Ee ◦ Dd is saidto be commutative, where “◦” denotes functional composition.

Indeed, any commutative public key cryptosystem can be used fordigital signatures in exactly this same way as we did for RSA.

CPSC 467, Lecture 11 32/39

Page 33: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Signatures from non-commutative cryptosystems

Signatures from non-commutative cryptosystems

What if Ee and Dd do not commute?

One could define:

I Signing function: Se(m) = Ee(m)

I Verification predicate: Vd(m, s)⇔ m = Dd(s).

Every validly-signed message (m, Se(m)) would verify sinceDd(Ee(m)) = m is the basic property of a cryptosystem.

Now, Alice has to keep e private and make d public, which she cando. However, the resulting system might not be secure, since eventhough it may be hard for Eve to find d from e and n, it does notfollow that it is hard to find e from d and n.

CPSC 467, Lecture 11 33/39

Page 34: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Signatures from non-commutative cryptosystems

Interchanging public and private keys

For RSA, it is just as hard to find e from d as it is to find d from e.

That’s because RSA is completely symmetric in e and d .

Not all cryptosystems enjoy this symmetry property.

CPSC 467, Lecture 11 34/39

Page 35: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Signatures from non-commutative cryptosystems

ElGamal cryptosystem is not symmetric

The ElGamal scheme discussed in lecture 11 is based on theequation

b = g y (mod p),

where y is private and b public.

Finding y from b, g , p is the discrete log problem — believed to behard.

Finding b from y , g , p, is straightforward, so the roles of public andprivate key cannot be interchanged while preserving security.

ElGamal found a different way to use the ideas of discretelogarithm to build a signature scheme, which we discuss later.

CPSC 467, Lecture 11 35/39

Page 36: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Security of Digital Signatures

CPSC 467, Lecture 11 36/39

Page 37: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Forgery

Desired security properties of digital signaturesDigital signatures must be difficult to forge.

Some increasingly stringent notions of forgery-resistance:

I Resistance to forging valid signature for particular message m.

I Above, but where adversary knows a set of valid signedmessages (m1, s1), . . . , (mk , sk), and m 6∈ {m1, . . . ,mk}.

I Above, but where adversary can choose a set of valid signedmessages, specifying either the messages (corresponding to achosen plaintext attack) or the signatures (corresponding tochosen ciphertext attack).

I Any of the above, but where one wishes to protect againstgenerating any valid signed message (m′, s ′) different fromthose already seen, not just for a particular predetermined m.This is called existential forgery.

CPSC 467, Lecture 11 37/39

Page 38: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Forgery

Forging random RSA signed messages

RSA signatures are indeed vulnerable to existential forgery.

An attacker simply chooses s ′ at random and computesm′ = Ee(s ′).

The signed message (m′, s ′) is trivially valid since the verificationpredicate is simply m′ = Ee(s ′).

CPSC 467, Lecture 11 38/39

Page 39: CPSC 467: Cryptography and Computer Securityzoo.cs.yale.edu/classes/cs467/2017f/lectures/ln11.pdf · CPSC 467: Cryptography and Computer Security Michael J. Fischer ... Bob generates

Outline ElGamal Integrity/Authenticity Algorithms Security

Forgery

Importance of random signed messages

One often wants to sign random strings.

For example, in the Diffie-Hellman key exchange protocol discussedin lecture 10, Alice and Bob exchange random-looking numbersa = g x mod p and b = g y mod p.

In order to discourage man-in-the-middle attacks, they may wish tosign these strings (assuming they already have each other’s publicverification keys).

With RSA signatures, Mallory could feed bogus signed values toAlice and Bob. The signatures would check, and both would thinkthey had successfully established a shared key k when in fact theyhad not.

CPSC 467, Lecture 11 39/39