Dss digital signature standard and dsa algorithm

DSS: Digital Signature Standard
and DSA Algorithm
Michael Pace
In this paper I will discuss the Digital Signature Standard (DSS) and the DSA algorithm. This
standard will have will have a great effect on all of our federal agencies because they are
required to use this standard when transmitting information that is not declassified. This
standard is also available to the private sector and commercial organizations. The DSS is
necessary to make sure that our governments’ communications are secure. The standard ensures
that these federal agencies that may have not had a secure algorithm to transmit data will now
have such a means to make sure communications are secure.
What is a Digital Signature?
Digital signatures are essential in today’s modern world to verify the sender of a
document’s identity. A digital signature is represented in a computer as a string of binary digits.
The signature is computer using a set of rules and parameters (algorithm) such that the identity of
the person signing the document as well as the originality of the data can be verified. The
signature is generated by the use of a private key. A private key is known only to the user. The
signature is verified makes use of a public key which corresponds to (but not the same, i.e.
mathematically infeasible to deduct private key from public) the private key. With every user
having a public/private key pair, this is an example of public-key cryptography. Public keys,
which are known by everyone, can be used to verify the signature of a user. The private key,
which is never shared, is used in signature generation, which can only be done by the user.
Digital signatures are used to detect unauthorized modifications to data. Also, the
recipient of a digitally signed document in proving to a third party that the document was indeed
signed by the person who it is claimed to be signed by. This is known as nonrepudiation,
because the person who signed the document cannot repudiate the signature at a later time.
Digital signature algorithms can be used in e-mails, electronic funds transfer, electronic data
interchange, software distribution, data storage, and just about any application that would need to
assure the integrity and originality of data.
What is in the Standard?
There are three algorithms that are suitable for digital signature generation under the DSS
standard. They are the Digital Signature Algorithm (DSA, which I will talk about more in depth
later), the RSA algorithm, and the Elliptic Curve Digital Signature Algorithm (ECDSA). Also in
this standard is a hash function to be used in the signature generation process. It is used to obtain
a condensed version of the data, which is called a message digest. This message digest is then
put into the digital signature algorithm to generate the digitally signed message. The same hash
function is used in the verification process as well. The hash function used in the DSS standard
is specified in the Secure Hash Standard (SHS), which are the specifications for the Secure Hash
Algorithm (SHA). The SHA is based on principles similar to those used by Professor Ronald L.
Rivest of MIT when designing the MD4 message digest algorithm and is closely modeled after
that algorithm. When a message of any length < 264
bits is input, the SHA produces a 160-bit
output (message digest). Signing the message digest rather than the message often improves the
efficiency of the process because the message digest is usually much smaller in size than the
message.
2
2
THE DSA ALGORITHM
DSA Parameters:
• p = a prime modulus, where 2L-1
< p < 2L
for 512 ≤ L ≤ 1024 and L is a multiple of 64. So
L will be one member of the set {512, 576, 640, 704, 768, 832, 896, 960, 1024}
• q = a prime divisor of p-1, where 2159
< q < 2160
Generation of Prime p and q
The generation is hard to understand but I found a good description of it…
The prime generation scheme starts by using the SHA and a user supplied SEED to construct a
prime, q, in the range 2159
< q < 2160
. Once this is accomplished, the same SEED value is used to
construct an X in the range 2L-1
< X < 2L
. The prime, p, is then formed by rounding X to a
number congruent to 1 mod 2q as described below. An integer x in the range 0 ≤ x < 2 g may be
converted to a g-long sequence of bits by using its binary expansion as shown below:
x = x1* 2g-1
+ x2* 2g-2
+ ... + xg-1* 2 + xg -> { x1,..., xg }.
Conversely, a g-long sequence of bits { x1,..., xg } is converted to an integer by the rule
{ x1,..., xg } -> x1* 2g-1
+ x2* 2g-2
+ ... + xg-1* 2 + xg.
Note that the first bit of a sequence corresponds to the most significant bit of the corresponding
integer and the last bit to the least significant bit.
Let L -1 = n* 160 + b, where both b and n are integers and 0 ≤ b < 160.
Step 1. Choose an arbitrary sequence of at least 160 bits and call it SEED. Let g be the length
of SEED in bits.
3
3
Step 2. Compute
U = SHA-1[ SEED] XOR SHA-1[( SEED+ 1) mod 2 g ].
Step 3. Form q from U by setting the most significant bit (the 2159
bit) and the least significant
bit to 1. In terms of Boolean operations, q = U OR 2159
OR 1. Note that 2159
< q < 2160
.
Step 4. Use a robust primality testing algorithm to test whether q is prime 1 .
Step 5. If q is not prime, go to step 1.
Step 6. Let counter = 0 and offset = 2.
Step 7. For k = 0,..., n let
Vk = SHA-1[( SEED + offset + k) mod 2g
].
1 A robust primality test is one where the probability of a non-prime number passing the test is at
most 2-80
Step 8. Let W be the integer
W = V0 + V1* 2160
+ ... + Vn-1* 2(n-1)* 160
+ (Vn mod 2b
) * 2n* 160
and let X = W + 2L-1
. Note that 0 ≤ W < 2L-1
and hence 2L-1
≤ X < 2L
.
Step 9. Let c = X mod 2q and set p = X -(c -1). Note that p is congruent to 1 mod 2q.
Step 10. If p < 2L-1
, then go to step 13.
Step 11. Perform a robust primality test on p.
Step 12. If p passes the test performed in step 11, go to step 15.
Step 13. Let counter = counter + 1 and offset = offset + n + 1.
Step 14. If counter ≥ 212
= 4096 go to step 1, otherwise (i. e. if counter < 4096) go to step 7.
Step 15. Save the value of SEED and the value of counter for use in certifying the proper
generation of p and q.
4
4
• g = h(p-1)/ q
mod p, where h is any integer with 1 < h < p -1 such that h(p-1)/ q
mod p > 1
(g has order q mod p)
• x = a randomly or pseudorandomly generated integer with 0 < x < q
• y = gx
mod p
• k = a randomly or pseudorandomly generated integer with 0 < k < q
The parameters p, q, and g are made public. The users will have the private key, x, and the
public key y. The parameters x and k are used for signature generation and must be kept private
and k will be randomly or pseudorandomly generated for each signature. This part seems to be
straightforward so far.
The signature of the message M will be a pair of the numbers r and s which will be computed
from the following equations.
r = (gk
mod p) mod q
s = (k-1
(SHA(M) + xr)) mod q
k-1
is the multiplicative inverse of k (mod q). The value of SHA(M) is a 160-bit string which is
converted into an integer according to the SHS standard. Then the signature is sent to the
verifier.
Verification:
Before getting the digitally signed message the receiver must know the parameters p, q,
g, and the sender’s public key y.
5
5
We will let M′, r′, s′ be the received versions of M, r, and s. To verify the signature the verifying
program must check to see that 0 < r′ < q and 0 < s′ < q and if either fails the signature should be
rejected. If both of the conditions are satisfied then we will compute
w = (s′)-1
mod q
u1 = ((SHA(M′))w) mod q
u2 = ((r′)w) mod q
v = (((g)u1
(y)u2
) mod p) mod q
Then if v = r′ then the signature is valid and if not then it can be assumed that the data may have
been changed or the message was sent by an impostor.
Bibliography
1. Federal Information Processing Standards Publication 186.
http://www.itl.nist.gov/fipspubs/fip186.htm
2. DSA: Digital Signature Algorithm. DSS: Digital Signature Standard.
http://home.pacbell.net/tpanero/crypto/dsa.html
3. Digital Signature Standard (DSA ElGamal ). http://www-
2.cs.cmu.edu/afs/cs/academic/class/15827-f98/www/Slides/lecture2/base.024.html
6
6
We will let M′, r′, s′ be the received versions of M, r, and s. To verify the signature the verifying
program must check to see that 0 < r′ < q and 0 < s′ < q and if either fails the signature should be
rejected. If both of the conditions are satisfied then we will compute
w = (s′)-1
mod q
u1 = ((SHA(M′))w) mod q
u2 = ((r′)w) mod q
v = (((g)u1
(y)u2
) mod p) mod q
Then if v = r′ then the signature is valid and if not then it can be assumed that the data may have
been changed or the message was sent by an impostor.
Bibliography
1. Federal Information Processing Standards Publication 186.
http://www.itl.nist.gov/fipspubs/fip186.htm
2. DSA: Digital Signature Algorithm. DSS: Digital Signature Standard.
http://home.pacbell.net/tpanero/crypto/dsa.html
3. Digital Signature Standard (DSA ElGamal ). http://www-
2.cs.cmu.edu/afs/cs/academic/class/15827-f98/www/Slides/lecture2/base.024.html
6
6

Recomendados

Digital signature schemes von
Digital signature schemesDigital signature schemes
Digital signature schemesravik09783
6.5K views22 Folien
Elgamal digital signature von
Elgamal digital signatureElgamal digital signature
Elgamal digital signatureMDKAWSARAHMEDSAGAR
554 views8 Folien
Public Key Cryptosystem von
Public Key CryptosystemPublic Key Cryptosystem
Public Key CryptosystemDevakumar Kp
16.5K views19 Folien
Key Management and Distribution von
Key Management and DistributionKey Management and Distribution
Key Management and DistributionSyed Bahadur Shah
2.1K views32 Folien
X.509 Certificates von
X.509 CertificatesX.509 Certificates
X.509 CertificatesSou Jana
500 views12 Folien
Hash Function von
Hash FunctionHash Function
Hash FunctionSiddharth Srivastava
24.2K views32 Folien

Más contenido relacionado

Was ist angesagt?

Network security cryptographic hash function von
Network security  cryptographic hash functionNetwork security  cryptographic hash function
Network security cryptographic hash functionMijanur Rahman Milon
3.3K views22 Folien
Rsa von
RsaRsa
Rsaismaelhaider
2.2K views23 Folien
SHA512.pptx von
SHA512.pptxSHA512.pptx
SHA512.pptxssuserb4287c
180 views19 Folien
kerberos von
kerberoskerberos
kerberossameer farooq
12.8K views24 Folien
Data Encryption Standard (DES) von
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)Haris Ahmed
34.1K views32 Folien
Hash Function von
Hash FunctionHash Function
Hash Functionstalin rijal
775 views10 Folien

Was ist angesagt?(20)

Data Encryption Standard (DES) von Haris Ahmed
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)
Haris Ahmed34.1K views
Diffie hellman key exchange algorithm von Sunita Kharayat
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithm
Sunita Kharayat1.5K views
PGP S/MIME von Sou Jana
PGP S/MIMEPGP S/MIME
PGP S/MIME
Sou Jana154 views
Digital Signature Standard von Sou Jana
Digital Signature StandardDigital Signature Standard
Digital Signature Standard
Sou Jana519 views
PUBLIC KEY ENCRYPTION von raf_slide
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTION
raf_slide28.9K views
6. cryptography von 7wounders
6. cryptography6. cryptography
6. cryptography
7wounders5.6K views
Secure Shell(ssh) von Pina Parmar
Secure Shell(ssh)Secure Shell(ssh)
Secure Shell(ssh)
Pina Parmar3.5K views
Principles of public key cryptography and its Uses von Mohsin Ali
Principles of  public key cryptography and its UsesPrinciples of  public key cryptography and its Uses
Principles of public key cryptography and its Uses
Mohsin Ali3.1K views
Cryptography and authentication von mbadhi
Cryptography and authenticationCryptography and authentication
Cryptography and authentication
mbadhi350 views

Destacado

Introduction to Digital signatures von
Introduction to Digital signaturesIntroduction to Digital signatures
Introduction to Digital signaturesRohit Bhat
56.4K views25 Folien
Digital Signature von
Digital SignatureDigital Signature
Digital Signaturesaurav5884
43.4K views13 Folien
Eaack—a secure intrusion detection.ppt von
Eaack—a secure intrusion detection.pptEaack—a secure intrusion detection.ppt
Eaack—a secure intrusion detection.pptslksagar
3.9K views22 Folien
Digital signature algorithm (de la cruz, genelyn).ppt 2 von
Digital signature algorithm (de la cruz, genelyn).ppt 2Digital signature algorithm (de la cruz, genelyn).ppt 2
Digital signature algorithm (de la cruz, genelyn).ppt 2YooGenelyn
8.3K views19 Folien
Digital signature von
Digital  signatureDigital  signature
Digital signatureAJAL A J
2.7K views31 Folien
RSA ALGORITHM von
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHMSathish Kumar
9.4K views19 Folien

Destacado(18)

Introduction to Digital signatures von Rohit Bhat
Introduction to Digital signaturesIntroduction to Digital signatures
Introduction to Digital signatures
Rohit Bhat56.4K views
Digital Signature von saurav5884
Digital SignatureDigital Signature
Digital Signature
saurav588443.4K views
Eaack—a secure intrusion detection.ppt von slksagar
Eaack—a secure intrusion detection.pptEaack—a secure intrusion detection.ppt
Eaack—a secure intrusion detection.ppt
slksagar3.9K views
Digital signature algorithm (de la cruz, genelyn).ppt 2 von YooGenelyn
Digital signature algorithm (de la cruz, genelyn).ppt 2Digital signature algorithm (de la cruz, genelyn).ppt 2
Digital signature algorithm (de la cruz, genelyn).ppt 2
YooGenelyn8.3K views
Digital signature von AJAL A J
Digital  signatureDigital  signature
Digital signature
AJAL A J2.7K views
Digital signature von Yash Karanke
Digital signatureDigital signature
Digital signature
Yash Karanke12.6K views
Digital signatures von Ishwar Dayal
Digital signaturesDigital signatures
Digital signatures
Ishwar Dayal11.6K views
Public Key Cryptography and RSA algorithm von Indra97065
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
Indra9706516.2K views
Digital signature von AJAL A J
Digital  signatureDigital  signature
Digital signature
AJAL A J21.7K views
Seminar ppt on digital signature von jolly9293
Seminar ppt on digital signatureSeminar ppt on digital signature
Seminar ppt on digital signature
jolly929361K views

Similar a Dss digital signature standard and dsa algorithm

Information and network security 46 digital signature algorithm von
Information and network security 46 digital signature algorithmInformation and network security 46 digital signature algorithm
Information and network security 46 digital signature algorithmVaibhav Khanna
93 views11 Folien
Digital signature von
Digital signatureDigital signature
Digital signatureNisha Menon K
967 views33 Folien
RSA & MD5 algorithm von
RSA & MD5 algorithmRSA & MD5 algorithm
RSA & MD5 algorithmSiva Rushi
12.6K views21 Folien
Final ss2-digital-signature-group5 von
Final ss2-digital-signature-group5Final ss2-digital-signature-group5
Final ss2-digital-signature-group5Phan Minh
236 views26 Folien
Chapter 06 rsa cryptosystem von
Chapter 06   rsa cryptosystemChapter 06   rsa cryptosystem
Chapter 06 rsa cryptosystemAnkur Choudhary
439 views15 Folien
Introduction to cryptography von
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptographySuresh Thammishetty
1.8K views31 Folien

Similar a Dss digital signature standard and dsa algorithm(20)

Information and network security 46 digital signature algorithm von Vaibhav Khanna
Information and network security 46 digital signature algorithmInformation and network security 46 digital signature algorithm
Information and network security 46 digital signature algorithm
Vaibhav Khanna93 views
RSA & MD5 algorithm von Siva Rushi
RSA & MD5 algorithmRSA & MD5 algorithm
RSA & MD5 algorithm
Siva Rushi12.6K views
Final ss2-digital-signature-group5 von Phan Minh
Final ss2-digital-signature-group5Final ss2-digital-signature-group5
Final ss2-digital-signature-group5
Phan Minh236 views
Implementation of RSA Algorithm with Chinese Remainder Theorem for Modulus N ... von CSCJournals
Implementation of RSA Algorithm with Chinese Remainder Theorem for Modulus N ...Implementation of RSA Algorithm with Chinese Remainder Theorem for Modulus N ...
Implementation of RSA Algorithm with Chinese Remainder Theorem for Modulus N ...
CSCJournals109 views
Information and network security 45 digital signature standard von Vaibhav Khanna
Information and network security 45 digital signature standardInformation and network security 45 digital signature standard
Information and network security 45 digital signature standard
Vaibhav Khanna140 views
Research on RSA von faizmajeed
Research on RSAResearch on RSA
Research on RSA
faizmajeed300 views
TLS/SSL Internet Security Talk von Nisheed KM
TLS/SSL Internet Security TalkTLS/SSL Internet Security Talk
TLS/SSL Internet Security Talk
Nisheed KM744 views
Computer System Security (UNIT IV) For AKTU Lucknow von Brijesh Vishwakarma
Computer System Security (UNIT IV) For AKTU LucknowComputer System Security (UNIT IV) For AKTU Lucknow
Computer System Security (UNIT IV) For AKTU Lucknow
Brijesh Vishwakarma1.6K views
Survey of Hybrid Encryption Algorithm for Mobile Communication von ijsrd.com
Survey of Hybrid Encryption Algorithm for Mobile CommunicationSurvey of Hybrid Encryption Algorithm for Mobile Communication
Survey of Hybrid Encryption Algorithm for Mobile Communication
ijsrd.com1.1K views
Design Of Elliptic Curve Crypto Processor with Modified Karatsuba Multiplier ... von ijdpsjournal
Design Of Elliptic Curve Crypto Processor with Modified Karatsuba Multiplier ...Design Of Elliptic Curve Crypto Processor with Modified Karatsuba Multiplier ...
Design Of Elliptic Curve Crypto Processor with Modified Karatsuba Multiplier ...
ijdpsjournal638 views
Presentation on Cryptography_Based on IEEE_Paper von Nithin Cv
Presentation on Cryptography_Based on IEEE_PaperPresentation on Cryptography_Based on IEEE_Paper
Presentation on Cryptography_Based on IEEE_Paper
Nithin Cv345 views
CRYPTOGRAPHY (2).pdf von BhuvanaR13
CRYPTOGRAPHY (2).pdfCRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdf
BhuvanaR1332 views
Authentication system for e-certificate by using RSA’s digital signature von TELKOMNIKA JOURNAL
Authentication system for e-certificate by using RSA’s digital signatureAuthentication system for e-certificate by using RSA’s digital signature
Authentication system for e-certificate by using RSA’s digital signature

Más de Abhishek Kesharwani

uptu web technology unit 2 html von
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 htmlAbhishek Kesharwani
1.5K views18 Folien
uptu web technology unit 2 html von
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 htmlAbhishek Kesharwani
605 views13 Folien
uptu web technology unit 2 html von
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 htmlAbhishek Kesharwani
564 views20 Folien
uptu web technology unit 2 html von
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 htmlAbhishek Kesharwani
558 views16 Folien
uptu web technology unit 2 html von
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 htmlAbhishek Kesharwani
540 views15 Folien
uptu web technology unit 2 Css von
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 CssAbhishek Kesharwani
805 views28 Folien

Más de Abhishek Kesharwani(20)

Dss digital signature standard and dsa algorithm

  • 1. DSS: Digital Signature Standard and DSA Algorithm Michael Pace In this paper I will discuss the Digital Signature Standard (DSS) and the DSA algorithm. This standard will have will have a great effect on all of our federal agencies because they are required to use this standard when transmitting information that is not declassified. This standard is also available to the private sector and commercial organizations. The DSS is necessary to make sure that our governments’ communications are secure. The standard ensures that these federal agencies that may have not had a secure algorithm to transmit data will now have such a means to make sure communications are secure. What is a Digital Signature? Digital signatures are essential in today’s modern world to verify the sender of a document’s identity. A digital signature is represented in a computer as a string of binary digits. The signature is computer using a set of rules and parameters (algorithm) such that the identity of the person signing the document as well as the originality of the data can be verified. The signature is generated by the use of a private key. A private key is known only to the user. The signature is verified makes use of a public key which corresponds to (but not the same, i.e. mathematically infeasible to deduct private key from public) the private key. With every user having a public/private key pair, this is an example of public-key cryptography. Public keys, which are known by everyone, can be used to verify the signature of a user. The private key, which is never shared, is used in signature generation, which can only be done by the user.
  • 2. Digital signatures are used to detect unauthorized modifications to data. Also, the recipient of a digitally signed document in proving to a third party that the document was indeed signed by the person who it is claimed to be signed by. This is known as nonrepudiation, because the person who signed the document cannot repudiate the signature at a later time. Digital signature algorithms can be used in e-mails, electronic funds transfer, electronic data interchange, software distribution, data storage, and just about any application that would need to assure the integrity and originality of data. What is in the Standard? There are three algorithms that are suitable for digital signature generation under the DSS standard. They are the Digital Signature Algorithm (DSA, which I will talk about more in depth later), the RSA algorithm, and the Elliptic Curve Digital Signature Algorithm (ECDSA). Also in this standard is a hash function to be used in the signature generation process. It is used to obtain a condensed version of the data, which is called a message digest. This message digest is then put into the digital signature algorithm to generate the digitally signed message. The same hash function is used in the verification process as well. The hash function used in the DSS standard is specified in the Secure Hash Standard (SHS), which are the specifications for the Secure Hash Algorithm (SHA). The SHA is based on principles similar to those used by Professor Ronald L. Rivest of MIT when designing the MD4 message digest algorithm and is closely modeled after that algorithm. When a message of any length < 264 bits is input, the SHA produces a 160-bit output (message digest). Signing the message digest rather than the message often improves the efficiency of the process because the message digest is usually much smaller in size than the message. 2 2
  • 3. THE DSA ALGORITHM DSA Parameters: • p = a prime modulus, where 2L-1 < p < 2L for 512 ≤ L ≤ 1024 and L is a multiple of 64. So L will be one member of the set {512, 576, 640, 704, 768, 832, 896, 960, 1024} • q = a prime divisor of p-1, where 2159 < q < 2160 Generation of Prime p and q The generation is hard to understand but I found a good description of it… The prime generation scheme starts by using the SHA and a user supplied SEED to construct a prime, q, in the range 2159 < q < 2160 . Once this is accomplished, the same SEED value is used to construct an X in the range 2L-1 < X < 2L . The prime, p, is then formed by rounding X to a number congruent to 1 mod 2q as described below. An integer x in the range 0 ≤ x < 2 g may be converted to a g-long sequence of bits by using its binary expansion as shown below: x = x1* 2g-1 + x2* 2g-2 + ... + xg-1* 2 + xg -> { x1,..., xg }. Conversely, a g-long sequence of bits { x1,..., xg } is converted to an integer by the rule { x1,..., xg } -> x1* 2g-1 + x2* 2g-2 + ... + xg-1* 2 + xg. Note that the first bit of a sequence corresponds to the most significant bit of the corresponding integer and the last bit to the least significant bit. Let L -1 = n* 160 + b, where both b and n are integers and 0 ≤ b < 160. Step 1. Choose an arbitrary sequence of at least 160 bits and call it SEED. Let g be the length of SEED in bits. 3 3
  • 4. Step 2. Compute U = SHA-1[ SEED] XOR SHA-1[( SEED+ 1) mod 2 g ]. Step 3. Form q from U by setting the most significant bit (the 2159 bit) and the least significant bit to 1. In terms of Boolean operations, q = U OR 2159 OR 1. Note that 2159 < q < 2160 . Step 4. Use a robust primality testing algorithm to test whether q is prime 1 . Step 5. If q is not prime, go to step 1. Step 6. Let counter = 0 and offset = 2. Step 7. For k = 0,..., n let Vk = SHA-1[( SEED + offset + k) mod 2g ]. 1 A robust primality test is one where the probability of a non-prime number passing the test is at most 2-80 Step 8. Let W be the integer W = V0 + V1* 2160 + ... + Vn-1* 2(n-1)* 160 + (Vn mod 2b ) * 2n* 160 and let X = W + 2L-1 . Note that 0 ≤ W < 2L-1 and hence 2L-1 ≤ X < 2L . Step 9. Let c = X mod 2q and set p = X -(c -1). Note that p is congruent to 1 mod 2q. Step 10. If p < 2L-1 , then go to step 13. Step 11. Perform a robust primality test on p. Step 12. If p passes the test performed in step 11, go to step 15. Step 13. Let counter = counter + 1 and offset = offset + n + 1. Step 14. If counter ≥ 212 = 4096 go to step 1, otherwise (i. e. if counter < 4096) go to step 7. Step 15. Save the value of SEED and the value of counter for use in certifying the proper generation of p and q. 4 4
  • 5. • g = h(p-1)/ q mod p, where h is any integer with 1 < h < p -1 such that h(p-1)/ q mod p > 1 (g has order q mod p) • x = a randomly or pseudorandomly generated integer with 0 < x < q • y = gx mod p • k = a randomly or pseudorandomly generated integer with 0 < k < q The parameters p, q, and g are made public. The users will have the private key, x, and the public key y. The parameters x and k are used for signature generation and must be kept private and k will be randomly or pseudorandomly generated for each signature. This part seems to be straightforward so far. The signature of the message M will be a pair of the numbers r and s which will be computed from the following equations. r = (gk mod p) mod q s = (k-1 (SHA(M) + xr)) mod q k-1 is the multiplicative inverse of k (mod q). The value of SHA(M) is a 160-bit string which is converted into an integer according to the SHS standard. Then the signature is sent to the verifier. Verification: Before getting the digitally signed message the receiver must know the parameters p, q, g, and the sender’s public key y. 5 5
  • 6. We will let M′, r′, s′ be the received versions of M, r, and s. To verify the signature the verifying program must check to see that 0 < r′ < q and 0 < s′ < q and if either fails the signature should be rejected. If both of the conditions are satisfied then we will compute w = (s′)-1 mod q u1 = ((SHA(M′))w) mod q u2 = ((r′)w) mod q v = (((g)u1 (y)u2 ) mod p) mod q Then if v = r′ then the signature is valid and if not then it can be assumed that the data may have been changed or the message was sent by an impostor. Bibliography 1. Federal Information Processing Standards Publication 186. http://www.itl.nist.gov/fipspubs/fip186.htm 2. DSA: Digital Signature Algorithm. DSS: Digital Signature Standard. http://home.pacbell.net/tpanero/crypto/dsa.html 3. Digital Signature Standard (DSA ElGamal ). http://www- 2.cs.cmu.edu/afs/cs/academic/class/15827-f98/www/Slides/lecture2/base.024.html 6 6
  • 7. We will let M′, r′, s′ be the received versions of M, r, and s. To verify the signature the verifying program must check to see that 0 < r′ < q and 0 < s′ < q and if either fails the signature should be rejected. If both of the conditions are satisfied then we will compute w = (s′)-1 mod q u1 = ((SHA(M′))w) mod q u2 = ((r′)w) mod q v = (((g)u1 (y)u2 ) mod p) mod q Then if v = r′ then the signature is valid and if not then it can be assumed that the data may have been changed or the message was sent by an impostor. Bibliography 1. Federal Information Processing Standards Publication 186. http://www.itl.nist.gov/fipspubs/fip186.htm 2. DSA: Digital Signature Algorithm. DSS: Digital Signature Standard. http://home.pacbell.net/tpanero/crypto/dsa.html 3. Digital Signature Standard (DSA ElGamal ). http://www- 2.cs.cmu.edu/afs/cs/academic/class/15827-f98/www/Slides/lecture2/base.024.html 6 6