Skip to content

dnscrypt_ephemeral_keys has no effect on PQDNSCrypt servers #3377

Closed

Description

@followtherabbit99

Diagnostic output

./dnscrypt-proxy -version
2.1.19

./dnscrypt-proxy -check
[NOTICE] Configuration successfully checked

./dnscrypt-proxy -resolve example.com
(resolves normally)
  • I read the documentation and this is not answered there
  • Initially raised as discussion #...

What's happening?

dnscrypt_ephemeral_keys has no effect on post-quantum servers. The option is documented as creating a new key pair for every query so that a resolver cannot link queries together. For classical servers each query does carry a fresh client key. For PQ servers every query reuses the same material: the same X-Wing ciphertext while no ticket is held, and then the same resumption ticket on every later query. A resolver, or a relay, can group all of a client's PQ queries by that constant value, which is what the option is meant to prevent. The user gets no warning that the setting does nothing here.

When does this occur?

With dnscrypt_ephemeral_keys = true and pqdnscrypt = true (the default) against a server that offers a PQ certificate.

Where does it happen?

encryptPQ in pq.go never reads proxy.ephemeralKeys. It caches one X-Wing encapsulation per network epoch and reuses the stored resumption ticket. The flag is only consulted in the classical path, Encrypt in crypto.go.

How do we replicate the issue?

  1. Set dnscrypt_ephemeral_keys = true and keep pqdnscrypt = true.
  2. Use a server that offers a PQ certificate.
  3. Send several queries and capture the outgoing packets.

Every PQ query carries the same client-magic and the same ticket bytes. With a classical server, the client public key differs on every query.

Expected behavior

Either dnscrypt_ephemeral_keys forces a fresh PQ key exchange per query, matching the classical behavior, or the documentation states that the option does not apply to post-quantum servers.

Additional context

Reproduced on commit 71c139a. A standalone Go test shows a classical server receiving four different client keys while a PQ server receives one ciphertext followed by the same ticket three times.

Activity

  1. jedisct1 commented on Oct 22, 2026

    @jedisct1
    Member

    This is impractical. That would be way too slow and CPU intensive.

    This is why the specification says that PQ key pairs must be updated on client IP changes. dnscrypt-proxy now tries to do that (hence the new warning messages you may have seen) even though that can't be instantaneous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions