Digital Signatures

Work in progress. This note is still being written and incomplete.

A digital signature scheme is a triple of algorithms over a key pair (PK,SK)(PK, SK), where SKSK is the private signing key held only by the signer and PKPK is the public verification key.

  • Key generation
    Produces (PK,SK)(PK, SK). PKPK is published, often in a certificate; SKSK is kept secret.
  • Sign(SK,m)\text{Sign}(SK, m)
    Outputs a signature ss computed from the message mm and SKSK. In practice H(m)H(m) (a hash function HH) is used instead of mm. The digest is fixed size, so signing cost stays constant for any length, and it avoids mathematical structure exploits that come from signing large raw data blocks directly.
  • Verify(PK,m,s)\text{Verify}(PK, m, s)
    Deterministic check that returns accept only if ss matches mm under PKPK.

The signature is a mathematical function of both mm and SKSK. Changing either input changes the valid signature.

Properties

  • Authentication
    A valid ss proves the message came from the holder of SKSK.
  • Integrity
    Any change to mm after signing makes Verify\text{Verify} reject.
  • Non-repudiation
    ss is bound uniquely to SKSK, which is known only to the signer, so no one else could have produced it. The signer cannot later deny signing mm.

Forgery

The signing oracle is the honest signer seen as a black box: they submit a chosen message mim_i and receive si=Sign(SK,mi)s_i = \text{Sign}(SK, m_i), without learning SKSK.

An adaptive chosen-message attack lets them query the oracle on messages of their choice, each query picked after seeing earlier answers.

  • Existential forgery
    They output one valid pair (m,s)(m', s') where mm' was never queried to the oracle. The message need not be meaningful.
  • Selective forgery
    They forge a signature on a target message fixed in advance.
  • Universal forgery
    They can sign any message, equivalent to recovering SKSK.

A scheme is secure when existential forgery under an adaptive chosen-message attack is infeasible.

RSA Digital Signature

Uses the same key pair as RSA encryption, with the roles of ee and dd reversed. Here nn is the RSA modulus, dd the private exponent, ee the public exponent, and HH a hash function.

The two modes differ in whether the message is put through RSA directly or only its hash is, and in what gets transmitted.

  • With message recovery
    The message itself is signed: σ=mdmodn\sigma = m^d \bmod n. Only σ\sigma is sent, and mm is recovered during verification. Requires m<nm < n, so it fits only short messages.
  • Without message recovery
    Only the digest is signed: σ=H(M)dmodn\sigma = H(M)^d \bmod n. The pair (M,σ)(M, \sigma) is sent, so MM travels in the clear. Works for any message length. This is the form used in practice.

Verification

  • With recovery
    Compute m=σemodnm' = \sigma^e \bmod n using the signer’s public key, and check it matches the expected message.
  • Without recovery
    Compute h=H(M)h' = H(M') and h=σemodnh = \sigma^e \bmod n, accept iff h=hh = h'.

Signing cost is a hash plus a single exponentiation with a full-length exponent dd. Verification cost is a hash plus a single exponentiation with the small exponent ee, plus a comparison.

Paper vs Digital

  • Paper signature
    A static mark tied to the physical medium. The same mark is used regardless of the document text, so it does not depend on the content.
  • Paper verification
    Subjective visual comparison against a reference, or forensic handwriting analysis by an expert.
  • Digital signature
    A value derived from the message content and SKSK, so it differs for every message.
  • Digital verification
    Deterministic checking of Verify(PK,m,s)\text{Verify}(PK, m, s), with trust in PKPK established through a Public Key Infrastructure and its certificate trust chains.
Written by September 16, 2026 3 min read
Was this helpful?