Session 14 Digital Signature
Session 14 Digital Signature
Network Security
P C Gupta
1
Contents
Digital Signature
• Properties of written signature
• Required characteristics of digital signature
• RSA digital signature
• ElGamal digital signature
• Implementation & applications
• Digital Signature Algorithm (DSA)
P C Gupta 2
Written Signature
P C Gupta 3
Written Signature
P C Gupta 4
Digital Signature
P C Gupta 5
Digital Signature
P C Gupta 6
Digital Signature
P C Gupta 7
Digital Signature
P C Gupta 8
Digital Signature
P C Gupta 9
Appended Digital Signature
Digest E D h
h Compare
P C Gupta 11
Appended Digital Signature
• Let the
– RSA public key of Alice {e, n}
– RSA private key of Alice {d, n}.
Signing
– Alice signs digest x of message m using her private key
{d, n} and sends signed message {m, s} to Bob.
s = xd mod n
Verification
– Bob verifies signature s by decrypting s using Alice’s public
key {e, n}. He computes
x = se mod n
P C Gupta 13
RSA Digital Signature
Example
Digest of message {45, 11, 23} is the least significant digit of
the sum. The RSA keys are
Public key {e, n} = {7, 77},
Private key {d, n} = {43, 77}
Generate and verify RSA digital signature.
Sender
Digest {45+11+23} = {79} = 9
Signed digest s = 943 mod 77 = 58
Signed message {(45, 11, 23), 58}
Receiver
Digest {45+11+23} = {79} = 9
Verification 587 mod 77 = 9
P C Gupta 14
Security of RSA Digital Signature
P C Gupta 15
ElGamal Digital Signature
P C Gupta 16
ElGamal Digital Signature
Verification
a) Bob computes v1 and v2 as given below.
v1 = gx mod p
v2 = (gd)rrs mod p
b) He accepts the signed message iff v1 = v2.
v2 = (gd)rrs mod p = gdr(gk)s mod p = gdr + ks mod p
= gx+i(p1) mod p for some integer i.
= gxg i(p1) mod p
But, for cyclic group gi(p1) mod p = 1, we get
v2 = gx mod p = v1
P C Gupta 17
ElGamal Digital Signature
Example
{p, g, gd} = {23, 5, 10}, d = 3, k = 9, x = 7
r = gk mod p = 59 mod 23 = 11
s = (h – dr) k1 mod (p – 1)
= (7 3 11) 5 mod 22 = 2
v1= gh mod p = 57 mod 23 = 17
v2= (ga)rrs mod p = 1011 112 mod 23 = 17
P C Gupta 18
Security of ElGamal Digital Signature
P C Gupta 19
Security of ElGamal Digital Signature
Example
ElGamal public key {p, g, gd}={23, 5, 10}
Message digests x1 = 7, x2 = 4
Signatures s1 = 2, s2 = 9
Hint r = 11
P C Gupta 20
Implementation
Public-key Certificates
• Alice sends her public key with signed message to Bob
for signature verification.
• Adversary can pose as Alice and send a fraudulent
signed message with his public key to Bob. Bob will find
the signature in order.
• To prevent such frauds,
– a trusted Certification Authority (CA) is established. CA
issues public-key certificates to users.
– Every signed message must be accompanied with the
sender’s public-key certificate issued by the CA.
– The receiver
verifies the certificate with CA and then
uses the public-key given in the certificate for
signature verification.
P C Gupta 21
Blind Signature
P C Gupta 22
Blind Signature
P C Gupta 23
Digital Signature Algorithm (DSA)
Signing
d) Alice chooses a random number k, 0<k<q & computes
1) Hint r = (gk mod p) mod q
2) Signature s on digest x s = (x + dr) k 1 mod q
Different k is used for each instance of signing.
She sends the message with appended signature {r, s}.
Verification
a) Bob computes digest (x) of message & determines u1,
u2 and verifier v using Alice’s public key gd .
u1 = xs1 mod q
u2 = rs1 mod q
v [g u1 (g d )u2 mod p] mod q
b) He accepts the signature if v = r.
P C Gupta 25
Digital Signature Algorithm (DSA)
Example
a) Alice chooses p=23, q=11, a=5 & her private key d=8.
b) She computes her public key.
g = a(p – 1)/q mod p = 522/11 mod 23 = 2
gd mod p = 28 mod 23 = 3
Alice’s public key is {p, q, g, gd} = {23, 11, 2, 3}.
c) Alice chooses random number k = 5 and computes hint r
and signature s on digest x = 12.
r = (gk mod p) mod q
= (25 mod 23) mod 11 =9
s = (x + dr) k 1 mod q
= (12 + 8 9) 51 mod 11 = 8
Alice sends the message, her public key & signature s
with hint r to Bob.
P C Gupta 26
Digital Signature Algorithm (DSA)
P C Gupta 27