Skip to content
CryptoVault

Chapter VI

Signatures and trust

Proving who wrote something, and deciding whose public key to believe in the first place.

  1. VI.1Digital signatures
  2. VI.2RSA, ECDSA, Ed25519
  3. VI.3The man in the middle
  4. VI.4Certificates
  5. VI.5The chain of trust
  6. VI.6Certificate Transparency

Digital signatures

Sign with the private key, verify with the public key. Anyone can check, only one party could have signed.

A MAC (chapter III) proves integrity, but whoever holds the shared key could have made it, the receiver included. A signature can only come from the private key, and anyone can check it.

Pay Bob 10 eurosAlice’s private key9d61 b19d …signsignature, 64 bytesaa9a 368e …Alice’s public keyd75a 9801 …verifyPay Bob 10 eurosvalidPay Bob 90 eurosinvalid
Try it: sign, then change one character

Your public key generating…. The private key was generated in this page and cannot be exported.

PitfallA signature is not encryption: the message stays readable. It proves possession of a key, not whose key it is.

RSA, ECDSA, Ed25519

Real schemes sign a hash of the message. ECDSA needs a fresh secret nonce every time; Ed25519 derives it deterministically.

Every scheme signs a hash z of the message. RSA raises the padded hash to d (PSS). ECDSA outputs a pair (r, s), with r taken from the point k·G of a fresh secret nonce k:

s = k−1(z + r·d) mod 19Install update 3.15z = 4, s = 17r = 9Install update 3.16z = 10, s = 12r = 9same r: the same k twicesubtractk = (z1 − z2) / (s1 − s2)= (4 − 10) / (17 − 12) mod 19 = 14thend = (s1·k − z1) / r= (17·14 − 4) / 9 mod 19 = 7On P-256, the same two lines recover the signer’s 256-bit key:414b 915a 30a8 …
d is the private key. Two signatures with one k give two equations in two unknowns, k and d.
PitfallSony reused one k on every PlayStation 3 signature, and lost its key in 2010. Ed25519 and RFC 6979 derive k from the key and the message instead.

The man in the middle

An unauthenticated key exchange can end with a perfectly secret channel to the attacker.

AAliceMMalloryBBoba = 6x = 13b = 15A = 8X = 21B = 19X = 21216 mod 23813​1913​2115 mod 23181877one key, 18another, 7under 18under 7reads
Both sides see a working encrypted channel; it simply leads to Mallory.

The way out is a key Alice trusts beforehand: compared out loud (Signal’s safety numbers), remembered from the first connection (SSH), or vouched for by a certificate.

An exchange is safe only when authenticated: Bob signs his half with a key Alice already trusts. Mallory can swap the half, not forge the signature.

Certificates

A certificate says “this public key belongs to this name”, signed by a certificate authority whose own certificate chains up to a root you trust.

subjectwww.example.comnamesexample.com, www.example.comvalid2026-10-01 to 2026-12-29public keyP-256 5827 da27 …issuerExample Issuing CAsignaturec94e 2445 f2f8 …hashissuer’sprivate keysigns
The issuer signs every field at once, binding these names to this public key for these dates.

Lifetimes keep shrinking so that mistakes expire fast: Let’s Encrypt made 90 days ordinary, and by 2029 the cap falls to 47 days.

A certificate is public: showing one proves nothing. Signing the handshake with its private key proves you are the site.

The chain of trust

A site sends its certificate and its intermediates. Your device checks each signature up to a root it already holds.

Roots keep their keys offline and sign intermediates, which sign sites day to day.

www.example.comleafkey5827 da27 …to 2026-12-29Example Issuing CAintermediatekey1b19 2dad …to 2032-02-29Example Root CArootkey4fce 2dd4 …to 2044-12-31signed by Example Issuing CAsigned by Example Root CAsigned by itselfsent bythe servertrust storeon the device
Try it: break a link

An illustrative chain: your browser visits www.example.com on 2026-10-19.

Leaf, sent by the server

Subject
www.example.com
Issuer
Example Issuing CA
Public key
5827 da27 bf6e …
Valid until
2026-12-29

Intermediate, sent too

Subject
Example Issuing CA
Issuer
Example Root CA
Public key
1b19 2dad 9985 …
Valid until
2032-02-29

Root, in your trust store

Subject
Example Root CA
Issuer
Example Root CA
Public key
4fce 2dd4 87f3 …
Valid until
2044-12-31
  • Passed: www.example.com is one of the leaf's names
  • Passed: www.example.com is valid on 2026-10-19
  • Passed: Example Issuing CA is valid on 2026-10-19
  • Passed: www.example.com is signed by Example Issuing CA
  • Passed: Example Issuing CA is allowed to issue certificates
  • Passed: Example Root CA is in the trust store
  • Passed: Example Issuing CA is signed by that trusted root

AcceptedThe padlock appears and the page loads.

PitfallEvery root in the store can sign for every domain: one careless or compromised CA can impersonate any site.

Certificate Transparency

Every public certificate is written to append-only public logs, so a certificate issued by mistake or by an attacker gets noticed.

In 2011 an intruder at DigiNotar issued at least 531 rogue certificates, one for *.google.com, used against users in Iran. Now a CA must log every certificate in public, append-only logs, and embed their signed receipts, SCTs.

CT logCAbrowserchecks SCTprecertificateSCTcertificate+ SCTthe log: a Merkle treepublished headd57d 5371 …c8ec 61ba …6c7d 3549 …06ed 3905 …shop.examplee935 a790 …www.example.com4398 b166 …mail.example.netf9b2 132f …api.example.orga million entries: 20 hashes
To prove www.example.com is logged, the log hands over the 2 hashes in bold boxes; hashing up from the entry rebuilds the published head.
CT does not stop a rogue certificate. It makes every certificate a browser accepts public, so the domain owner sees it.

In one breath

  1. Digital signatures. Sign with the private key, verify with the public key. Anyone can check, only one party could have signed.
  2. RSA, ECDSA, Ed25519. Real schemes sign a hash of the message. ECDSA needs a fresh secret nonce every time; Ed25519 derives it deterministically.
  3. The man in the middle. An unauthenticated key exchange can end with a perfectly secret channel to the attacker.
  4. Certificates. A certificate says “this public key belongs to this name”, signed by a certificate authority whose own certificate chains up to a root you trust.
  5. The chain of trust. A site sends its certificate and its intermediates. Your device checks each signature up to a root it already holds.
  6. Certificate Transparency. Every public certificate is written to append-only public logs, so a certificate issued by mistake or by an attacker gets noticed.