11

Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

  • Upload
    others

  • View
    5

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 1

Cryptography and Cryptography and

Network SecurityNetwork Security

Chapter 13Chapter 13

Fifth EditionFifth Edition

by William Stallingsby William Stallings

Lecture slides by Lawrie BrownLecture slides by Lawrie Brown

09/08/10 2

Chapter 13 � Chapter 13 � Digital SignaturesDigital Signatures

To guard against the baneful influence exerted by strangers To guard against the baneful influence exerted by strangers is therefore an elementary dictate of savage prudence. is therefore an elementary dictate of savage prudence. Hence before strangers are allowed to enter a district, or Hence before strangers are allowed to enter a district, or at least before they are permitted to mingle freely with at least before they are permitted to mingle freely with the inhabitants, certain ceremonies are often performed the inhabitants, certain ceremonies are often performed by the natives of the country for the purpose of disarming by the natives of the country for the purpose of disarming the strangers of their magical powers, or of disinfecting, the strangers of their magical powers, or of disinfecting, so to speak, the tainted atmosphere by which they are so to speak, the tainted atmosphere by which they are supposed to be surrounded.supposed to be surrounded.

��The Golden BoughThe Golden Bough, Sir James George Frazer, Sir James George Frazer

Page 2: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 3

Digital SignaturesDigital Signatures

� have looked at have looked at message authentication message authentication � but does not address issues of lack of trustbut does not address issues of lack of trust

� digital signatures provide the ability to: digital signatures provide the ability to: � verify author, date & time of signatureverify author, date & time of signature� authenticate message contents authenticate message contents � be verified by third parties to resolve disputesbe verified by third parties to resolve disputes

� hence include authentication function with hence include authentication function with additional capabilitiesadditional capabilities

Page 3: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 6

Attacks and ForgeriesAttacks and Forgeries� attacksattacks

� key-only attackkey-only attack

� known message attackknown message attack

� generic chosen message attackgeneric chosen message attack

� directed chosen message attackdirected chosen message attack

� adaptive chosen message attackadaptive chosen message attack

� break success levelsbreak success levels� total breaktotal break

� selective forgeryselective forgery

� existential forgeryexistential forgery

Page 4: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 7

Digital Signature RequirementsDigital Signature Requirements

� must depend on the message signedmust depend on the message signed

� must use information unique to sendermust use information unique to sender� to prevent both forgery and denialto prevent both forgery and denial

� must be relatively easy to producemust be relatively easy to produce

� must be relatively easy to recognize & verifymust be relatively easy to recognize & verify

� be computationally infeasible to forge be computationally infeasible to forge � with new message for existing digital signaturewith new message for existing digital signature

� with fraudulent digital signature for given messagewith fraudulent digital signature for given message

� be practical save digital signature in storagebe practical save digital signature in storage

09/08/10 8

Direct Digital SignaturesDirect Digital Signatures

� involve only sender & receiverinvolve only sender & receiver� assumed receiver has sender�s public-keyassumed receiver has sender�s public-key� digital signature made by sender signing digital signature made by sender signing

entire message or hash with private-keyentire message or hash with private-key� can encrypt using receivers public-keycan encrypt using receivers public-key� important that sign first then encrypt important that sign first then encrypt

message & signaturemessage & signature� security depends on sender�s private-keysecurity depends on sender�s private-key

Page 5: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 9

ElGamal ElGamal Digital SignaturesDigital Signatures

� signature variant of ElGamal, related to D-Hsignature variant of ElGamal, related to D-H� so uses exponentiation in a finite (Galois)so uses exponentiation in a finite (Galois)� with security based difficulty of computing with security based difficulty of computing

discrete logarithms, as in D-Hdiscrete logarithms, as in D-H

� use private key for encryption (signing)use private key for encryption (signing)� uses public key for decryption (verification)uses public key for decryption (verification)

� each user (eg. A) generates their keyeach user (eg. A) generates their key

� chooses a secret key (number): chooses a secret key (number): 1 < 1 < xxAA < q-1 < q-1

� compute their compute their public keypublic key: : yyAA = = aaxxAA mod q mod q

09/08/10 10

ElGamal ElGamal Digital SignatureDigital Signature

� Alice signs a message M to Bob by computingAlice signs a message M to Bob by computing� the hash the hash m = H(M)m = H(M), , 0 <= m <= (q-1)0 <= m <= (q-1)

� chose random integer chose random integer K K with with 1 <= K <= (q-1) 1 <= K <= (q-1)

and and gcd(K,q-1)=1gcd(K,q-1)=1

� compute temporary key: compute temporary key: SS1 1 = a= akk

mod q mod q

� compute compute KK-1-1 the inverse of the inverse of K mod (q-1)K mod (q-1)

� compute the value: compute the value: SS22 = = KK-1-1(m-(m-xxAASS11) ) mod (q-1)mod (q-1)

� signature is:signature is:(S(S11,S,S22))

� any user B can verify the signature by computingany user B can verify the signature by computing� VV1 1 = a= a

mm

mod q mod q

� VV2 2 = y= yAASS11 SS11

SS22 mod q mod q

� signature is valid if signature is valid if VV1 1 = = VV22

Page 6: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 11

ElGamal ElGamal Signature Signature Example Example � use field GF(19) use field GF(19) q=19 q=19 and and aa=10=10� Alice computes her key:Alice computes her key:

� A chooses A chooses xxAA=16 =16 & computes & computes yyAA==101016 16

mod 19 = 4mod 19 = 4

� Alice signs message with hash Alice signs message with hash m=14m=14 as as ((3,43,4))::� choosing random choosing random K=5 K=5 which has which has gcd(18,5)=1gcd(18,5)=1

� computing computing SS1 1 = 10= 1055

mod 19 = 3 mod 19 = 3

� finding finding KK-1-1 mod (q-1) = 5 mod (q-1) = 5-1-1 mod 18 = 11 mod 18 = 11

� computing computing SS22 = = 11(14-11(14-16.3) 16.3) mod 18 = 4mod 18 = 4

� any user B can verify the signature by computingany user B can verify the signature by computing� VV1 1 = 10= 10

1414

mod 19 = 16 mod 19 = 16

� VV2 2 = 4= 433.3.344 = 5184 = 16 mod 19 = 5184 = 16 mod 19

� since since 1616 = = 1616 signature is valid signature is valid

09/08/10 12

Schnorr Schnorr Digital SignaturesDigital Signatures� also uses exponentiation in a finite (Galois)also uses exponentiation in a finite (Galois)

� security based on discrete logarithms, as in D-Hsecurity based on discrete logarithms, as in D-H

� minimizes message dependent computationminimizes message dependent computation� multiplying a 2multiplying a 2n-bit n-bit integer with an integer with an n-bit n-bit integerinteger

� main work can be done in idle timemain work can be done in idle time

� have using a prime modulus have using a prime modulus pp � p�1 p�1 has a prime factor has a prime factor qq of appropriate sizeof appropriate size

� typicallytypically pp 1024-bit and 1024-bit and qq 160-bit numbers 160-bit numbers

Page 7: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 13

Schnorr Schnorr Key SetupKey Setup� choose suitable primes choose suitable primes pp , q, q

� choose choose aa such that such that aaqq

= 1 mod p = 1 mod p

� (a,p,q) (a,p,q) are global parameters for allare global parameters for all

� each user (eg. A) generates a keyeach user (eg. A) generates a key

� chooses a secret key (number): chooses a secret key (number): 0 < 0 < ssAA < q < q

� compute their compute their public keypublic key: : vvAA = = aa-s-sAA mod q mod q

09/08/10 14

Schnorr Schnorr SignatureSignature� user signs message byuser signs message by

� choosing random choosing random rr with with 0<r<q 0<r<q and computing and computing

x = ax = arr mod p mod p

� concatenate message with concatenate message with xx and hash result to and hash result to

computing: computing: e = H(M || x) e = H(M || x)

� computing: computing: y = (r + se) mod q y = (r + se) mod q

� signature is pair signature is pair (e, y)(e, y)

� any other user can verify the signature as follows: any other user can verify the signature as follows:

� computing: computing: x' = ax' = ayyvvee mod p mod p

� verifying that: verifying that: e = H(M || x�) e = H(M || x�)

Page 8: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 15

Digital Signature Digital Signature Standard Standard (DSS)(DSS)

� US Govt approved signature schemeUS Govt approved signature scheme� designed by NIST & NSA in early 90's designed by NIST & NSA in early 90's � published as FIPS-186 in 1991published as FIPS-186 in 1991� revised in 1993, 1996 & then 2000revised in 1993, 1996 & then 2000� uses the SHA hash algorithm uses the SHA hash algorithm � DSS is the standard, DSA is the algorithmDSS is the standard, DSA is the algorithm� FIPS 186-2 (2000) includes alternative RSA & FIPS 186-2 (2000) includes alternative RSA &

elliptic curve signature variantselliptic curve signature variants� DSA is digital signature only unlike RSADSA is digital signature only unlike RSA� is is a public-key techniquea public-key technique

Page 9: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 17

Digital Signature Digital Signature Algorithm Algorithm (DSA)(DSA)

� creates a 320 bit signaturecreates a 320 bit signature

� with 512-1024 bit securitywith 512-1024 bit security

� smaller and faster than RSAsmaller and faster than RSA

� a digital signature scheme onlya digital signature scheme only

� security depends on difficulty of security depends on difficulty of

computing discrete logarithmscomputing discrete logarithms

� variant of ElGamal & Schnorr schemesvariant of ElGamal & Schnorr schemes

09/08/10 18

DSA Key GenerationDSA Key Generation

� have shared global public key values (p,q,g): have shared global public key values (p,q,g): � choose 160-bit prime number qchoose 160-bit prime number q

� choose a large prime p with choose a large prime p with 22L-1L-1 << p < 2p < 2LL � where L= 512 to 1024 bits and is a multiple of 64where L= 512 to 1024 bits and is a multiple of 64

� such that q is a 160 bit prime divisor of such that q is a 160 bit prime divisor of (p-1)(p-1)

� choose choose g = hg = h(p-1)/q(p-1)/q � where where 1<h<p-1 1<h<p-1 andand h h(p-1)/q (p-1)/q mod p > 1mod p > 1

� users choose private & compute public key: users choose private & compute public key: � choose random private key: choose random private key: x<qx<q

� compute public key: compute public key: y = gy = gx x mod pmod p

Page 10: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 19

DSA Signature CreationDSA Signature Creation

� to to signsign a message a message MM the sender: the sender:� generates a random signature key generates a random signature key k, k<qk, k<q

� nb. nb. kk must be random, be destroyed after must be random, be destroyed after

use, and never be reuseduse, and never be reused

� then computes signature pair: then computes signature pair:

r = (gr = (gkk mod p)mod q mod p)mod q

s = [ks = [k-1-1(H(M)+ xr)] mod q(H(M)+ xr)] mod q

� sends signature sends signature (r,s)(r,s) with message with message MM

09/08/10 20

DSA Signature Verification DSA Signature Verification

� having received M & having received M & signature signature (r,s)(r,s)

� to to verifyverify a signature, recipient computes: a signature, recipient computes:

w = sw = s-1 -1 mod q mod q

u1= [H(M)w ]mod q u1= [H(M)w ]mod q

u2= (rw)mod qu2= (rw)mod q

v = [(gv = [(gu1u1 y yu2u2)mod p ]mod q)mod p ]mod q

� if if v=rv=r then signature is verified then signature is verified

� see Appendix A for details of proof whysee Appendix A for details of proof why

Page 11: Cryptography and Network Security Chapter 13 · 2010. 9. 8. · 09/08/10 1 Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie

09/08/10 22

SummarySummary

� have discussed:have discussed:� digital signaturesdigital signatures

� ElGamal & Schnorr signature schemesElGamal & Schnorr signature schemes

� digital signature algorithm and standarddigital signature algorithm and standard