09 / 11 · Modern cryptography
Digital signatures
Proof of who wrote a message, and that not one bit of it has changed.
- Proposed
- 1976, Diffie & Hellman
- Standards
- FIPS 186-5, RFC 8032
- Used in
- TLS certificates, updates, SSH
A digital signature is a short value computed from a message and a private key. Anyone holding the matching public key can check it; nobody without the private key can produce one that checks. It proves who signed and that the message hasn’t changed since.
Diffie and Hellman described the idea in 1976, and RSA made it practical a year later. Today signatures sit behind every HTTPS certificate, software update and SSH login, mostly on elliptic curves with Ed25519 and ECDSA.
sign(private key, m) → s
verify(public key, m, s) → ✓ / ✗
01 / 16 · Inside digital signatures
Who wrote this, and was it changed?
Alice sends “Pay Bob 100”. Bob wants proof that it comes from Alice and that nobody edited it on the way. A digital signature gives both, and Alice can’t later deny having signed.
Anyone on the network path can read, edit or replay a message. Encryption hides the content, but it doesn’t prove who wrote it.
How it works
- 1The signer generates a key pair: a private key kept secret and a public key published for everyone.
- 2To sign, the message is first hashed, for example with SHA-256, so a fixed-size digest is signed whatever the message length.
- 3The signing algorithm combines the digest with the private key: hᵈ mod n for RSA, a pair of numbers (r, s) or (R, S) for elliptic-curve schemes.
- 4The verifier hashes the received message, runs the verification algorithm with the public key, and accepts only if the signature matches that exact digest.
Why it holds
- Hard problems
- Forging a signature without the private key means factoring a large n for RSA, or solving the elliptic-curve discrete logarithm for ECDSA and Ed25519. Neither has a known efficient classical algorithm.
- Bound to the hash
- The signature covers the hash, and SHA-256 makes it infeasible to find a second message with the same hash. Change one character and the digest changes, so the old signature no longer verifies.
- Public verification
- Unlike a MAC, verification needs no secret. Anyone, a judge or an auditor included, can check a signature, and the signer can’t claim someone else produced it. That is non-repudiation.
What can go wrong
- Nonces and randomness
- ECDSA collapses if a nonce repeats or is predictable: in 2010, fail0verflow showed that Sony’s PlayStation 3 signed with a fixed nonce, which exposes the private key. Ed25519 derives its nonce from the key and message to remove that risk.
- Stolen keys and quantum computers
- A signature only proves possession of a key: a stolen private key means a stolen identity, which is why certificates can be revoked. Shor’s algorithm would break RSA and elliptic-curve signatures, hence ML-DSA and SLH-DSA, standardized in 2024.