Skip to content

tailcat, cmd/tailcat: add experimental --hybrid post-quantum handshake - #160

Merged
bradfitz merged 1 commit into
mainfrom
bradfitz/hybrid
Nov 18, 2026
Merged

bradfitz merged 1 commit into
mainfrom
bradfitz/hybrid

Conversation

@bradfitz

@bradfitz bradfitz commented Nov 4, 2026

Copy link
Copy Markdown
Member

Add an experimental "tailcat serve --hybrid" flag (Server.Hybrid in
the Go API) that makes the server use wireguard-go's hybrid
post-quantum (ML-KEM-768) WireGuard handshake. Unlike the pre-shared
key's post-quantum protection, this doesn't depend on the tailcat
address staying secret, so it also protects servers whose addresses
are published, as in DNS TXT records.

Both peers must agree on the handshake type, with no fallback, so
hybrid addresses say so with a new CBOR bool ("y", omitted when false)
and clients set the matching wgcfg.PeerConfig.Hybrid.

With the hybrid handshake, the pre-shared key only needs to keep out
strangers who know the server's public key, such as a DERP operator,
so hybrid addresses carry just 128 bits of it (zero-padded to the
WireGuard key size), making them shorter. 128 bits rather than fewer
because any client the server admits gets a handshake response it can
test guesses against offline.

The shorter key also makes clients from before this change fail early:
they require a 32-byte key in the "q" field, so they reject hybrid
addresses at parse time instead of retrying a classic handshake that
can never succeed. (Renaming the required server key field wouldn't
have: old clients don't check that it's present.) Hybrid addresses
made with --psk=false have no such early failure.

Updates #133

Add an experimental "tailcat serve --hybrid" flag (Server.Hybrid in
the Go API) that makes the server use wireguard-go's hybrid
post-quantum (ML-KEM-768) WireGuard handshake. Unlike the pre-shared
key's post-quantum protection, this doesn't depend on the tailcat
address staying secret, so it also protects servers whose addresses
are published, as in DNS TXT records.

Both peers must agree on the handshake type, with no fallback, so
hybrid addresses say so with a new CBOR bool ("y", omitted when false)
and clients set the matching wgcfg.PeerConfig.Hybrid.

With the hybrid handshake, the pre-shared key only needs to keep out
strangers who know the server's public key, such as a DERP operator,
so hybrid addresses carry just 128 bits of it (zero-padded to the
WireGuard key size), making them shorter. 128 bits rather than fewer
because any client the server admits gets a handshake response it can
test guesses against offline.

The shorter key also makes clients from before this change fail early:
they require a 32-byte key in the "q" field, so they reject hybrid
addresses at parse time instead of retrying a classic handshake that
can never succeed. (Renaming the required server key field wouldn't
have: old clients don't check that it's present.) Hybrid addresses
made with --psk=false have no such early failure.

Updates #133

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: I496cab05fe004f041131dbe9b85381e06baea48e
@bradfitz
bradfitz force-pushed the bradfitz/hybrid branch 2 times, most recently from 21049fb to 4407298 Compare November 18, 2026 19:19
@bradfitz
bradfitz merged commit aaf4a7d into main Nov 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant