Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
A digital signature uses a private key to produce a value that anyone can verify with the matching public key, proving who created a message and that nobody has altered it since.

What Is a Digital Signature?
A digital signature is a value computed over a message with a private key, which anyone holding the matching public key can verify. A successful verification establishes three things at once: the message has not changed by a single bit, it was produced by the holder of that private key, and the signer cannot credibly deny having produced it. The last property, non-repudiation, is what makes signatures useful in law and in audit, and it is also why protecting the private key matters so much.
Note what a signature is not. It does not hide the message — signed data is readable by anyone — and it says nothing about whether the signer should be trusted, only about who they are.
Signing a 500 MB file directly with RSA would be absurdly slow and, for RSA, impossible beyond the modulus size. Every practical scheme therefore hashes first:
This makes the signature only as strong as the hash function. If an attacker can find two documents with the same digest, a signature on one is a valid signature on the other. The Flame espionage malware, discovered in 2012, exploited exactly that with an MD5 chosen-prefix collision to forge a Microsoft code-signing certificate, and the SHAttered research of 2017 produced two different PDF files sharing a SHA-1 digest.
| Scheme | Signature size | Notes |
|---|---|---|
| RSA-PSS | 256–512 bytes | The correct RSA padding; prefer it over PKCS#1 v1.5 in new designs |
| ECDSA (P-256) | 64 bytes | Widely supported; depends critically on a fresh random nonce |
| Ed25519 | 64 bytes | Deterministic, fast, and the hardest of the three to misuse |
| ML-DSA | 2.4 kB and up | Post-quantum, standardised as FIPS 204 in August 2024 |
The ECDSA caveat is not theoretical. Each signature needs a unique, unpredictable nonce, and reusing one reveals the private key outright. Sony learned this when the PlayStation 3 firmware signing key was recovered in 2010 after a fixed nonce was found in the implementation, and biased nonces in smart cards and wallets have produced the same result several times since. Deterministic nonce generation under RFC 6979, or Ed25519, removes the hazard by construction.
The terms are often conflated and are not the same thing. An electronic signature is any mark indicating intent to sign, including a typed name or a scanned image. A digital signature is the cryptographic mechanism described here. One can implement the other, but a tick box in a web form is an electronic signature with no cryptographic protection at all.
In the UK, section 7 of the Electronic Communications Act 2000 makes electronic signatures admissible in evidence, and the Law Commission confirmed in 2019 that they can satisfy a statutory requirement for a signature in most cases. The eIDAS framework was retained in UK law after Brexit, so the three tiers — simple, advanced, and qualified — still apply, with qualified signatures requiring a certificate from a qualified trust service provider on the UK trust list. Since 1 January 2021 an EU qualified signature no longer carries automatic qualified status in the UK, and the reverse is also true, which matters for cross-border contracts.
The common defects are in the verifying code, not the maths: accepting the none algorithm, trusting the algorithm field supplied by the attacker, verifying the signature but not checking who signed it, ignoring expiry and revocation, or comparing digests with a non-constant-time function. A signature check that returns true for everything is indistinguishable from a working one until somebody tests it, which is a standard item in our web application security services.
An electronic signature is a legal concept covering any indication of intent to sign, including a typed name or a drawn squiggle. A digital signature is a cryptographic technique that mathematically binds a signer’s key to specific content. Digital signatures are one way to implement a legally effective electronic signature, and the only way to prove the content has not changed.
Not against a sound algorithm with a protected key. Forgery in practice means stealing the private key, exploiting a weak hash to create a colliding document, abusing a buggy verifier, or tricking a signer into signing something they did not read. Protect the key in hardware, use SHA-256 or stronger, and test the verification path.
Only as long as the algorithms stay sound and the certificate chain can still be evaluated. Long-term formats such as PAdES-LTA attach timestamps and revocation data at signing time, so verification does not depend on the certificate authority still answering queries a decade later. Without that, an archived signature becomes unverifiable rather than invalid.
Ed25519 where both ends support it: it is fast, compact, and avoids the nonce pitfalls of ECDSA. ECDSA with P-256 where broader compatibility is needed. RSA-PSS where a counterparty or hardware requires RSA. For anything expected to remain valid well into the 2030s, plan for ML-DSA alongside the classical scheme.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.