Featured Developer Sponsor • Zero-Token Protection
TLS 1.3, Encrypted Client Hello (ECH) & HPKE Architecture Studio
RFC 9460 Encrypted SNI, Hybrid Public Key Encryption (HPKE RFC 9180), DNS HTTPS RR Type 65, and TLS 1.3 HKDF Key Schedule
Standard TLS 1.3 encrypts application payloads and server certificates, but leaks destination hostnames in plaintext via the Server Name Indication (SNI) header. Encrypted Client Hello (ECH) closes this last major privacy hole on the open web by wrapping an encrypted Inner ClientHello inside a benign Outer ClientHello using Hybrid Public Key Encryption (HPKE).
1. ECH Outer vs Inner ClientHello Wire Protocol Inspector
Inspect What an On-Path ISP Wiretap Sees vs What the TLS Termination Gateway Decrypts
Outer ClientHello (Plaintext Wiretap)
CLEARWIRE
Visible to ISPs, Firewalls & Middleboxes
The adversary only sees the public cover SNI and high-entropy ECH ciphertext.
Inner ClientHello (Decrypted Payload)
HPKE DECRYPTED
Unwrapped exclusively inside Gateway Core
True identity and protocol routing flags are revealed only after private key decryption.
2. TLS 1.3 HKDF Key Schedule Derivation Tree
Cryptographic Secret Evolution: EarlySecret -> HandshakeSecret -> MasterSecret
1. Early Secret Stage: HKDF-Extract(0, PSK)
0-RTT PHASE
Derives: client_early_traffic_secret (used for optional 0-RTT early data) & binder_key
2. Handshake Secret Stage: HKDF-Extract(EarlyDerived, ECDHE_Shared_Secret)
HANDSHAKE ENCRYPTION
Derives: client_handshake_traffic_secret & server_handshake_traffic_secret (Encrypts EncryptedExtensions, Certificates, & Verify)
3. Master Secret Stage: HKDF-Extract(HandshakeDerived, 0)
APPLICATION PHASE
Derives: client_application_traffic_secret_0 & server_application_traffic_secret_0 (Bidirectional HTTP Data) & resumption_master_secret
3. DNS HTTPS Resource Record (Type 65) Decoder
Inspect the Bootstrapping ECHConfigList, ALPN Parameters, and Port Directives
; example.com. IN HTTPS 1 . (
; alpn="h3,h2"
; port=443
; ipv4hint=104.16.132.229
; ech=AEX+DQBB/wAgACBsW3R5V6L...
; )
| ECHConfig Parameter | Binary Field Type | Resolved Value | Security Purpose |
|---|---|---|---|
| ECH Version | uint16 | 0xfe0d (Draft-13 / RFC 9460) |
Identifies exact ECH framing specification |
| Public Name | Opaque String | cloudflare-ech.com |
Fallback domain used in Outer SNI for routing |
| KEM ID | uint16 | 0x0020 (X25519) |
Hybrid Public Key Encryption Diffie-Hellman curve |
| Cipher Suites | List <KDF, AEAD> | HKDF-SHA256, AES-128-GCM, ChaCha20-Poly1305 |
Symmetric envelope cipher for Inner ClientHello |
| Maximum Name Length | uint8 | 64 bytes |
Uniform padding length to defeat packet-size side-channels |
4. Production ECH Server Configurations & Go 1.23+ Implementation
Cloudflare Edge Proxy, NGINX with OpenSSL 3.4/BoringSSL, and Go 1.23 ECH Client
Frequently Asked Technical Questions
Why was the Server Name Indication (SNI) unencrypted in legacy TLS 1.2 and standard TLS 1.3?+
When TLS was originally designed, virtual hosting required the client to announce which hostname it wished to connect to before the server could select the correct X.509 certificate and cryptographic cipher suite. Because the TLS handshake begins with the ClientHello before any encryption keys have been negotiated, the SNI extension was transmitted in cleartext. Even in standard TLS 1.3—where the certificate and all subsequent handshakes are encrypted—the initial ClientHello and SNI remain in plaintext, allowing Internet Service Providers, network routers, and state-level DPI firewalls to log and censor every visited website.
How does Encrypted Client Hello (ECH RFC 9460) solve the SNI privacy leak?+
ECH splits the ClientHello into two separate messages: an Outer ClientHello and an Inner ClientHello. The Outer ClientHello contains a benign, public-facing cover domain (e.g. cloudflare-ech.com or public-cdn.net) visible to eavesdroppers. The Inner ClientHello contains the actual sensitive destination hostname, ALPN protocols, and extensions. The client encrypts the Inner ClientHello using Hybrid Public Key Encryption (HPKE RFC 9180) with a public key retrieved out-of-band via DNS (HTTPS RR Type 65) and includes the encrypted ciphertext inside the ECH extension of the Outer ClientHello.
What role does DNS HTTPS Resource Record (Type 65) play in ECH bootstrapping?+
Before a browser can encrypt the ClientHello, it must know the server public key, supported KEM algorithms, and symmetric cipher suites. RFC 9460 specifies that authoritative DNS servers publish this cryptographic metadata in an HTTPS record (Type 65) via the "ech" parameter containing a Base64-encoded ECHConfigList. When paired with encrypted DNS protocols (DNS over HTTPS or DNS over TLS), the client retrieves the server ECH public key privately, preventing network observers from learning the destination via DNS.
How does the TLS 1.3 Key Schedule derive traffic keys using HKDF?+
TLS 1.3 uses a multi-stage HKDF (HMAC-based Extract-and-Expand Key Derivation Function) state machine. It begins with an Early Secret (derived from an optional Pre-Shared Key). Next, it extracts the ephemeral Diffie-Hellman secret (from X25519 key exchange) into the Handshake Secret, generating client_handshake_traffic_secret and server_handshake_traffic_secret to encrypt the remaining handshake messages (certificates and verify signatures). Finally, it extracts a derived master secret to produce client_application_traffic_secret_0 and server_application_traffic_secret_0 for bidirectional application payload encryption.
Sponsored Utility
While You're Here
Sponsored Recommendations
Advertisement