Skip to content

Signature

A signature is a cryptographic proof that the holder of a specific key approved a specific piece of data, verifiable by anyone with the matching public key.

Definition

What it is

A digital signature is the cryptographic equivalent of a handwritten signature: it binds a specific identity (represented by a key pair) to a specific piece of data, in a way that any third party can verify without trusting the verifier. The signer holds a private key, and produces a signature over the data. Anyone who has the corresponding public key can verify that the signature was created by the private key over exactly that data, and nothing else. If a single bit of the data changes, the signature fails. If the signature is replayed against different data, it fails. The binding is total.

A signature is not encryption. Encryption hides data; signatures authenticate it. A signature does not conceal the message; it proves who produced it. The two operations are built from the same underlying primitives (public-key cryptography) but they solve different problems, and mixing them up is a common and dangerous mistake. Signing a message does not encrypt it; encrypting a message does not sign it. Every protocol that needs both (TLS, S/MIME, PGP) applies them as separate steps.

Why it matters

Every layer of modern infrastructure rests on signatures. TLS certificates sign the ephemeral keys of a handshake, so a browser can trust an unfamiliar server. Git commits are signed so a reviewer can verify who actually authored a change. Container images are signed so a Kubernetes admission controller can reject anything unsigned. Software packages are signed so an installer can reject a tampered binary. Email is signed (DKIM) so a receiving server can reject spoofed senders. The signature is the moment at which "I received this data" becomes "I received this data from the entity I expect, and it has not been altered."

The cost of skipping signatures is paid in incidents. A tampered package on a CDN, a forged commit in a repo, an unsigned container that slipped past a policy check: each of these is a failure that a signature would have caught cheaply. Adding signatures is not just a security improvement; it is a cheap mechanism to turn "trust the channel" into "trust the key".

How it works

The mechanism rests on public-key cryptography. The signer generates a key pair: a private key known only to them, and a public key distributed freely. To sign, the signer computes a hash of the data and signs the hash with the private key. The output is the signature. To verify, anyone computes the hash of the received data, decrypts the signature with the public key, and compares the two. If they match, the signature is valid: the private key was used over exactly this data, with no alteration.

graph LR
  D[Data] --> H[Hash]
  H --> S[Sign with private key]
  S --> SIG[Signature]
  SIG --> V[Verifier]
  V --> H2[Hash of received data]
  V --> U[Decrypt with public key]
  H2 --> C{Match?}
  U --> C
  C -->|yes| OK[Valid]
  C -->|no| FAIL[Invalid]

Different signature algorithms exist. RSA (used since the 1970s) signs with a modular exponentiation. ECDSA (Elliptic Curve DSA) uses elliptic-curve arithmetic and produces shorter signatures for equivalent security. EdDSA (Ed25519) is a modern curve-based scheme with deterministic signatures and fast verification. The choice matters for performance and interoperability, but the model is identical: private key to sign, public key to verify, binding between the two established by mathematics.

Adding signatures to an artifact pipeline

  1. Decide what is signed

    Sign the artifact itself (container manifest, package tarball, release binary), not just its hash. Signing a hash leaves the hash vulnerable to substitution.

  2. Publish the public key out-of-band

    Never distribute the public key over the same channel as the signed data. A verifier who fetches both from the same server is verifying nothing.

  3. Sign at build, verify at deploy

    Signatures belong in the build pipeline (where the artifact is produced) and in the deploy pipeline (where it is admitted). Nothing between build and deploy should be able to introduce an unsigned artifact.

  4. Record the signature as an OCI referrer or an in-toto attestation

    OCI referrers and in-toto attestations attach signatures to artifacts in a portable, standard way. Do not encode them as sidecar files; the artifact should carry its own provenance.

Modern signing practice extends beyond one-shot signatures. Sigstore's Cosign signs OCI artifacts and uploads signatures as referrers, so any compliant registry can store and serve them. in-toto attestations add a provenance layer: not just "who signed this", but "what steps produced this artifact, using which inputs". The combination is what turns a signature from a single proof into a verifiable chain of evidence.

Common failures

A second failure is key compromise. A signature is only as trustworthy as the key that produced it. A leaked private key can sign anything, and every verification will pass. Long-lived keys should be stored in hardware security modules (HSMs) or at least in a dedicated secret manager. Short-lived keys, rotated automatically (as in Sigstore's keyless mode), reduce the blast radius of a leak to hours instead of years.

A third failure is missing verification. A signature that nobody checks provides no security; it only provides the appearance of it. The verify step has to be enforced at the boundary where it matters: the deploy pipeline that admits containers, the installer that runs packages, the admission controller that admits pods, the email gateway that accepts messages. A signature is only as useful as the check that refuses to proceed without it.

Origin

The concept of a digital signature was formalised alongside public-key cryptography. Whitfield Diffie and Martin Hellman described the idea in 1976, and Rivest, Shamir and Adleman (RSA) published the first practical signing scheme in 1978. The first widely used standard was RSA in PKCS#1. NIST formalised the Digital Signature Standard (DSS) in FIPS 186 in 1994, updated as FIPS 186-5 in 2023 to include ECDSA and EdDSA alongside RSA. Modern infrastructure relies on signatures in TLS (RFC 8446), Git, package managers, and container signing (Sigstore, Notation).

A signature scheme is secure if an adversary who sees signatures on many messages cannot forge a signature on a new message, even if they have the ability to choose which messages are signed.

— Goldwasser, S., Micali, S. & Rivest, R., *A Digital Signature Scheme Secure Against Adaptive Chosen-Message Attacks*, 1988

Evidence

FAQ

Is a digital signature the same as encryption?

No. Encryption hides data; signatures authenticate it. A signed message is readable by anyone (unless separately encrypted), but any reader can verify who produced it and that it was not modified. A protocol that needs both (TLS, S/MIME) applies signatures and encryption as separate steps.

What is the difference between RSA, ECDSA and EdDSA?

RSA uses modular exponentiation and produces large signatures; ECDSA uses elliptic curves and produces shorter signatures for the same security level; EdDSA (Ed25519) is a modern deterministic scheme with fast verification. All three are approved by FIPS 186-5. RSA remains the most interoperable; Ed25519 is preferred in new systems for speed and simplicity.

Can I sign a hash instead of the data?

Yes, and it is standard practice: most signature schemes operate on a hash of the data, not the data itself. But the hash must be computed over the exact bytes you intend to sign and protected together with the data. Signing a hash that is published separately from the data leaves a substitution window: an attacker who controls the data can substitute an unsigned payload for a signed hash.

What happens if the private key is leaked?

Every signature produced by that key becomes suspect, and any signature the attacker creates with the key will verify. The response is to revoke the key, publish the revocation through the same trust infrastructure that publishes the key (CRL, OCSP, transparency log), and re-sign existing artifacts with a new key. Short-lived keys, rotated automatically, reduce the exposure window from years to hours.

Do I need signatures in my internal pipeline, or only for public distribution?

Both. Public distribution needs signatures to establish trust with external consumers, but internal pipelines also benefit: signatures let you prove that a deployed artifact came from your build system and not from someone who gained access to the cluster. The two use cases use the same primitives; the trust model differs.

Connections

SignatureDigestHashDigestCommitGitArtifactContainer OCIDKIM

● broader ● narrower ● related

Used in the garden

Sources

Etymology

Origin: borrowed

  • signature (noun): from Latin signare, to mark with a sign
  • signum (noun): Latin for "mark" or "token"; the root of sign and signature

Semantic network

SignatureDigestHashDigestCommitGitArtifactContainer OCIDKIM

● broader ● narrower ● related

Used in the garden

Sources