- Data at rest is encrypted with AES, a symmetric cipher. There is no key exchange and no public-key step, so there is nothing for a quantum computer to attack with Shor’s algorithm.
- Data in transit is protected by TLS 1.3 with the hybrid post-quantum key exchange
X25519MLKEM768. ClickHouse negotiates it by default with every client that supports it, starting from version 25.11, and can be configured to refuse everything else. - The SSH interface negotiates a hybrid post-quantum key exchange as well, in current versions.
What a quantum computer breaks
A large enough quantum computer affects two classes of cryptography differently:- Public-key cryptography based on factoring and discrete logarithms (RSA, Diffie-Hellman, elliptic curves) is broken by Shor’s algorithm. In TLS these algorithms do two jobs: the key exchange, which produces the keys that encrypt a session, and the signatures, which authenticate the server.
- Symmetric cryptography and hash functions (AES, ChaCha20, SHA-2) are only affected by Grover’s algorithm, which speeds up a brute-force search quadratically at best. A 256-bit key keeps a 128-bit security margin even in that model.
Data at rest
The encryption features for stored data use AES with a key that you provide:
The key is read from the configuration or passed in the query, and is used directly to encrypt and decrypt. Nothing is negotiated and nothing is wrapped with a public key, so these features never depended on quantum-vulnerable cryptography.
Grover’s algorithm is the only quantum attack that applies, and it is far from practical: NIST considers it “quite likely that Grover’s algorithm will provide little or no advantage in attacking AES, and AES 128 will remain secure for decades to come”. If your policy asks for a margin against it anyway, as CNSA 2.0 does, use 256-bit keys. For an encrypted disk, this means setting the algorithm explicitly, because the default is
AES_128_CTR:
- Delivery of the key. If the key reaches the server from a secrets manager or a deployment system, the channel that carries it has to be post-quantum as well.
- Encryption by the storage provider. Server-side encryption of an object storage or a block device is done by the provider with its own keys. In ClickHouse Cloud, data at rest is encrypted with AES-256 keys.
Data in transit
This section describes TLS as it is terminated by the ClickHouse server itself. A connection that goes through a TLS-terminating proxy or load balancer negotiates what that component supports: use the commands in How to check to see what an endpoint does.What is negotiated by default
ClickHouse uses OpenSSL 3.5, which implements ML-KEM and prefers the hybrid groupX25519MLKEM768 (RFC 10024) in TLS 1.3. The group combines two key exchanges, the classical X25519 and the post-quantum ML-KEM-768, and derives the session keys from both results.
The session stays secure as long as either of the two is unbroken. This is the reason to deploy a hybrid and not ML-KEM alone: lattice-based cryptography is younger than elliptic curves and its cryptanalysis is an active field of research, but no progress there can make a hybrid connection weaker than the classical one it replaces.
With the default configuration:
- The server accepts
X25519MLKEM768and selects it whenever the client lists it as supported. It also selects it when the client’s first guess was a classical key share: the server asks the client to retry with the hybrid group. - ClickHouse as a client offers
X25519MLKEM768first. This coversclickhouse-client, connections between servers for distributed queries and replication, and outgoing HTTPS connections such as theurlands3table functions. - Both the server and the client fall back to a classical key exchange (X25519, NIST curves) or to TLS 1.2 if the other side supports nothing better.
tcp_port_secure), the interserver HTTPS port, the MySQL and PostgreSQL wire protocols, gRPC, and both the client port and the Raft port of ClickHouse Keeper.
The key exchange is the only part of TLS that changes. The data is encrypted by the same symmetric ciphers as before, TLS_AES_256_GCM_SHA384 by default.
Versions
The hybrid key exchange is available in every release built with OpenSSL 3.5 or later:- ClickHouse 25.11 and later.
- The 25.8 LTS release, starting from 25.8.23.
It takes both sides
A key exchange is negotiated, so the client has to support the hybrid group too. Clients built on OpenSSL 3.5 or later do, and so doclickhouse-client 25.11 or later, Go 1.24 or later, and current versions of Chrome and Firefox. This is no longer exotic: as of 2026-12-01, Cloudflare reports that 73% of the human traffic it serves is post-quantum encrypted.
A client that does not support the hybrid group still connects, with a classical key exchange, unless you require the hybrid.
How to check
With OpenSSL 3.5 or later on the client machine, connect to any TLS port of the server:curl -v prints it as well, as the third field:
How to require it
By default the server prefers the hybrid key exchange but does not insist on it. To refuse classical key exchanges, restrict the list of TLS groups. TheopenSSL section of the server configuration has no option for the list of groups, so it is set in an OpenSSL configuration file, which ClickHouse loads only if the OPENSSL_CONF environment variable points to it.
Create the file, for example /etc/clickhouse-server/openssl-pq.cnf:
sudo systemctl edit clickhouse-server and add:
-e OPENSSL_CONF=/etc/clickhouse-server/openssl-pq.cnf and mount the file. Restart the server afterwards.
Three things to know before you do this:
- Keep
MinProtocol = TLSv1.3. Post-quantum groups exist only in TLS 1.3. If the list of groups is restricted while TLS 1.2 is still allowed, a TLS 1.2 client can no longer use an elliptic-curve key exchange and falls back to the RSA key exchange, which is neither post-quantum nor forward secret. - The setting covers the whole process: all TLS ports listed above, and also the connections that the server makes as a client. Every peer must support the hybrid group, including other ClickHouse servers, object storage endpoints, and the sources of dictionaries and table functions. A peer that does not is refused with
handshake failure. - Every client must support it, otherwise it can no longer connect.
Groups separated by colons. SecP256r1MLKEM768 and SecP384r1MLKEM1024 are the hybrids with NIST curves from the same RFC, for policies that require those curves or ML-KEM-1024. Groups with ML-KEM alone, such as MLKEM1024, are available too, but they give up the protection of the classical part, so prefer the hybrids.
The same file works for clickhouse-client and other ClickHouse tools, if you want a client that refuses to connect to a server without a post-quantum key exchange.
Authentication
Authentication is where classical cryptography remains, and where it is the least urgent to replace. The deadline is set by the arrival of the quantum computer and not by today’s recordings: the transition plan of NIST (IR 8547) deprecates the quantum-vulnerable signature and key exchange algorithms after 2030 and disallows them after 2035.- Server certificates are usually signed with RSA or ECDSA, like everywhere else on the Internet. Breaking them takes a quantum computer at the time of the connection, to impersonate the server, and reveals nothing about sessions recorded earlier. ClickHouse is ready for the replacement: it loads certificates with ML-DSA keys and authenticates TLS 1.3 connections with them, provided that your certificate authority issues them and your clients can verify them (OpenSSL 3.5 or later).
- Passwords are stored as hashes, such as
sha256_passwordandbcrypt_password, which are not affected by Shor’s algorithm. - SSH keys and client certificates used to authenticate users rely on classical signatures, with the same reasoning as for server certificates.
SSH interface
The SSH interface does not use TLS and has its own key exchange. With a current OpenSSH client it negotiatesmlkem768x25519-sha256, a hybrid of ML-KEM-768 and X25519, in ClickHouse 26.7 and later, and in the LTS releases starting from 25.8.31 and 26.3.20.
Releases before that negotiate, depending on the version, either sntrup761x25519-sha512, which is also a hybrid post-quantum key exchange, based on Streamlined NTRU Prime, or the classical curve25519-sha256. To check, look for the kex: algorithm line in the output of ssh -v: