L20digital Signatures
L20digital Signatures
(CSE348)
1
Lecture # 20
2
Review
• have considered:
– Message authentication requirements
– Message authentication using encryption
– MACs
– HMAC authentication using a hash function
– CMAC authentication using a block cipher
– Pseudorandom Number Generation (PRNG) using
Hash Functions and MACs
3
Chapter 13 – Digital Signatures
4
To guard against the baneful influence exerted by strangers is
therefore an elementary dictate of savage prudence. Hence
before strangers are allowed to enter a district, or at least
before they are permitted to mingle freely with the
inhabitants, certain ceremonies are often performed by the
natives of the country for the purpose of disarming the
strangers of their magical powers, or of disinfecting, so to
speak, the tainted atmosphere by which they are supposed to
be surrounded.
—The Golden Bough, Sir James George Frazer
5
Digital Signatures
• The most important development from the work on
public-key cryptography is the digital signature
6
Digital Signatures
• A digital signature is analogous to the handwritten
signature, and provides a set of security capabilities
7
Digital Signatures
• Have looked at message authentication
– but does not address issues of lack of trust
8
Digital Signature Model
Stallings Figure 13.1 is a generic model of the
process of making and using digital signatures
9
Digital Signature Model
10
Digital Signature Model
Any other user, say Alice, can verify the signature
using a verification algorithm
11
Digital
Signature
Model
Figure 13.2
12
Digital Signature Model
In simplified terms, the essence of the digital
signature mechanism is shown in Stallings Figure
13.2
13
Attacks and Forgeries
• [GOLD88] lists the following types of attacks, in order
of increasing severity
14
Attacks and Forgeries
• Generic chosen message attack:
16
Attacks and Forgeries
• Adaptive chosen message attack:
• Universal forgery:
18
Attacks and Forgeries
• Selective forgery:
19
Attacks and Forgeries
• Existential forgery:
20
Attacks and Forgeries
• Attacks
– key-only attack
– known message attack
– generic chosen message attack
– directed chosen message attack
– adaptive chosen message attack
• Break success levels
– total break
– selective forgery
– existential forgery
21
Digital Signature Requirements
• On the basis of the properties on the previous slide
Figure 13.2
23
Digital Signature Requirements
• Provides a basis for satisfying these requirements
24
Digital Signature Requirements
Must depend on the message signed
Must use information unique to sender
to prevent both forgery and denial
Must be relatively easy to produce
Must be relatively easy to recognize & verify
Be computationally infeasible to forge
with new message for existing digital signature
with fraudulent digital signature for given message
Be practical save digital signature in storage
25
Direct Digital Signatures
• The term direct digital signature refers to a digital
signature scheme that involves only the
communicating parties (source, destination)
27
Direct Digital Signatures
• Confidentiality can be provided by further encrypting
the entire message
28
Direct Digital Signatures
• And then an outer confidentiality function
29
Direct Digital Signatures
• The universally accepted technique for dealing with
these threats is the use of a digital certificate and
certificate authorities
30
Direct Digital Signatures
• Involve only sender & receiver
31
Direct Digital Signatures
• Important that sign first then encrypt message &
signature
32
ElGamal Digital Signatures
• Elgamal announced a public-key scheme based on
discrete logarithms
33
ElGamal Digital Signatures
• ElGamal signature scheme involves the use of the
private key for encryption
38
ElGamal Digital Signature
• Alice signs a message M to Bob by computing
– the hash m = H(M), 0 <= m <= (q-1)
– chose random integer K with 1 <= K <= (q-1) and
gcd(K,q-1)=1
– compute temporary key: S1 = ak mod q
– compute K-1 the inverse of K mod (q-1)
– compute the value: S2 = K-1(m-xAS1) mod (q-1)
– signature is:(S1,S2)
39
ElGamal Digital Signature
• Any user B can verify the signature by computing
– V1 = am mod q
– V2 = yAS1 S1S2 mod q
– signature is valid if V1 = V2
40
ElGamal Signature Example
• Use field GF(19) q=19 and a=10
• Alice computes her key:
– A chooses xA=16 & computes yA=1016 mod 19 = 4
• Alice signs message with hash m=14 as (3,4):
– choosing random K=5 which has gcd(18,5)=1
– computing S1 = 105 mod 19 = 3
– finding K-1 mod (q-1) = 5-1 mod 18 = 11
– computing S2 = 11(14-16.3) mod 18 = 4
41
ElGamal Signature Example
• Any user B can verify the signature by computing
– V1 = 1014 mod 19 = 16
– V2 = 43.34 = 5184 = 16 mod 19
– since 16 = 16 signature is valid
42
Schnorr Digital Signatures
• As with the ElGamal digital signature scheme
43
Schnorr Digital Signatures
• The main work for signature generation does not
depend on the message
44
Schnorr Digital Signatures
• The message dependent part of the signature
generation requires multiplying a 2n-bit integer with an
n-bit integer
45
Schnorr Digital Signatures
• Typically, we use p approx 21024 and q approx 2160
46
Schnorr Digital Signatures
• Also uses exponentiation in a finite (Galois)
– security based on discrete logarithms, as in D-H
49
Schnorr Signature
• User signs message by
– choosing random r with 0<r<q and computing x
= ar mod p
– concatenate message with x and hash result to
computing: e = H(M || x)
– computing: y = (r + se) mod q
– signature is pair (e, y)
• Any other user can verify the signature as follows:
– computing: x' = ayve mod p
– verifying that: e = H(M || x’)
50
Digital Signature Standard (DSS)
• US Govt approved signature scheme
• designed by NIST & NSA in early 90's
• published as FIPS-186 in 1991
• revised in 1993, 1996 & then 2000
• uses the SHA hash algorithm
• DSS is the standard, DSA is the algorithm
• FIPS 186-2 (2000) includes alternative RSA & elliptic
curve signature variants
• DSA is digital signature only unlike RSA
• is a public-key technique
51
Digital Signature Algorithm (DSA)
• The DSA is based on the difficulty of computing
discrete logarithms
52
Digital Signature Algorithm (DSA)
• And faster (much of the computation is done modulo
a 160 bit number), over RSA
53
Digital Signature Algorithm (DSA)
creates a 320 bit signature
with 512-1024 bit security
smaller and faster than RSA
a digital signature scheme only
security depends on difficulty of computing discrete
logarithms
variant of ElGamal & Schnorr schemes
54
DSA Key Generation
• Have shared global public key values (p,q,g):
– choose 160-bit prime number q
– choose a large prime p with 2L-1 < p < 2L
• where L= 512 to 1024 bits and is a multiple of 64
• such that q is a 160 bit prime divisor of (p-1)
– choose g = h(p-1)/q
• where 1<h<p-1 and h(p-1)/q mod p > 1
• Users choose private & compute public key:
– choose random private key: x<q
– compute public key: y = gx mod p
55
DSA Key Generation
• DSA typically uses a common set of global parameters
(p,q,g) for a community of clients, as shown
56
DSA Key Generation
• Finally, g is chosen to be of the form h(p–1)/q mod p
57
DSA Key Generation
• Thus, the global public key components of DSA have
the same for as in the Schnorr signature scheme
58
DSA Key Generation
• However, given the public key y, it is computationally
infeasible to determine x
59
DSA Signature Creation
• To create a signature, a user calculates two
quantities, r and s
61
DSA Signature Creation
• Computing r only involves calculation mod p and
does not depend on message
62
DSA Signature Creation
To sign a message M the sender:
generates a random signature key k, k<q
nb. k must be random, be destroyed after use,
and never be reused
Then computes signature pair:
r = (gk mod p)mod q
s = [k-1(H(M)+ xr)] mod q
Sends signature (r,s) with message M
63
DSA Signature Verification
• At the receiving end, verification is performed using
the formulas shown
64
DSA Signature Verification
• That the difficulty of computing discrete logs is why it
is infeasible for an opponent to recover k from r, or x
from s
65
DSA Signature Verification
• The structure of this function is such that the
receiver can recover r using the incoming message
66
DSA Signature Verification
• Having received M & signature (r,s)
• To verify a signature, recipient computes:
w = s-1 mod q
u1= [H(M)w ]mod q
u2= (rw)mod q
v = [(gu1 yu2)mod p ]mod q
• If v=r then signature is verified
67
Summary
• have discussed:
– digital signatures
– ElGamal & Schnorr signature schemes
– digital signature algorithm and standard
68