Digital Signature Algorithm
   HOME

TheInfoList



OR:

The Digital Signature Algorithm (DSA) is a
public-key cryptosystem Public-key cryptography, or asymmetric cryptography, is the field of cryptographic systems that use pairs of related keys. Each key pair consists of a public key and a corresponding private key. Key pairs are generated with cryptographic alg ...
and
Federal Information Processing Standard The Federal Information Processing Standards (FIPS) of the United States are a set of publicly announced standards that the National Institute of Standards and Technology (NIST) has developed for use in computer systems of non-military, American ...
for
digital signature A digital signature is a mathematical scheme for verifying the authenticity of digital messages or documents. A valid digital signature, where the prerequisites are satisfied, gives a recipient very high confidence that the message was created b ...
s, based on the mathematical concept of
modular exponentiation Modular exponentiation is exponentiation performed over a modulus. It is useful in computer science, especially in the field of public-key cryptography, where it is used in both Diffie-Hellman Key Exchange and RSA public/private keys. Modul ...
and the
discrete logarithm problem In mathematics, for given real numbers ''a'' and ''b'', the logarithm log''b'' ''a'' is a number ''x'' such that . Analogously, in any group ''G'', powers ''b'k'' can be defined for all integers ''k'', and the discrete logarithm log''b'' ...
. DSA is a variant of the Schnorr and
ElGamal In cryptography, the ElGamal encryption system is an asymmetric key encryption algorithm for public-key cryptography which is based on the Diffie–Hellman key exchange. It was described by Taher Elgamal in 1985. ElGamal encryption is used in th ...
signature schemes. The
National Institute of Standards and Technology The National Institute of Standards and Technology (NIST) is an agency of the United States Department of Commerce whose mission is to promote American innovation and industrial competitiveness. NIST's activities are organized into physical sci ...
(NIST) proposed DSA for use in their
Digital Signature Standard The Digital Signature Standard (DSS) is a Federal Information Processing Standard specifying a suite of algorithms that can be used to generate digital signatures established by the U.S. National Institute of Standards and Technology (NIST) in 1994 ...
(DSS) in 1991, and adopted it as FIPS 186 in 1994. Four revisions to the initial specification have been released. The newest specification is
FIPS 186-4
from July 2013. DSA is patented but NIST has made this patent available worldwide royalty-free. A draft version of the specificatio
FIPS 186-5
indicates DSA will no longer be approved for digital signature generation, but may be used to verify signatures generated prior to the implementation date of that standard.


Overview

The DSA works in the framework of public-key cryptosystems and is based on the algebraic properties of
modular exponentiation Modular exponentiation is exponentiation performed over a modulus. It is useful in computer science, especially in the field of public-key cryptography, where it is used in both Diffie-Hellman Key Exchange and RSA public/private keys. Modul ...
, together with the
discrete logarithm problem In mathematics, for given real numbers ''a'' and ''b'', the logarithm log''b'' ''a'' is a number ''x'' such that . Analogously, in any group ''G'', powers ''b'k'' can be defined for all integers ''k'', and the discrete logarithm log''b'' ...
, which is considered to be computationally intractable. The algorithm uses a key pair consisting of a public key and a private key. The private key is used to generate a digital signature for a message, and such a signature can be verified by using the signer's corresponding public key. The digital signature provides
message authentication In information security, message authentication or data origin authentication is a property that a message has not been modified while in transit (data integrity) and that the receiving party can verify the source of the message. Message authentica ...
(the receiver can verify the origin of the message),
integrity Integrity is the practice of being honest and showing a consistent and uncompromising adherence to strong moral and ethical principles and values. In ethics, integrity is regarded as the honesty and truthfulness or accuracy of one's actions. Inte ...
(the receiver can verify that the message has not been modified since it was signed) and
non-repudiation Non-repudiation refers to a situation where a statement's author cannot successfully dispute its authorship or the validity of an associated contract. The term is often seen in a legal setting when the authenticity of a signature is being challenged ...
(the sender cannot falsely claim that they have not signed the message).


History

In 1982, the U.S government solicited proposals for a public key signature standard. In August 1991 the
National Institute of Standards and Technology The National Institute of Standards and Technology (NIST) is an agency of the United States Department of Commerce whose mission is to promote American innovation and industrial competitiveness. NIST's activities are organized into physical sci ...
(NIST) proposed DSA for use in their Digital Signature Standard (DSS). Initially there was significant criticism, especially from
software Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work. At the lowest programming level, executable code consists ...
companies that had already invested effort in developing digital signature software based on the
RSA cryptosystem RSA (Rivest–Shamir–Adleman) is a public-key cryptosystem that is widely used for secure data transmission. It is also one of the oldest. The acronym "RSA" comes from the surnames of Ron Rivest, Adi Shamir and Leonard Adleman, who publicly ...
. Nevertheless, NIST adopted DSA as a Federal standard (FIPS 186) in 1994. Four revisions to the initial specification have been released: FIPS 186–1 in 1998, FIPS 186–2 in 2000, FIPS 186–3 in 2009, and FIPS 186–4 in 2013. A draft version of standard FIPS 186-5 forbids signing with DSA, while allowing verification of signatures generated prior to the implementation date of the standard as a document. It is to be replaced by newer signature schemes such as
EdDSA In public-key cryptography, Edwards-curve Digital Signature Algorithm (EdDSA) is a digital signature scheme using a variant of Schnorr signature based on twisted Edwards curves. It is designed to be faster than existing digital signature scheme ...
. DSA is covered by , filed July 26, 1991 and now expired, and attributed to David W. Kravitz, a former
NSA The National Security Agency (NSA) is a national-level intelligence agency of the United States Department of Defense, under the authority of the Director of National Intelligence (DNI). The NSA is responsible for global monitoring, collecti ...
employee. This patent was given to "The United States of America as represented by the
Secretary of Commerce The United States secretary of commerce (SecCom) is the head of the United States Department of Commerce. The secretary serves as the principal advisor to the president of the United States on all matters relating to commerce. The secretary rep ...
, Washington, D.C.", and NIST has made this patent available worldwide royalty-free. Claus P. Schnorr claims that his (also now expired) covered DSA; this claim is disputed.


Operation

The DSA algorithm involves four operations: key generation (which creates the key pair), key distribution, signing and signature verification.


1. Key generation

Key generation has two phases. The first phase is a choice of ''algorithm parameters'' which may be shared between different users of the system, while the second phase computes a single key pair for one user.


Parameter generation

* Choose an approved
cryptographic hash function A cryptographic hash function (CHF) is a hash algorithm (a map of an arbitrary binary string to a binary string with fixed size of n bits) that has special properties desirable for cryptography: * the probability of a particular n-bit output re ...
H with output length , H, bits. In the original DSS, H was always
SHA-1 In cryptography, SHA-1 (Secure Hash Algorithm 1) is a cryptographically broken but still widely used hash function which takes an input and produces a 160-bit (20-byte) hash value known as a message digest – typically rendered as 40 hexadecima ...
, but the stronger
SHA-2 SHA-2 (Secure Hash Algorithm 2) is a set of cryptographic hash functions designed by the United States National Security Agency (NSA) and first published in 2001. They are built using the Merkle–Damgård construction, from a one-way compression ...
hash functions are approved for use in the current DSS. If , H, is greater than the modulus length N, only the leftmost N bits of the hash output are used. * Choose a key length L. The original DSS constrained L to be a multiple of 64 between 512 and 1024 inclusive. NIST 800-57 recommends lengths of 2048 (or 3072) for keys with security lifetimes extending beyond 2010 (or 2030). * Choose the modulus length N such that N < L and N \leq , H, . FIPS 186-4 specifies L and N to have one of the values: (1024, 160), (2048, 224), (2048, 256), or (3072, 256). * Choose an N-bit prime q. * Choose an L-bit prime p such that p - 1 is a multiple of q. * Choose an integer h randomly from \. * Compute g := h^ \mod p. In the rare case that g=1 try again with a different h. Commonly h=2 is used. This
modular exponentiation Modular exponentiation is exponentiation performed over a modulus. It is useful in computer science, especially in the field of public-key cryptography, where it is used in both Diffie-Hellman Key Exchange and RSA public/private keys. Modul ...
can be computed efficiently even if the values are large. The algorithm parameters are (p, q, g). These may be shared between different users of the system.


Per-user keys

Given a set of parameters, the second phase computes the key pair for a single user: * Choose an integer x randomly from \. * Compute y := g^x \mod p. x is the private key and y is the public key.


2. Key distribution

The signer should publish the public key y. That is, they should send the key to the receiver via a reliable, but not necessarily secret, mechanism. The signer should keep the private key x secret.


3. Signing

A message m is signed as follows: * Choose an integer k randomly from \ * Compute r := \left(g^\bmod\,p\right)\bmod\,q. In the unlikely case that r=0, start again with a different random k. * Compute s := \left(k^\left(H(m)+xr\right)\right)\bmod\,q. In the unlikely case that s=0, start again with a different random k. The signature is \left(r,s\right) The calculation of k and r amounts to creating a new per-message key. The modular exponentiation in computing r is the most computationally expensive part of the signing operation, but it may be computed before the message is known. Calculating the modular inverse k^\bmod\,q is the second most expensive part, and it may also be computed before the message is known. It may be computed using the
extended Euclidean algorithm In arithmetic and computer programming, the extended Euclidean algorithm is an extension to the Euclidean algorithm, and computes, in addition to the greatest common divisor (gcd) of integers ''a'' and ''b'', also the coefficients of Bézout's ide ...
or using
Fermat's little theorem Fermat's little theorem states that if ''p'' is a prime number, then for any integer ''a'', the number a^p - a is an integer multiple of ''p''. In the notation of modular arithmetic, this is expressed as : a^p \equiv a \pmod p. For example, if = ...
as k^\bmod\,q.


4. Signature Verification

One can verify that a signature \left(r,s\right) is a valid signature for a message m as follows: * Verify that 0 < r < q and 0 < s < q. * Compute w := s^ \bmod\,q. * Compute u_1 := H(m) \cdot w\, \bmod\,q. * Compute u_2 := r \cdot w\, \bmod\,q. * Compute v := \left(g^y^ \bmod\,p\right) \bmod\,q. * The signature is valid if and only if v = r.


Correctness of the algorithm

The signature scheme is correct in the sense that the verifier will always accept genuine signatures. This can be shown as follows: First, since g=h^~\text~p, it follows that g^q \equiv h^ \equiv 1 \mod p by
Fermat's little theorem Fermat's little theorem states that if ''p'' is a prime number, then for any integer ''a'', the number a^p - a is an integer multiple of ''p''. In the notation of modular arithmetic, this is expressed as : a^p \equiv a \pmod p. For example, if = ...
. Since g>0 and q is prime, g must have order q. The signer computes :s=k^(H(m)+xr)\bmod\,q Thus : \begin k & \equiv H(m)s^+xrs^\\ & \equiv H(m)w + xrw \pmod \end Since g has order q we have : \begin g^k & \equiv g^g^\\ & \equiv g^y^\\ & \equiv g^y^ \pmod \end Finally, the correctness of DSA follows from :\begin r &= (g^k \bmod\,p) \bmod\,q\\ &= (g^y^ \bmod\,p) \bmod\,q\\ &= v \end


Sensitivity

With DSA, the entropy, secrecy, and uniqueness of the random signature value k are critical. It is so critical that violating any one of those three requirements can reveal the entire private key to an attacker. Using the same value twice (even while keeping k secret), using a predictable value, or leaking even a few bits of k in each of several signatures, is enough to reveal the private key x. This issue affects both DSA and Elliptic Curve Digital Signature Algorithm (
ECDSA In cryptography, the Elliptic Curve Digital Signature Algorithm (ECDSA) offers a variant of the Digital Signature Algorithm (DSA) which uses elliptic-curve cryptography. Key and signature-size As with elliptic-curve cryptography in general, the b ...
) – in December 2010, a group calling itself ''fail0verflow'' announced recovery of the
ECDSA In cryptography, the Elliptic Curve Digital Signature Algorithm (ECDSA) offers a variant of the Digital Signature Algorithm (DSA) which uses elliptic-curve cryptography. Key and signature-size As with elliptic-curve cryptography in general, the b ...
private key used by
Sony , commonly stylized as SONY, is a Japanese multinational conglomerate corporation headquartered in Minato, Tokyo, Japan. As a major technology company, it operates as one of the world's largest manufacturers of consumer and professional ...
to sign software for the
PlayStation 3 The PlayStation 3 (PS3) is a home video game console developed by Sony Interactive Entertainment, Sony Computer Entertainment. The successor to the PlayStation 2, it is part of the PlayStation brand of consoles. It was first released on Novemb ...
game console. The attack was made possible because Sony failed to generate a new random k for each signature. This issue can be prevented by deriving k deterministically from the private key and the message hash, as described by . This ensures that k is different for each H(m) and unpredictable for attackers who do not know the private key x. In addition, malicious implementations of DSA and ECDSA can be created where k is chosen in order to subliminally leak information via signatures. For example, an
offline private key A paper key is a machine-readable print of a cryptographic key. The printed key can be used to decrypt data, e.g. archives or backup data. A paper key can be the result of an offline private key protocol. The offline private key can also function ...
could be leaked from a perfect offline device that only released innocent-looking signatures.


Implementations

Below is a list of cryptographic libraries that provide support for DSA: * Botan *
Bouncy Castle Bounce or The Bounce may refer to: * Deflection (physics), the event where an object collides with and bounces against a plane surface Books * Mr. Bounce, a character from the Mr. Men series of children's books Broadcasting, film and TV * ''B ...
*
cryptlib cryptlib is an open-source cross-platform software security toolkit library. It is distributed under the Sleepycat License, a free software license compatible with the GNU General Public License. Alternatively, cryptlib is available under a pr ...
*
Crypto++ Crypto++ (also known as CryptoPP, libcrypto++, and libcryptopp) is a free and open-source C++ class library of cryptographic algorithms and schemes written by Wei Dai. Crypto++ has been widely used in academia, student projects, open-source, and no ...
*
libgcrypt Libgcrypt is a cryptography library developed as a separated module of GnuPG. It can also be used independently of GnuPG, but depends on its error-reporting library Libgpg-error. It provides functions for all fundamental cryptographic building blo ...
*
Nettle {{redirect, Nettle Nettle refers to plants with stinging hairs, particularly those of the genus ''Urtica''. It can also refer to plants which resemble ''Urtica'' species in appearance but do not have stinging hairs. Plants called "nettle" include ...
*
OpenSSL OpenSSL is a software library for applications that provide secure communications over computer networks against eavesdropping or need to identify the party at the other end. It is widely used by Internet servers, including the majority of HTT ...
*
wolfCrypt wolfSSL is a small, portable, embedded SSL/TLS library targeted for use by embedded systems developers. It is an open source implementation of TLS (SSL 3.0, TLS 1.0, 1.1, 1.2, 1.3, and DTLS 1.0, 1.2, and 1.3) written in the C programming langu ...
*
GnuTLS GnuTLS (, the GNU Transport Layer Security Library) is a free software implementation of the TLS, SSL and DTLS protocols. It offers an application programming interface (API) for applications to enable secure communication over the network trans ...


See also

*
Modular arithmetic In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book ...
*
RSA (cryptosystem) RSA (Rivest–Shamir–Adleman) is a public-key cryptography, public-key cryptosystem that is widely used for secure data transmission. It is also one of the oldest. The acronym "RSA" comes from the surnames of Ron Rivest, Adi Shamir and Leona ...
*
ECDSA In cryptography, the Elliptic Curve Digital Signature Algorithm (ECDSA) offers a variant of the Digital Signature Algorithm (DSA) which uses elliptic-curve cryptography. Key and signature-size As with elliptic-curve cryptography in general, the b ...


References


External links


FIPS PUB 186-4: Digital Signature Standard (DSS)
the fourth (and current) revision of the official DSA specification.
Recommendation for Key Management -- Part 1: general
NIST Special Publication 800-57, p. 62–63 {{Cryptography navbox , public-key Public-key cryptography Digital signature schemes Digital Signature Standard 1991 introductions