Join our Newsletter — 33% off our NHI Course
Home› Guides› Digital Signatures Guide: How Signing Works and Where…
Guide Data Security

Digital Signatures Guide: How Signing Works and Where It Protects You

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 26 October 2026 12 min read
On this page

A digital signature is a value computed with a private key over a piece of data, which anyone holding the matching public key can check to prove who signed the data and that it has not changed since. It is the electronic equivalent of a tamper-evident seal plus a signature, and it underpins software updates, TLS certificates, access tokens and signed documents. Signatures give integrity, origin authentication and, in the right legal setting, non-repudiation; they do not give confidentiality. This guide explains how signing works in plain terms, then covers the algorithms in current NIST standards, the main places signatures are used, and the mistakes that let attackers forge or abuse them. It is written for engineers, identity teams and security architects, and links to deeper guides on code signing, JWTs and PKI rather than repeating them.

Key takeaways

  • Hash, then sign. The signer hashes the data and applies the private key to the digest; the verifier recomputes the hash and checks it with the public key.
  • Use modern schemes. RSA-PSS, ECDSA and EdDSA are in FIPS 186-5; ML-DSA (FIPS 204) and SLH-DSA (FIPS 205) are the post-quantum replacements.
  • A valid signature is not the same as a trusted one. Verifiers must also check which key, which issuer and which algorithm, as the Storm-0558 forgeries showed.
  • The signing key is a high-value non-human identity. Whoever holds it can impersonate your software, your token issuer or your organisation; keep it in an HSM or managed signing service.
  • Plan for revocation before you need it. Leaked keys baked into firmware or trusted for driver signing can stay usable for years.

What it is

Think of a wax seal that only you can make, but that anyone can recognise. The private key makes the seal; the public key lets others recognise it. If one bit of the sealed data changes, the check fails.

A digital signature provides three properties:

  • Integrity: the data has not been modified since it was signed.
  • Origin authentication: it was signed by the holder of a specific private key.
  • Non-repudiation: the signer cannot easily deny signing, provided the key was under their sole control. This is a legal and procedural property as much as a technical one.

Signatures differ from message authentication codes (MACs) such as HMAC. A MAC uses one shared secret key, so any party able to verify can also create a valid tag, and it cannot prove which party produced it. The difference matters in JWTs, where HS256 is a MAC and RS256, PS256, ES256 and EdDSA are signatures. For the shared-key versus key-pair distinction in general, see the Symmetric vs Asymmetric Encryption Guide.

How it works

  1. Key generation: the signer creates a key pair, ideally inside an HSM or KMS so the private key never exists in plaintext outside it.
  2. Binding the public key to a name: a certificate authority issues an X.509 certificate, or the key is published in a JWK Set, or pinned in a trust store. See the PKI Basics Guide.
  3. Hashing: the data is reduced to a fixed-length digest with a hash such as SHA-256 or SHA-384. Signing the digest is efficient and means the hash's collision resistance becomes part of the signature's security. See the Hashing Guide.
  4. Signing: the private key is applied to the digest with the chosen scheme, producing the signature, which is attached to or stored alongside the data.
  5. Verification: the verifier recomputes the digest, checks the signature with the public key, and then checks trust: is this key allowed to sign this kind of object, for this issuer, at this time, and has it been revoked?

Step 5 is where most real-world failures happen. The cryptographic check is usually correct; the trust decision around it is not.

Signature algorithms compared

SchemeStandardKey and signature sizeNotes
RSA-PSSFIPS 186-5; RFC 8017 (RSASSA-PSS)2048 to 4096-bit keys; signature equals modulus sizeRFC 8017 says PSS is required in new applications; PKCS#1 v1.5 signatures kept for compatibility
RSA PKCS#1 v1.5RFC 8017; FIPS 186-5As aboveStill widely used (JWT RS256, many certificates); acceptable but legacy
ECDSAFIPS 186-5P-256: 64-byte raw signatureNeeds a unique secret nonce per signature; a repeated or biased nonce reveals the private key
EdDSA (Ed25519, Ed448)FIPS 186-5; RFC 8032Ed25519: 32-byte keys, 64-byte signaturesDeterministic, so no per-signature random number; fast and resistant to side channels
ML-DSA (44, 65, 87)FIPS 204 (August 2024)Kilobyte-scale public keys and signaturesLattice-based general-purpose post-quantum signature
SLH-DSAFIPS 205 (August 2024)Small keys, large signatures (several to tens of kilobytes)Stateless hash-based; conservative security assumptions, slower

FIPS 186-5 (February 2023) superseded FIPS 186-4 and no longer approves DSA for generating new signatures. NIST SP 800-131A Rev. 2 disallows RSA signature generation below 2048 bits, elliptic curve keys below 224 bits, and SHA-1 for signature generation. The NIST IR 8547 initial public draft (November 2024) proposes deprecating 112-bit RSA and ECDSA after 2030 and disallowing quantum-vulnerable signatures after 2035; it is still a draft. Migration planning is covered in the Post-Quantum Cryptography Migration Guide.

Why it matters

Signatures are where trust in machines and software is decided, usually without a human in the loop.

UseWhat is signedWhat the verifier must also check
Code and firmware signingExecutables, drivers, packages, container images, firmwarePublisher identity, certificate validity and revocation, timestamp, policy on which publishers may run
TLS and PKICertificates (by the CA), handshake transcript (by the server)Chain to a trusted root, name match, expiry, revocation, Certificate Transparency where required
JWT and OAuth tokensHeader and claims (JWS)Pinned algorithm, issuer to key binding, audience, expiry, token type
SAML assertionsXML assertionSigning certificate matches federation metadata; whole assertion covered
Documents and contractsPDF or XML document (PAdES, XAdES formats)Signer certificate, long-term validation data, legal status of the signature type
Git commits and releasesCommits, tags, release artefactsSigner key is the expected maintainer; key not revoked
  • JWT signatures: RFC 7515 defines the signing input as the base64url header and payload joined by a full stop, so both are protected. RFC 7518 registers none, meaning no signature at all. RFC 8725 (JWT Best Current Practices) requires libraries to let the caller fix an allow-list of algorithms and bind each key to one algorithm, which defeats both alg: none acceptance and the RS256 to HS256 confusion where an RSA public key is misused as an HMAC secret. Never take the algorithm from the token itself. See the JWT Security Guide.
  • Code signing: a signature proves which key signed a binary, not that the binary is safe. Timestamping lets a signature stay valid after the certificate expires, which is useful and also why stolen expired certificates remain dangerous. See the Code Signing Security Guide.
  • Keyless signing: projects such as Sigstore issue short-lived signing certificates tied to an OIDC identity and record signatures in a public transparency log, which removes the long-lived key from developer machines.
  • Legal signatures in the EU: eIDAS (Regulation (EU) No 910/2014, amended by Regulation (EU) 2024/1183) defines an advanced electronic signature as one uniquely linked to and capable of identifying the signer, created with data under the signer's sole control and linked to the data so that changes are detectable (Article 26). A qualified electronic signature is an advanced signature created by a qualified signature creation device and based on a qualified certificate; under Article 25(2) it "shall have the equivalent legal effect of a handwritten signature".

Where identity fits: signing keys are non-human identities

A signing key is a credential that speaks for an organisation with no human involved at verification time. Treat it like the most privileged service account you have.

  • Custody: generate signing keys in an HSM or cloud KMS as non-exportable, and expose signing only through a service with authentication, approval for release keys, and per-request logging. ATT&CK tracks theft of key files as T1552.004 Private Keys.
  • Ownership and offboarding: every signing key needs a named owner, a defined lifetime and a rotation process triggered when people leave. In the Coupang breach, a former engineer kept a token signing key with a reported 5 to 10 year validity and used it to forge tokens after leaving.
  • Scope: one key per purpose and per product, so a leak has a bounded blast radius.

See the Machine Identity, PKI and Certificate Lifecycle Guide and the Cryptographic Key Management Guide.

Common misconceptions

  • "Signed means safe." A signature only identifies the signer. After Lapsus$ leaked two NVIDIA code signing certificates, malware signed with them appeared within about a day, and Windows still accepted the expired certificates for driver signing. Pair signature checks with allow-listing policy such as Windows Defender Application Control (ATT&CK T1553.002 Code Signing).
  • "If the signature verifies, the token is valid." In the Microsoft Storm-0558 key breach, a consumer signing key that should have been retired was used to forge tokens that Exchange Online accepted for enterprise accounts, because issuer and key scope were not validated. ATT&CK covers this as T1606 Forge Web Credentials.
  • "Signing encrypts the data." It does not. A signed JWT or document is readable by anyone; encrypt separately if the content is confidential.
  • "A leaked key can just be revoked." Revocation depends on verifiers checking it. In the MSI signing keys leak, firmware signing keys for 57 products and Intel Boot Guard keys for 116 products were exposed, and keys built into hardware trust chains are hard to replace on devices already in the field.
  • "ECDSA and EdDSA are interchangeable." ECDSA depends on a fresh, unbiased random nonce for every signature; EdDSA derives it deterministically. Weak randomness in ECDSA signing can leak the private key.
  • "Any electronic signature is legally equal to a handwritten one." Under eIDAS, only qualified electronic signatures carry that equivalence automatically; others cannot be denied effect solely for being electronic, but their weight is assessed case by case.
  • Hash functions and MACs: the digest a signature covers, and the shared-key alternative. See the Hashing Guide.
  • Certificates and PKI: how a public key is bound to a name and revoked. See the PKI Basics Guide and the Certificate Transparency Guide.
  • Timestamping: a trusted time authority countersigns a signature so it can be validated after the signing certificate expires.
  • Crypto-agility: the ability to swap signature algorithms, which post-quantum migration will test. See the Crypto-Agility Guide.

Rolling out signing controls

  1. Inventory signing keys: code signing certificates, token issuers, SAML signing certificates, GPG and SSH signing keys, firmware keys; record owner, algorithm, location and expiry.
  2. Move keys into hardware: migrate to HSM or KMS backed signing; for code signing, sign in the build pipeline through a signing service, never on laptops.
  3. Fix verifiers: pin algorithms, validate issuer to key binding and audience for tokens, and enforce revocation checks. Test in a staging tenant with deliberately bad tokens (alg: none, wrong issuer key) before production.
  4. Rotate: introduce a new key alongside the old one (publish both in the JWK Set or trust store), switch signing, then retire the old key once no valid artefacts depend on it. Rollback means re-enabling the old key for verification only.
  5. Monitor: log every signing operation and verification failure.

Detection and measurement

  • Signals: signing requests outside the release pipeline or business hours, unusual signing volume, tokens with no matching login event, verification failures spiking after a change, and new keys appearing in JWK Sets.
  • Metrics: percentage of signing keys in HSM or KMS; percentage with a named owner and expiry; mean time to rotate a signing key on demand; number of verifiers without an algorithm allow-list; count of RSA keys below 2048 bits or SHA-1 signatures still issued.

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-53 Rev. 5SI-7, SI-7(15)Software, firmware and information integrity; code authentication by signature
NIST SP 800-53 Rev. 5SC-12, SC-13Key management and approved cryptography for signing keys
NIST CSF 2.0PR.DS-01, PR.DS-02Integrity of data at rest and in transit
ISO/IEC 27001:2022Annex A 8.24Use of cryptography and key management
MITRE ATT&CKT1553.002, T1588.003, T1649, T1606Code signing abuse, obtaining code signing certificates, forging certificates and web credentials

Practitioner checklist

  • Keep an inventory of every signing key and certificate with owner, purpose, algorithm, location and expiry.
  • Generate and hold signing keys as non-exportable in an HSM or KMS; sign through a controlled service with approvals for release keys.
  • Use RSA-PSS (3072 bits or more for new keys), ECDSA P-256 or Ed25519 today; plan ML-DSA or SLH-DSA for long-lived trust anchors.
  • Pin accepted algorithms in every verifier, reject alg: none, and bind each key to one algorithm and one issuer.
  • Timestamp code signatures and enforce revocation checking; pair signature checks with allow-listing policy.
  • Rotate signing keys on a schedule and when anyone with access leaves.
  • Log every signing operation and alert on signing outside approved pipelines.
  • Test verifiers with malformed and forged signatures as part of release testing.

Standards and references

Related NHI Mgmt Group resources: Code Signing Security Guide · JWT Security Guide · PKI Basics Guide · Symmetric vs Asymmetric Encryption Guide · Storm-0558 and Cloud Key Theft Profile

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 26 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.