TLS 1.3
One round trip, then everything encrypted
TLS 1.3 is assembled from the primitives of other stations. Client and server agree a secret with a key exchange — ECDH, today usually in a hybrid with ML-KEM. HKDF derives the keys from that secret, and every key also depends on a hash of everything the two sides have sent so far — the transcript. The server proves who it is with a signature over that transcript and a certificate issued by a trusted CA. Both sides confirm the transcript with an HMAC in the Finished message, and AES-GCM (or ChaCha20-Poly1305) encrypts the traffic.
The client does not wait for the server to say which groups it supports: it sends one key_share per
proposed group right away. That is why the handshake takes a single round trip (1-RTT), and everything after
ServerHello — the server certificate included — is encrypted. In TLS 1.2 the certificate travelled in clear
and a full handshake took two round trips. The toy runs the whole handshake in your browser: client and server
live in the same page, but the messages are in the real byte format
(RFC 9846, which replaced RFC 8446 in July 2026). The same code
reproduces the example handshakes of RFC 8448 byte for byte — they
are this station’s test vectors. The certificate is real X.509, only issued by a toy CA that nothing but this
toy trusts.
A TLS 1.3 handshake, step by step
Your browser (the client) connects to the server bank.example, which runs in this same page. The messages are in the real TLS 1.3 format, the HKDF key schedule derives the keys, AES-128-GCM protects the records, and the server presents an X.509 certificate and signs with ECDSA P-256 — all in WebCrypto. The same code passes the test vectors of RFC 8448.
Checking whether this browser has X25519 and ML-KEM in WebCrypto…
Only ClientHello and ServerHello cross the wire in clear. Whoever records them sees the offered groups, the
public keys and the server name in server_name (only the Encrypted Client Hello extension hides that). They
cannot compute the key: they lack either side’s private key.
Change the offer, replay the request
Older TLS versions fell to downgrade: an attacker in the middle changed the client’s offer so that both sides agreed on something weaker. In Logjam (2015) the attacker swapped the cipher suites for “export-grade” DHE_EXPORT with 512-bit parameters. The TLS 1.2 server signature covered the random values and the DH parameters but not the chosen cipher suite, so the client accepted the weak parameters as ordinary DHE. After a week-long precomputation for a given group, the authors computed an individual discrete logarithm in about a minute — fast enough to forge Finished during the connection.
TLS 1.3 binds the client’s whole offer three times: the handshake keys depend on a hash of ClientHello and
ServerHello, CertificateVerify signs the transcript up to the certificate, and Finished confirms it with an
HMAC. Falling back to an older version hits one more trap: a TLS 1.3 server that has to negotiate TLS 1.2
writes the bytes 44 4F 57 4E 47 52 44 01 (“DOWNGRD” and 01) at the end of ServerHello.random. A TLS 1.3
client that sees them aborts, and in TLS 1.2 the server signature covers both random fields, so the attacker
cannot change them (RFC 9846 §4.2.3). Try to force the
client onto x25519 alone.
Force a weaker group
Simulation The page hands you the client’s X25519 private key, which it generated itself — as if the group fell during the connection (Logjam did that to 512-bit DH). You compute the rest: both sides’ keys, the decrypted flight, a new Finished.
This is not TLS 1.3 CertificateVerify then signs only both random fields and the server key_share — what TLS 1.2’s ServerKeyExchange signs — not the whole transcript with the client’s offer.
Checking whether this browser has X25519 and ML-KEM in WebCrypto…
With neither switch the handshake fails at the first encrypted record. With only the live break of the group,
it fails at the signature. Only the variant that signs as much as TLS 1.2 does gets through, and only if the
attacker breaks the group during the connection. That is why downgrade has the status “resistant” in the
graph.
The second issue is 0-RTT. A client that has visited the server before holds a session ticket (NewSessionTicket) and can send a request at once, in its first flight, under a key derived from that session’s PSK and from the ClientHello. The server adds nothing fresh to that key, so a recorded flight can be replayed and will decrypt the same way. RFC 9846 §8 requires servers to accept a given 0-RTT flight at most once per instance, but admits that not every deployment will keep shared state. So clients may send only 0-RTT data whose replay does no harm. Against replay through a retried request the TLS layer can do nothing at all — that belongs to the application (RFC 8470).
Replay 0-RTT data
Every node accepts 0-RTT data that decrypts.
Checking whether this browser has X25519 and ML-KEM in WebCrypto…
Every replay is a real computation: the node opens the ticket with its key, checks the binder (HMAC) and decrypts the record under a key from the PSK and the ClientHello. The server adds nothing to that key, so a copy decrypts exactly like the original.
It is a misuse, not a protocol flaw, but an easy one — hence the status “vulnerable if misused”. The third attack in the graph needs nothing during the connection: harvest now, decrypt later. Whoever records a handshake on x25519 alone today will read it once a quantum computer breaks the curve with Shor’s algorithm. The hybrid that prevents this is shown in the Hybrid schemes station — which is why cutting it out of the offer is an attack worth trying.
Where TLS 1.3 runs
- RFC 9846In July 2026 it replaced RFC 8446 (August 2018). The same protocol, version 0x0304, with corrections and clarifications; RFC 8996 and Appendix E.5 forbid negotiating versions older than TLS 1.2.Source (RFC 9846)
- QUIC and HTTP/3QUIC has no handshake of its own: it carries TLS 1.3 messages in CRYPTO frames and takes its keys from it (RFC 9001, May 2021). It has 0-RTT too, so the same lesson about replays applies.Source (QUIC and HTTP/3)
- LogjamA downgrade to DHE_EXPORT in TLS 1.2 and older (2015). The authors reported 8.4% of the top million domains with HTTPS as initially vulnerable. TLS 1.3 has no export suites and signs the whole transcript.Source (Logjam)
- nginxThe ssl_early_data directive turns 0-RTT on (since 1.15.3, off by default). nginx disables OpenSSL’s built-in replay protection because it interferes with session resumption — the documentation says to defend in the application with the $ssl_early_data variable.Source (nginx)
- OpenSSLWith a nonzero max_early_data, OpenSSL turns replay protection on by itself: every session ticket works once, and a second attempt falls back to a full handshake without early data (single-use tickets, RFC 9846 §8.1). The option SSL_OP_NO_ANTI_REPLAY turns it off.Source (OpenSSL)
TLS from the platform, 0-RTT only on purpose
Take TLS from your server and library (Caddy, nginx, OpenSSL, Go, .NET) with the default groups — they give you TLS 1.3 and the hybrid with ML-KEM. TLS 1.2 is the minimum. Leave 0-RTT off unless the application knows which requests arrived as early data and answers 425 Too Early to those that must not be repeated.
ssl_protocols TLSv1.2 TLSv1.3;
ssl_early_data on; # only with support in the application
proxy_set_header Early-Data $ssl_early_data; # "1" when the request came as 0-RTT// RFC 8470: a request from 0-RTT data that must not be repeated → 425 Too Early
app.use((req, res, next) => {
const safe = ['GET', 'HEAD', 'OPTIONS'].includes(req.method);
if (req.get('Early-Data') === '1' && !safe) return res.status(425).end();
next();
});Do not turn off certificate verification, not even “for a moment” in a test environment — then the signature in CertificateVerify proves nothing, and anyone in the middle presents their own key. Do not enable 0-RTT for a whole application just because it saves time. Do not narrow the group list to curves alone, or you lose the hybrid. And do not write your own TLS: this station assembles it for show, while a real implementation also needs HelloRetryRequest, alerts, key updates and constant-time operations.
// ✕ any man in the middle presents its own certificate and is accepted
https.request({ host: 'bank.example', rejectUnauthorized: false });
// ✕ the same in Go: tls.Config{InsecureSkipVerify: true}