← Back to section · Tutorials & Labs
What Problem Do Digital Signatures Solve? More Than Proving 'I Wrote This'
From handwritten signatures and seals to the three guarantees of digital signatures — authenticity, integrity, and non-repudiation — plus the key fact that signing runs in the opposite direction to encryption, and where signatures actually work: software updates, contracts, and certificates.
A question: why does an online “I agree” count?
You tap “Agree and sign” on an electronic contract on your phone. How can the other party be sure the tap came from you, and not from someone who hijacked your account? A software update arrives at your computer; why does the system trust that it came from the vendor rather than an attacker’s malware? Encryption cannot answer these questions — it only handles “nobody else can see it”, not “who actually sent this”. The tool for that job is the digital signature.
A one-sentence definition: a digital signature is a piece of data the signer produces from a file using their private key, which anyone can verify using the signer’s public key. Note the direction: encryption uses the public key to encrypt and the private key to decrypt (for secrecy); signing uses the private key to sign and the public key to verify (so that everyone can check, but only one party can sign). The direction is reversed and the purpose entirely different — the single most common beginner confusion.
The analogy: handwritten signatures and seals, and where they fail
The natural analogy is the handwritten signature and the personal seal. Both try to say “I endorse this”. But the physical analogy has three weaknesses — exactly the three things digital signatures fix.
First, they can be forged. Handwriting can be imitated and seals can be carved in copy, and authentication falls back on expert eyeballing. Second, they are detached from the content. A signature sits on the last page of a contract; swap the first page and the signature still “works”. A seal stamped on blank paper is worse. Third, they can be repudiated. Afterwards, a party can claim “that was not my signature”, and the dispute costs a fortune.
Digital signatures close all three holes. A signature is generated from a private key and cannot be forged in the cryptographic sense (provided the key has not leaked). The signature is computed over a hash of the file’s content, so altering a single bit makes verification fail immediately. And verification is a pure mathematical check, not expert opinion: once signed, it is signed — a property called non-repudiation.
But the analogy also misleads in the other direction, and this must be said: a digital signature proves “whoever holds this private key signed”, not “a particular human signed”. Steal the key and the signatures still verify as “valid”. Real systems therefore also need key custody (hardware keys, passphrase protection) and a binding between a public key and an identity — which is the job of certificates.
How signing works: three steps
- Hash: run the whole file through a hash function to get a fixed-length digest. However large the file, what gets signed is only those few dozen bytes.
- Sign: the signer applies the signing operation to the digest with the private key, producing a signature value, published together with the file.
- Verify: anyone with the file, the signature, and the public key re-computes the file’s hash, then checks with the public key whether the signature matches that hash. A match proves the file has not changed by a single character since signing, and that it must have come from the private key’s holder.
Note carefully how step two differs from encryption: the private key is not “decrypting” anything here. It performs an operation only the private key can do and the public key can publicly check. Thinking of it as “stamping with the private key, verifying with a public stamp-checker” is far more accurate than “reverse encryption”.
Walk through one software update
Put the three steps into a concrete scene and they become tangible. One day your phone offers an app update. Before publishing, the vendor hashes the installation package, signs that hash with a private key that exists only on the company’s signing server, and ships the signature alongside the package. When your phone downloads it, it automatically does three things: re-computes the package’s hash against the vendor’s built-in public key; verifies that the attached signature matches; and only if both check out, allows the installation. If anything fails to match — the package was swapped in transit, the signature is forged, even a single byte was altered — the installation is refused with a clear error. All of this happens in the instant after you tap “Update”, requiring no cryptography knowledge from you. It also explains why installer packages from unknown sources are so dangerous: they typically bypass this verification chain, or are signed with the attacker’s own key, and your device has no way to tell “the vendor’s key” from “the attacker’s key” — unless the installation source itself sits inside the system’s chain of trust. However perfect the signature mechanism, it rests on the premise “the public key’s ownership is trustworthy” — which is exactly the problem certificates, the subject of the next article, exist to solve.
Three real jobs signatures do
- Software distribution and updates: operating systems and app stores verify the signature of every package before installing it and refuse anything that fails — a security check that runs dozens of times a day on your phone without ever bothering you.
- Electronic contracts and official documents: contract platforms bind signer identity to document content with signatures, usually together with timestamps, and their legal standing is recognised in many jurisdictions.
- Certificates themselves: a certificate is “an authority’s signature over the statement that this public key belongs to this party”. When you trust a certificate, you are trusting its signature — signatures are the bricks of the internet’s entire chain of trust.
This site’s signature algorithm of focus, ML-DSA (FIPS 204), is the new-generation digital signature standard. Its signatures are much larger than RSA’s (for ML-DSA-65, the public key is 1,952 bytes and the signature 3,309 bytes), which is why signature size is such a hot topic in the post-quantum migration — but the principle is exactly the one in this article: private key signs, public key verifies, bound to the content.
Wrap-up: one sentence to separate signing from encryption
Leave yourself a self-test: if your goal is “only the recipient can read it”, you want encryption; if your goal is “everyone can be sure I sent this and it was not altered”, you want a signature. Real systems usually want both: sign then encrypt, or use a protocol that does both together. Keep the two directions straight and you will never confuse “signing” with “encrypting” again.
Tags: digital signaturesML-DSAnon-repudiationprimer