---
title: "Post-Quantum Cryptography"
description: "How Octelium protects its traffic against harvest now, decrypt later attacks via hybrid X25519MLKEM768 key exchange and post-quantum WireGuard preshared keys."
canonical: "https://octelium.com/docs/octelium/latest/concepts/post-quantum-cryptography"
product: "Octelium"
---

# Post-Quantum Cryptography

> Octelium documentation. Canonical page: <https://octelium.com/docs/octelium/latest/concepts/post-quantum-cryptography>.

Post-quantum cryptography (PQC) refers to cryptographic algorithms that are designed to remain secure against attackers equipped with cryptographically relevant quantum computers. Such computers would be able to break the elliptic-curve and RSA-based algorithms that secure virtually all internet traffic today, including the X25519 key exchange used by TLS 1.3, QUIC, SSH and WireGuard.

The most pressing threat is "harvest now, decrypt later", where an attacker records encrypted traffic today and decrypts it once breaking the classical key exchange becomes feasible. This threat specifically targets the key exchange since the keys that encrypt the traffic are derived from it, which is why the key exchange needs to be protected well before such quantum computers exist. Signatures, on the other hand, cannot be broken retroactively from recorded traffic.

The standard answer to this threat is the hybrid key exchange, which combines the classical X25519 with ML-KEM-768, the key encapsulation mechanism standardized by NIST in [FIPS 203](https://csrc.nist.gov/pubs/fips/203/final). It is known as `X25519MLKEM768` in TLS 1.3 and QUIC and as `mlkem768x25519-sha256` in SSH. A hybrid key exchange remains secure as long as either of its two algorithms remains unbroken, so it is never weaker than the classical key exchange that it replaces.

This page explains how Octelium protects the connections between *Users* and the *Cluster*, especially those crossing the internet, against such attacks. The *Cluster*'s internet-facing TLS has negotiated `X25519MLKEM768` by default since version `v0.47.0` (released on October 24, 2026), and the Go-based components and clients, including the QUIC-based tunnels and SSH, have preferred the hybrid key exchange since version `v0.18.0` (released on September 12, 2025). Starting from version `v0.54.0`, Octelium also protects its default WireGuard tunnels via post-quantum preshared keys that are enabled by default.

## Overview

The following table summarizes the key exchange used by each connection between the client side and the *Cluster* as well as between the *Cluster* and the upstreams:

| Connection                                                                                            | Key exchange                                                                             | Since                          |
| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------ |
| CLIs, SDKs and browsers to the *Ingress* (APIs, authentication, web portal and clientless *Services*) | `X25519MLKEM768` over TLS 1.3                                                            | `v0.47.0` (October 24, 2026)   |
| WireGuard tunnels (the default tunneling mode)                                                        | X25519 mixed with a per-connection preshared key that is delivered over `X25519MLKEM768` | `v0.54.0`                      |
| QUIC tunnels                                                                                          | `X25519MLKEM768` over TLS 1.3                                                            | `v0.18.0` (September 12, 2025) |
| SSH-based *Services* and embedded SSH                                                                 | `mlkem768x25519-sha256`                                                                  | `v0.18.0` (September 12, 2025) |
| *Vigil* to TLS-based upstreams                                                                        | `X25519MLKEM768` over TLS 1.3 whenever the upstream supports it                          | `v0.18.0` (September 12, 2025) |

> **Note:**
>
> The hybrid key exchange is negotiated, not enforced. Octelium still accepts clients that only support classical key exchanges (e.g. TLS 1.2 clients and older `octelium` CLIs) so that upgrading the *Cluster* never breaks existing clients and integrations. Such clients keep working with classical key exchanges while every client that supports the hybrid key exchange automatically uses it.

## The Ingress

The [*Ingress*](https://octelium.com/docs/octelium/latest/reference/components.md#ingress), implemented by Envoy, terminates the internet-facing TLS of the *Cluster*. This includes the gRPC-based APIs used by the `octelium` and `octeliumctl` CLIs and the SDKs, including the `octelium connect` stream that sets up the tunnels, the authentication and login flows, the web portal, as well as every clientless BeyondCorp and public *Service* (read more [here](https://octelium.com/docs/octelium/latest/management/core/service/clientless.md)).

Envoy `v1.40` added `X25519MLKEM768` to its default key exchange groups for both downstream and upstream TLS connections. Since version `v0.47.0`, which upgraded the *Ingress* to Envoy `v1.40`, every *Cluster* negotiates `X25519MLKEM768` with every client that supports it without any configuration required. Such clients include:

- **Octelium CLIs** The `octelium` and `octeliumctl` CLIs since version `v0.18.0`, which are built with Go 1.24 or later versions where `X25519MLKEM768` is enabled by default.

- **Go applications** Your own Go programs and workloads, including those using the Octelium Go SDK (read more [here](https://octelium.com/docs/octelium/latest/management/guide/sdk.md)), as long as they are built with Go 1.24 or later and their `go.mod` file declares `go 1.24` or later versions.

- **Browsers** Recent versions of modern browsers such as Chrome, Edge, Firefox and Safari, which are used to access the web portal and the clientless web-based *Services*.

- **Other TLS clients** Any client whose TLS library supports `X25519MLKEM768`, such as OpenSSL 3.5 or later versions, which is used for example by `curl` and by many workloads accessing HTTP-based *Services* via OAuth2 client credentials or bearer access tokens (read more [here](https://octelium.com/docs/octelium/latest/management/core/credential.md)).

You can check the key exchange negotiated by your *Cluster* using OpenSSL 3.5 or later versions as follows:

```bash
openssl s_client -connect example.com:443 -servername example.com -groups X25519MLKEM768 </dev/null 2>/dev/null | grep "Negotiated TLS1.3 group"
```

The output should be as follows:

```text
Negotiated TLS1.3 group: X25519MLKEM768
```

> **Note:**
>
> If you serve the *Ingress* behind a front proxy or a load balancer that terminates TLS (read more [here](https://octelium.com/docs/octelium/latest/install/cluster/pre-install.md#front-proxy)), then the internet-facing TLS connections are terminated by that front proxy instead of Envoy. In such case, you need to make sure that your front proxy supports `X25519MLKEM768` in order to keep the post-quantum protection, including that of the WireGuard preshared keys described below.

## WireGuard Tunnels

WireGuard is the default tunneling mode used by the `octelium connect` command to connect to the *Cluster* (read more [here](https://octelium.com/docs/octelium/latest/user/cli/connect.md)). WireGuard's handshake uses X25519 for both its static and ephemeral keys, which means that an attacker who records the handshake as well as the encrypted traffic today could decrypt that traffic once X25519 is broken. WireGuard does not support ML-KEM. Instead, its protocol provides an optional 256-bit symmetric preshared key that is mixed into the public key cryptography of the handshake, which the WireGuard protocol documents as the way to add post-quantum resistance (read more [here](https://www.wireguard.com/protocol/)). Since the preshared key is mixed together with the X25519 shared secrets, the derived keys remain secure as long as the preshared key remains secret, even if X25519 is broken.

The main difficulty with preshared keys is distributing them securely. Starting from version `v0.54.0`, Octelium automatically derives a unique preshared key for every connection and every *Gateway*, and delivers the root from which the client derives these keys over the post-quantum TLS connection described [above](#the-ingress) without any manual key management.

### How the Preshared Key is Derived

Octelium derives the preshared keys in 3 levels using HKDF-SHA-256 ([RFC 5869](https://www.rfc-editor.org/rfc/rfc5869)):

1. **The seed** During the *Cluster* installation as well as during every upgrade, the [*Genesis*](https://octelium.com/docs/octelium/latest/reference/components.md#genesis) component creates, if it does not already exist, a random 256-bit seed that is stored in the hidden system *Secret* `sys:wg-psk-seed`. The seed never leaves the *Cluster*, is not accessible via the API Server to any *User*, and is only used by the [API Server](https://octelium.com/docs/octelium/latest/reference/components.md#api-server) and the [*Gateway Agents*](https://octelium.com/docs/octelium/latest/reference/components.md#gateway-agent).

2. **The connection root** Whenever a client connects to the *Cluster*, the API Server derives a 256-bit root from the seed that is bound to both the *Session* and the WireGuard public key of that connection as follows:

```text
root = HKDF-SHA-256(seed, info = "octelium/wg-psk-root/v1/" || sessionUID || "/" || hex(wgPublicKey))
```

Since every connection uses a new WireGuard key pair, every connection, including a reconnection of the same *Session*, has a different root.

3. **The preshared key** The client and every *Gateway Agent* independently derive the preshared key for each *Gateway* using the *Gateway*'s ID as follows:

```text
psk = HKDF-SHA-256(root, info = "octelium/wg-psk/v1/" || gatewayID)
```

The *Gateway Agent* derives the root by itself from the seed and the *Session*'s connection information. As a result, the preshared keys themselves are never transmitted over the network, and the client only ever receives the root of its own connection. Since deriving a root requires the seed, a client cannot derive the preshared keys of any other connection.

### How the Root is Delivered

The root is sent to the client only once, in the response of the `Connect` gRPC stream that the client opens to the API Server in order to set up its connection. This is the same stream that delivers the rest of the connection's WireGuard configuration. This stream is carried over TLS 1.3 through the *Ingress* and is therefore protected by `X25519MLKEM768` as described [above](#the-ingress). As a result, an attacker who records both the TLS connection and the WireGuard traffic would need to break ML-KEM-768 in addition to X25519 in order to recover the root and in turn the preshared keys. In other words, the WireGuard tunnel inherits the post-quantum protection of the hybrid TLS 1.3 key exchange.

The root and the preshared keys are never stored in the *Session*, which only records whether its connection uses preshared keys via a boolean field.

### Negotiation and Compatibility

Preshared keys are negotiated per connection as well as per *Gateway* so that they never break connectivity during upgrades or with older clients:

- **The client** The `octelium connect` command requests a preshared key by default for WireGuard connections. The API Server only sends the root if the seed is available, and marks the *Session*'s connection as using preshared keys via its `status.connection.wireguardPresharedKey` field.

- **The Gateway** Each *Gateway Agent* loads the seed upon its start and announces its support for preshared keys via the `status.wireguard.usePresharedKey` field of its *Gateway*. It then sets the derived preshared key for every connection that is marked as using preshared keys.

- **Both sides** The client only sets the preshared key for the *Gateways* that announce their support, and uses no preshared key with the rest.

As a result, older clients, *Clusters* running older versions, as well as *Gateways* that are not upgraded yet, keep working without preshared keys. Once both the client and the *Cluster* are upgraded to `v0.54.0` or later versions, the next connection automatically uses preshared keys without any further action from the *Cluster* administrators or the *Users*.

The preshared key is only mixed into the WireGuard handshake, so it adds no per-packet overhead and does not change the MTU. It is supported by all the tunnel implementation modes (read more [here](https://octelium.com/docs/octelium/latest/user/cli/connect.md#tunnel-implementation)) on Linux, macOS and Windows. The QUIC tunneling mode does not use preshared keys since QUIC itself already uses `X25519MLKEM768` via TLS 1.3.

### Disabling Preshared Keys

You can disable WireGuard preshared keys for a connection via the `--wg-psk-mode` flag as follows:

```bash
octelium connect --wg-psk-mode disabled
```

You can also set the `OCTELIUM_WG_PSK_MODE` environment variable instead of using the `--wg-psk-mode` flag as follows:

```bash
export OCTELIUM_WG_PSK_MODE=disabled
octelium connect
```

The available values are `enabled`, which is the default mode, and `disabled`. If both are set, the `--wg-psk-mode` flag takes precedence over the environment variable.

### Verifying Preshared Keys

You can verify that a *Session*'s connection uses preshared keys (read more about *Sessions* [here](https://octelium.com/docs/octelium/latest/management/core/session.md)) as follows:

```bash
octeliumctl get sess <SESSION_NAME> -o yaml
```

The YAML output then contains the `wireguardPresharedKey` field as follows:

```yaml
apiVersion: core/v1
kind: Session
#....
status:
  connection:
    # ....
    wireguardPresharedKey: true
```

Similarly, you can verify that a *Gateway* uses preshared keys as follows:

```bash
octeliumctl get gw <GATEWAY_NAME> -o yaml
```

The YAML output then contains the `usePresharedKey` field as follows:

```yaml
apiVersion: core/v1
kind: Gateway
#....
status:
  wireguard:
    # ....
    usePresharedKey: true
```

On Linux, if the client uses the WireGuard kernel mode, you can also run `sudo wg show` where every *Gateway* peer that uses a preshared key shows the line `preshared key: (hidden)`.

## Other Connections

- **QUIC tunnels** The QUIC-based tunneling mode (read more [here](https://octelium.com/docs/octelium/latest/user/cli/connect.md#quic-mode)) exclusively uses TLS 1.3 and has negotiated `X25519MLKEM768` since version `v0.18.0`. Therefore, it is post-quantum protected without the need for any preshared keys.

- **SSH** *Vigil*'s SSH server used by SSH-based *Services* (read more [here](https://octelium.com/docs/octelium/latest/management/core/service/ssh.md)) and the embedded SSH server (read more [here](https://octelium.com/docs/octelium/latest/management/core/service/embedded-ssh.md)) prefer `mlkem768x25519-sha256`, which is supported by OpenSSH 9.9 and later versions and is the default key exchange since OpenSSH 10.0. OpenSSH clients older than 9.9 fall back to the classical `curve25519-sha256`. The same applies to *Vigil*'s SSH client that connects to the upstream SSH servers. Starting from version `v0.54.0`, these SSH servers also no longer offer the deprecated `diffie-hellman-group14-sha1` key exchange.

- **Upstreams** *Vigil* connects to TLS-based upstreams (e.g. HTTPS APIs including SaaS APIs over the internet, PostgreSQL and MySQL databases over TLS and mTLS-protected upstreams) with Go's default TLS settings and therefore negotiates `X25519MLKEM768` whenever the upstream supports it. Upstreams that are served by connected clients (read more [here](https://octelium.com/docs/octelium/latest/management/core/service/overview.md#remotely-via-a-connected-user)) are reached through the WireGuard or QUIC tunnels of these clients and are therefore protected as described above.

- **Inside the Cluster** When SPIFFE support is enabled (read more [here](https://octelium.com/docs/octelium/latest/install/cluster/pre-install.md#spiffe-support)), the Go-based *Cluster* components communicate to one another over mTLS with TLS 1.3 and `X25519MLKEM768`. Starting from version `v0.54.0`, Envoy's own upstream TLS connections, including its connection to the *Cluster*'s xDS server, also use TLS 1.3 and `X25519MLKEM768`.

## Authentication and Signatures

The post-quantum protection described above concerns traffic confidentiality against "harvest now, decrypt later" attacks. Authentication in Octelium still relies on classical signature algorithms, including those used by the *Cluster*'s TLS certificate (read more [here](https://octelium.com/docs/octelium/latest/install/cluster/tls-certificate.md)), the Ed25519 keys that sign the *Session* access tokens and *Credentials*, and the ECDSA P-256 *Cluster* SSH CA.

Forging an authentication signature later does not, by itself, decrypt a previously completed connection whose key exchange and traffic encryption remain secure. Signature forgery can, however, compromise authentication of new connections or credentials while the affected key remains trusted.

In the client-based mode, TLS and SSH traffic to *Services* is also carried inside WireGuard or QUIC tunnels. The *Cluster*-to-client leg is also tunneled when a connected client serves an upstream, including embedded SSH. When QUIC negotiates hybrid key exchange, or WireGuard uses securely provisioned preshared keys whose seed, root and derived keys remain secret, the outer tunnel protects the encapsulated handshakes and application traffic against passive recording and later decryption, even if the inner connection uses classical key exchange.

This additional protection applies to the tunneled network leg. Public *Ingress* connections used for login and tunnel provisioning, clientless access and upstream legs outside these tunnels need their own protection. WireGuard provisioning and QUIC handshakes still rely on classical TLS certificate authentication.

Moving to post-quantum signatures such as ML-DSA ([FIPS 204](https://csrc.nist.gov/pubs/fips/204/final)) requires compatible signing and verifying components. Publicly trusted TLS certificates depend on CA, browser and TLS library support; SSH depends on support in the relevant SSH implementations. Octelium's token-signing migration has its own issuer and verifier compatibility requirements.

## Where to Go Next

- **Get the WireGuard preshared keys:** [upgrade your *Cluster*](https://octelium.com/docs/octelium/latest/install/cluster/upgrade.md) and your [`octelium` CLI](https://octelium.com/docs/octelium/latest/install/cli/install.md) to `v0.54.0` or later versions. No additional configuration is required.
- **Connect to a Cluster:** [Connecting to a *Cluster*](https://octelium.com/docs/octelium/latest/user/cli/connect.md) documents the WireGuard and QUIC tunneling modes as well as the tunnel implementation modes.
- **Understand the architecture:** [How Octelium Works](https://octelium.com/docs/octelium/latest/overview/how-octelium-works.md) walks through the client-based and clientless access paths, the *Ingress*, the *Gateways* and the identity-aware proxy model.
