Digital Signature Scheme

Research
Introduced by
Ronald Rivest, Adi Shamir, Leonard Adleman
Year
1978
Type
Asymmetric signature algorithm
Family
Message authentication and integrity

What does it do?

A digital signature scheme provides authentication, integrity assurance, and non-repudiation of electronically signed documents.

Using public-key cryptography (such as RSA, DSA, or ECDSA), the originator signs a message with a private key in a way that any recipient can verify the signature using the originator's public key, proving that the message was created by the claimed author and has not been tampered with.

The intuition behind the method

A digital signature binds a signer's private key to a specific document in a form that anyone holding the matching public key can check. The signer computes a hash of the message and applies the private key to that hash through a signature algorithm such as RSA-PSS or ECDSA. A verifier who holds the signer's public key recomputes the hash of the received message and checks the signature against it. If the check succeeds, the signature shows that the private key holder produced it for this exact hash, which gives authenticity, and any change to the message changes the hash, which gives integrity. Verification is a yes-or-no test, but its soundness depends on the private key remaining secret and on a correct implementation.

History

The RSA method, published by Rivest, Shamir, and Adleman in 1978, is the cited basis for public-key signatures: the cited abstract describes signing with a privately held decryption key that anyone can verify with the corresponding public key. The Elliptic Curve Digital Signature Algorithm is described in the cited 2001 article by Johnson, Menezes, and Vanstone.

When to use it

Choose digital signatures when a recipient or third party must check who produced a message and that it was not altered, and the check must be possible without sharing a secret, for example for contracts, software distribution, or signed documents verified by outsiders. For RSA signatures, use a padding scheme designed for signatures, preferably a probabilistic one, rather than older deterministic padding. ECDSA is an option where smaller keys are a priority. Do not rely on a signature for confidentiality, since it does not hide the message; encrypt separately if content must be secret. If the two parties already share a secret and only need to detect tampering between themselves, a keyed MAC such as HMAC is simpler and faster. Signatures also require a way to bind the public key to the signer, usually a certificate authority or other public key infrastructure, so they are a poor fit where no such infrastructure exists or can be built.

Limitations and considerations

  • Does not encrypt the message: the content is sent in clear alongside the signature, so a signature gives authenticity and integrity but no confidentiality.
  • Verification requires an authentic copy of the signer's public key; if an attacker can substitute the key, a signature that verifies proves nothing about the real signer.
  • Compromise of the private key allows forgery in the signer's name. Signatures made with that key after the compromise cannot be trusted, and signatures made earlier can only be assessed using revocation records and timestamp evidence.
  • Signing and verification are slower than computing a symmetric MAC such as HMAC, which matters for high-volume message streams.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Provides authentication: verifies the message originated from the claimed signer
  • Ensures integrity: detects any tampering with the signed message
  • Non-repudiation: the signer cannot deny having signed the message (in legal contexts)
  • Verifiable by any party: no shared secret needed; verification uses only public information

Applications

  • X.509 certificates: Authenticating public keys in web browsers and PKI systems
  • Email security: PGP/GPG digital signatures on electronic mail and message signing
  • Code signing: Software publishers sign executables to assure users of authenticity

How it works

How it works

1

Compute a cryptographic hash of the message with SHA-256 or another secure hash function. The result is a fixed-size digest whatever the message length, so the signing operation works on a short value rather than the full document.

2

Apply the signer's private key to the hash using a signature algorithm such as RSA-PSS or ECDSA. For RSA, the key pair is derived from two large secret primes p and q: the public modulus is n = pq, and the exponents e and d satisfy e·d ≡ 1 (mod (p−1)(q−1)). The raw RSA signing operation raises the hash, represented as an integer M, to the private exponent d modulo n. Deployed RSA signatures wrap the hash in a signature padding scheme before this operation, so the bare form is shown here only to fix the mathematics. The output depends on both the private key and the hash. ECDSA also draws a random value for each signature, so two signatures over the same hash generally differ.

3

Send the original message, the signature, and the signer's public key certificate, or a reference to it, to the recipient. This step does not encrypt the message, so anyone on the channel can read its content.

4

The recipient uses the signer's public key to check the signature against a fresh hash of the received message. For RSA, the recipient computes s^e mod n and accepts the signature only if the result equals the hash of the received message. The recipient should also confirm that the certificate is valid and chains to a trusted authority, because a valid signature from an untrusted key proves little.

Common pitfalls

  • Using deterministic or outdated padding for RSA signatures instead of a padding scheme designed for signatures.
  • Signing the raw message instead of its hash. Signature algorithms in common use operate on fixed-size values, so the standard practice is to hash first and sign the digest.
  • Accepting a signature without checking the certificate's validity period, its revocation status, and its chain to a trusted authority.
  • Reusing or repeating the random per-signature value in ECDSA. A repeated value can reveal the private key, so the value must be fresh for each signature.
  • Using one key pair for both signing and encryption. Separate key pairs for each purpose limit the damage from misuse or compromise of one function.

Frequently asked questions

Why not encrypt a document to ensure authenticity instead of using a signature?

Encryption hides content from everyone except the holder of the decryption key, so it provides confidentiality. A signature shows who created a message and that it has not changed, but leaves the content readable. When both are needed, the two operations are combined, and the order matters, so use a vetted protocol such as TLS rather than composing signing and encryption yourself.

Can I sign a document without hashing it first?

A signature algorithm can technically be applied to raw data, but it is not done in practice. Hashing gives a fixed-size value that the algorithm can process efficiently regardless of document length. Signing raw data without a secure padding scheme is unsafe for RSA, so the document should be hashed with a cryptographically secure hash function and the digest signed within a padded signature scheme.

What happens if my private key used for signing is stolen?

All signatures created with that key become untrustworthy, as an attacker can forge signatures in your name. This is why key revocation is critical: the signer must publish a revocation certificate that invalidates all signatures created with the compromised key going forward. Timestamps and certificate validity periods provide some protection to signatures created before revocation.

What is the difference between a digital signature and a hash?

A hash is one-way and deterministic but provides no authentication. A digital signature is computed from the hash of the message using the private key, and it is verified with the matching public key. Anyone holding that public key can confirm both that the signature was produced with the matching private key and that the message has not changed. A hash alone cannot prove who created it.

Related methods

Sources

  1. Rivest, R. L., Shamir, A., & Adleman, L. (1978). A method for obtaining digital signatures and public-key cryptosystems. Communications of the ACM, 21(2), 120–126.

    Open DOI reference
  2. Krawczyk, H., Bellare, M., & Herbst, R. (1997). HMAC: Keyed-hashing for message authentication. RFC 2104.

    Open publication reference
  3. Johnson, D., Menezes, A., & Vanstone, S. (2001). The elliptic curve digital signature algorithm (ECDSA). International Journal of Information Security, 1(1), 36–63.

    Open DOI reference