Digital Signature Algorithm (DSA) (original) (raw)

Last Updated : 23 Jul, 2025

The Digital Signature Algorithm (DSA) is a Federal Information Processing Standard that governs digital signatures. It is used to ensure the validity and integrity of a messages, software, or digital document. The National Institute of Standards and Technology (NIST) suggested DSA in August 1991 for use in the Digital Signature Standard (DSS). In this article, we will discuss about Digital Signature and Digital Signature Algorithm.

**What is Digital Signature?

Digital Signature is a verification method.It does not provide confidential communication. If you want to achieve confidentiality, both the message and the signature must be encrypted using either a secret key or a public key cryptosystem. This additional layer of security can be incorporated into a basic digital signature scheme.

Suppose we have:

In Public Key cryptography (also known as Asymmetric cryptography), the communication process is as follows:

Now, suppose when Alice sends a message to Bob, then Bob will check if the sender is authentic; to ensure that it was Alice who sent the message, not Eve. For this, Bob can ask Alice to sign the message electronically. So we can say that an electronic signature can prove that Alice is authentic and is the one sending the message. We called this type of signature a **digital signature.

Model of Digital Signature Process

Model of Digital Signature Process

Method of Digital Signature

These two are standard Approaches to implement the Digital Signature:

Rivest-Shamir-Adleman (RSA)

In the Rivest-Shamir-Adleman approach, the message that needs to be signed is first fed into a hash function that generates a secure hash code of fixed length. The sender private key is then used to encrypt the hash code which makes it signature. The next step involves sending both the signature and the message to the intended receiver. For validation purposes, after receiving the message, the recipient first computes its hash-code. The sender public key is applied by recipient to decrypt this already encrypted signature. In case if decrypted signature corresponds to recipient-produced hashcode, that means that signature would be considered as valid. Since only the sender has access to the private key, only they could have produced a valid signature.

You can refer the below diagram for RSA, here,

RSA approach

RSA approach

Digital Signature Algorithm (DSA)

The DSA (Digital Signature Algorithm) approach involves using of a hash function to create a hash code, same as RSA. This hash code is combined with a randomly generated number k as an input to a signature function. The signature function depends on the sender private key (PRa) as well as a set of parameters that are known to a group of communicating principals. This set can be considered as a global public key (PUG). The output of the signature function is a signature with two components, s and r. When an incoming message is received, a hash code is generated for the message. This hash code is then combined with the signature and input into a verification function. The verification function depends on the global public key as well as the sender's public key (PUa) which is paired with the sender's private key. The output of the verification function returns a value equal to the signature's component r, if the signature is valid. The signature function is designed in such a way that only the sender, with knowledge of the private key, can produce a valid signature.

You can refer below diagram for DSA, where,

DSA Approach

DSA Approach

**Primary Termologies

Steps to Perform DSA

The Digital Signature Algorithm (DSA) is a public-key technique (i.e., assymetric cryptography) and it is used to provide only the digital signature function, and it cannot be used for encryption or key exchange.

1. Global Public-Key Components

There are three parameters that are public and can be shared to a set of users.

If a user has these numbers, then it can selects a private key and generates a public key.

**2. User Private Key

The private key x should be chosen randomly or pseudorandomly and it must be a number from 1 to (q - 1), so x is random or pseudorandom integer with 0 < x < q.

**3. User Public Key

The public key is computed from the private key as y = gx mod p. The computation of y given x is simple. But, given the public key y, it is believed to be computationally infeasible to choose x, which is the discrete logarithm of y to the base g, mod p.

**4. Signing

If a user want to develop a signature, a user needs to calculates two quantities, r and s, that are functions of the public key components (p, q, g), the hash code of the message H(M, the user’s private key (x), and an integer k that must be generated randomly or pseudorandomly and be unique for each signing. k is generated randomly or pseudorandomly integer such that 0<k < q.

Signing

Signing

**5. Verification

Let M, r′, and s′ be the received versions of M, r, and s, respectively.

Verification is performed using the formulas shown in below:

The receiver needs to generate a quantity v that is a function of the public key components, the sender’s public key, and the hash code of the message. If this value matches the r value of the signature, then the signature is considered as valid.

TEST: v = r′

Verification

Verification

Now, at the end it will test on the value r, and it does not depend on the message or plaintext as, r is the function of k and the three global public-key components as mentioned above. The multiplicative inverse of k (mod q) when passed to the function that also has as inputs the message hash code and the user’s private key. The structure of this function is such that the receiver can recover r using the incoming message and signature, the public key of the user, and the global public key.

It is given that there is difficulty in taking discrete logarithms, it is not feasible for an attacker to recover k from r or to recover x from s. The only computationally demanding task in signature generation is the exponential calculation gk mod p. Because this value does not depend on the message to be signed, it can be computed ahead of time. Indeed, a user could precalculate a number of values of r to be used to sign documents as needed. The only other somewhat demanding task is the determination of a multiplicative inverse, k-1 .

Services Provided By DSA

Advantages of DSA

Disadvantages of DSA

Conclusion

The Digital Signature Algorithm (DSA) is a reliable and standardised mechanism for digital signatures that ensures message authenticity, integrity, and non-repudiation. While DSA provides various benefits such as increased security, global adoption, and cost savings, it also has drawbacks such as key management complexity and reliance on infrastructure. Understanding and overcoming these constraints is critical for effectively using DSA to secure digital communications.