Digital Signatures: Cryptography
Digital Signatures: Cryptography
CRYPTOGRAPHY
Digital Signatures
Digital Signatures
• Digital signatures: One party generates signature,
many parties can verify.
• Digital Signature: a data string which associates a
message with some originating entity.
• Digital Signature Scheme:
– a signing algorithm: takes a message and a (private) signing
key, outputs a signature
– a verification algorithm: takes a (public) verification key, a
message, and a signature
• Provides:
– Authentication, Data integrity, Non-Repudiation
Digital Signatures Scheme
Used to provide
◼ Data integrity
◼ Message authentication
◼ Non-repudiation
RSA signature algorithm
“Textbook RSA” Signatures
Key generation (as in RSA encryption):
Public key: (e, n) used for verification
Private key: d, used for generation
Signing message m with private key
• Compute = md mod n
Verifying signature using public key (e, n)
• Check whether e mod n = m
Insecurity of “Textbook RSA”
• A no-message attack
– Choose arbitrary , compute m= e mod n
– (m,) is a valid pair
• Forging signature on arbitrary message
– To forge signature on message m
• query signing oracle for m1 (obtaining 1)
• m2=m/m1 (mod n) (obtaining 2)
– (m, 1 2) is a valid pair
RSA Signatures with Hash
Use a hash function H: {0,1}*→ Zn*
d
Note: Y is a public parameter, y = g (mod p)
r = (gk(mod p))(mod q)
s = k-1(H(M)+ d.r)(mod q)
w = s-1(mod q)
u1= (H(M).w)(mod q)
u2= (r.w)(mod q)
v = (gu1.yu2(mod p)) (mod q)
Proof:?
v = (gu1.yu2(mod p)) (mod q)
= (gu1 yu2 mod p) mod q
= ( gh(M)s^{-1} gd.r.s^{-1} mod p) mod q
=(g(h(M)+dr)s^{-1} mod p) mod q
= gk (mod p) mod q
= r
DSA Example Signature: (r, s)
r = (gk mod p) mod q
s = k-1 ( h(M) + d.r) mod q
◼ Take q=101, p=7879, g=170,
d=75; then Y=4567
n = 23
E = 29 : y = x + x + 4
2 3
# E = 29 group is cyclic
The points in E are and the following:
P = (0, 2) 2P = (13, 12) 3P = (11, 9) 4P = (1, 12)
5P = (7, 20) 6P = (9, 11) 7P = (15, 9) 8P = (14, 5)
9P = (4, 7) 10P = (22, 5) 11P = (10, 5) 12P = (17, 9)
13P = (8, 15) 14P = (18, 9) 15P = (18, 14) 16P = (8, 8)
17P = (17, 14) 18P = (10, 18) 19P = (22, 18) 20P = (4, 16)
21P = (14, 18) 22P = (15, 17) 23P = (9, 12) 24P = (7, 3)
25P = (1, 11) 26P = (11, 14) 27P = (13, 11) 28P = (0, 21)
29P = O 30P = P
29 points
Key pair
Alice(signer)
D = (q, a, b, G, n)
Key generation:
1. Select random d: 1 ≤ d ≤ n-1
2. Q = d·G
Q(xQ, yQ) is public d is private
n = 23, q : y 2 = x 3 + x + 4
G = (0,2) d = 25 → private key
Q=25. G= (1,11)→ public key
D = (q, 1, 4, G, 23)
ECDSA generation & verification
Alice Bob
Parameters D = (q, a, b, G, n) Parameters D = (q, a, b, G, n, h)
Associated keys (d, Q) Alice’s public key Q
Alice’s signature (r, s) on m
To sign message m: To verify signature (r, s):
1. k randomly chosen 0 < k < n-1 1. check: 1 ≤ r ≤ n-1, 1 ≤ s ≤ n -1
2. k·G = (x1, y1) r =x1 mod n 2. e = SHA-1(m)
3. if r = 0 abort and start again 3. w = s-1 mod n
4. e = SHA-1(m) 4. u1 = e·w mod n u2 = r·w mod n
5. s = k-1· ( e + d·r) mod n 5. X = u1·G + u2·Q, if X = → reject
6. if s = 0 abort and start again 6. X=(x1, y1) v = x1 mod n
Output: (r, s) 7. if v = r → accept
D, Q, m, r, s
Proof that signature verification works:
s = k −1 (e + dr ) modn k s −1 (e + dr ) s −1e + s −1rd we + wrd u1 + u2 d modn
u1G + u2Q = ( u1 + u2 d )G = kG v = r
END