🌐 4. TLS, WireGuard, FIDO2 and Signal
← 3. OpenPGP · Overview · Next: 5. S/MIME →
SSH and OpenPGP use the same building blocks from part 1, but combine them differently, because they solve different problems. Four more protocols you use every day make the differences even clearer. For each: what problem it solves, and which choice in the design follows from that.
1. TLS 1.3: HTTPS
The problem: your browser talks to millions of servers it has never seen before. “Trust on first use” like SSH (part 2, ⑤) does not work: you would have to check a fingerprint for every website.
The solution: certificates. A certificate is the server’s public key plus its domain name, signed by a certificate authority (CA) that your browser or operating system already trusts. This is the real chain for this website:
0 s:CN=tlnd.org ← the server's own key, for tlnd.org
i:C=US, O=Let's Encrypt, CN=YR1 ← signed by Let's Encrypt (intermediate)
1 s:C=US, O=Let's Encrypt, CN=YR1
i:C=US, O=ISRG, CN=Root YR ← signed by a root
2 s:C=US, O=ISRG, CN=Root YR
i:C=US, O=Internet Security Research Group, CN=ISRG Root X1 ← in your trust store
Every arrow is a signature (part 1, §3 and §6). The browser checks each one, up to a root it already has, and checks that the name matches the address bar. Trust is outsourced to a few hundred CAs. To catch a CA that issues false certificates, every certificate must also be published in public Certificate Transparency logs.
The handshake, in one round trip:
browser server
ClientHello + key_share (X25519MLKEM768 public keys) ──▶
◀── ServerHello + key_share
═══ from here on encrypted with handshake keys ═══
◀── Certificate (the chain above)
◀── CertificateVerify (signature over the whole conversation so far)
◀── Finished (MAC over the conversation)
Finished ──────────────────────────────────────────────▶
═════════════ application data (the web page) ═════════════
The browser guesses the key exchange method and sends its key share right away in the first message. That saves a round trip compared to older TLS (and SSH). The signature in CertificateVerify covers the hash of everything so far, including both key shares: the same idea as SSH’s exchange hash $H$ (part 2, ④).
What openssl s_client -connect tlnd.org:443 -brief shows today:
Protocol version: TLSv1.3
Ciphersuite: TLS_AES_128_GCM_SHA256
Peer certificate: CN=tlnd.org
Signature type: rsa_pss_rsae_sha256
Negotiated TLS1.3 group: X25519MLKEM768
X25519MLKEM768: the same post-quantum hybrid as in SSH: X25519 together with ML-KEM-768.rsa_pss_rsae_sha256: this server proves itself with an RSA key, signing with PSS padding (part 1, §3).TLS_AES_128_GCM_SHA256: AES-128 in GCM mode for the data; SHA-256 in HKDF, the key derivation that turns the shared secret into all the keys.
Who is not authenticated? You. The server does not know who you are; that happens later, inside the encrypted connection, with a password or better, with FIDO2 (section 3).
Forward secrecy is mandatory in TLS 1.3: every connection uses a fresh (EC)DH key exchange. Older TLS also allowed “RSA key transport”, in which the browser encrypted the secret with the server’s long-term RSA key, the OpenPGP way (part 3), with the same weakness: steal the key later, decrypt everything recorded.
2. WireGuard: a VPN without negotiation and without signatures
The problem: a VPN between machines you configure yourself. You know all the keys in advance, like authorized_keys in SSH, but on both sides.
The design choices:
- No negotiation. There is exactly one set of algorithms: Curve25519, ChaCha20-Poly1305, BLAKE2s. Nothing to choose, so nothing to downgrade, and no list of old algorithms to keep supporting. If one ever breaks, everybody upgrades to a new version.
- No certificates, no usernames. Each peer has a static key pair. The configuration simply lists which public key may use which IP addresses:
[Interface]
PrivateKey = <this machine's private key>
[Peer]
PublicKey = <the other machine's public key>
AllowedIPs = 10.0.0.2/32
Endpoint = vpn.example.com:51820
- No signatures at all. Proof of identity comes from Diffie–Hellman with the static keys. The handshake (Noise framework, pattern IK) mixes four DH calculations:
| DH between | Proves |
|---|---|
| initiator’s ephemeral × responder’s static | only the real responder can read the first message |
| initiator’s static × responder’s static | both sides own their static keys |
| initiator’s ephemeral × responder’s ephemeral | forward secrecy |
| initiator’s static × responder’s ephemeral | the initiator really owns its static key |
Every result goes into one running hash chain, and all keys are derived from it. You can only complete the calculation if you own the private key belonging to the configured public key; no separate signature is needed. In part 1 terms: DH alone is anonymous, but DH with a key that is already known is authenticated.
- Rekey every two minutes, and a server that does not answer unknown packets at all (it is invisible to port scanners).
- Post-quantum: WireGuard does not include ML-KEM. Its answer is an optional pre-shared key per peer (
PresharedKey = ...), mixed into the hash chain. As long as that symmetric key stays secret, a future quantum computer breaking Curve25519 is not enough.
3. FIDO2, WebAuthn and passkeys: logging in without a secret to steal
The problem: passwords can be guessed, leaked and phished. You type them into a fake website and the attacker logs in with them.
The solution: a separate key pair for every website, kept in an authenticator (a YubiKey, your phone, your laptop’s secure chip).
Registering at example.com: the authenticator creates a new key pair (usually ECDSA on P-256, sometimes Ed25519) and gives the website only the public key.
Logging in:
- The website sends a random challenge.
- The browser adds the origin, the domain you are actually on, and gives both to the authenticator.
- After you touch it (and maybe a PIN or fingerprint), the authenticator signs:
- The website checks the signature with the stored public key.
Why this cannot be phished: the browser, not you, fills in the origin. On examp1e.com the authenticator does not even find a key for that site, and a signature made there says examp1e.com inside, which the real site rejects. There is no secret that you could type into the wrong place.
Passkeys are the same thing, with the private key synchronised between your devices (via your Apple, Google or password manager account) instead of locked in one hardware key.
The link with SSH: an sk-ssh-ed25519 key (YubiKey for SSH) is a FIDO2 credential with the “website” set to ssh:. The signature from part 2, ⑦ is made inside the YubiKey, and only after a touch.
4. Signal: new keys with every message
The problem: a chat lasts for years, on phones that get lost, stolen or hacked. Suppose an attacker copies your phone’s keys today. What can they read?
- Forward secrecy: nothing from the past.
- Post-compromise security: and soon, nothing from the future either.
Getting started while the other person is offline (like OpenPGP): Bob uploads a bundle of public keys to the server in advance: a long-term identity key, a signed medium-term key and a pile of one-time keys. Alice combines several Diffie–Hellman calculations with those keys (X3DH), and since 2023 also an ML-KEM encapsulation (PQXDH), for a post-quantum start.
The double ratchet then keeps changing the keys:
- Symmetric ratchet: every single message gets its own key, $k_{i+1} = \mathrm{KDF}(k_i)$. A hash only goes one way, so an old key cannot be calculated back from a new one.
- Diffie–Hellman ratchet: every time the conversation changes direction, the sender includes a fresh ephemeral public key, and a new DH result is mixed into the chain. An attacker who stole the old state does not know the new ephemeral secret, so they are locked out again: the conversation heals.
This is the most thorough use of Diffie–Hellman of all: not once per connection (SSH, TLS) or once per two minutes (WireGuard), but continuously. WhatsApp and Google Messages use the same Signal protocol.
Who is who? The “safety number” in Signal is a fingerprint of both identity keys. Comparing it in person is the Signal version of checking an SSH host key or an OpenPGP fingerprint.
5. Side by side
| SSH | OpenPGP | TLS 1.3 | WireGuard | FIDO2 | Signal | |
|---|---|---|---|---|---|---|
| Live connection? | yes | no | yes | yes | yes | no (messages) |
| Key exchange | ECDH / ML-KEM hybrid | ECDH with a throwaway key, or RSA | ECDH / ML-KEM hybrid | 4 × ECDH (Noise IK) | none | X3DH / PQXDH, then ratchet |
| Server / sender proves identity with | host key signature | signature | certificate + signature | static DH key | — | identity key |
| User proves identity with | key signature (or password) | signature | usually not (happens later) | static DH key | per-site signature | identity key |
| Who vouches for keys | you (known_hosts) | you (fingerprint, web of trust) | certificate authorities | you (config file) | the website stores it | you (safety number) |
| Forward secrecy | ✅ | ❌ | ✅ | ✅ (every 2 min) | n/a | ✅ every message |
| Post-quantum (2026) | ✅ default | ❌ | ✅ in browsers | PSK only | ❌ | ✅ start (PQXDH) |
The pattern: Diffie–Hellman for secrecy, signatures (or a known DH key) for identity, a hash to derive keys, and a fast symmetric cipher for the data. What differs is mainly who decides which keys to trust, and whether there is a live connection to do a fresh exchange.
One more, for files: age does the job of OpenPGP encryption (X25519 with a throwaway key, like part 3, §2) with one fixed set of algorithms, without signatures or a web of trust, and with keys that fit on one line.
Sources
- RFC 8446 (TLS 1.3), RFC 5869 (HKDF), RFC 9162 (Certificate Transparency), IETF draft Hybrid ECDHE-MLKEM Key Agreement for TLSv1.3 (X25519MLKEM768).
- J. A. Donenfeld, WireGuard: Next Generation Kernel Network Tunnel, 2017; T. Perrin, The Noise Protocol Framework.
- W3C Web Authentication (WebAuthn), FIDO Alliance CTAP 2.
- Signal specifications: X3DH, PQXDH, Double Ratchet.