Blame

937880 Arne 2025-05-01 16:02:44 1
# Post-quantum cryptography security in OpenVPN
2
d53700 novaflash 2025-06-03 21:13:42 3
This is a defense against potential attacks from quantum computing powerful enough to break certain cryptographic algorithms. In general, symmetric ciphers such as AES-GCM and Chacha20-Poly1305 that are used for data-channel encryption, are still safe to use. No change is necessary in this area. The cryptographic algorithms that are affected are the asymmetric algorithms. These are commonly used to establish the symmetric encryption keys for data encryption.
4
937880 Arne 2025-05-01 16:02:44 5
There are three major aspects of post-quantum security in OpenVPN that this article discusses:
6
7
1. pre-shared key control security (tls-crypt/tls-crypt-v2)
8
2. post-quantum key agreement
9
3. post-quantum signing/certificates
10
11
# pre-shared key control security (tls-crypt/tls-crypt-v2)
12
110673 novaflash 2025-06-03 21:22:07 13
OpenVPN has two channels for communication - the control channel and the data channel. The control channel is where authentication and key agreement occurs, whereas the data channel transports the encrypted payload. The tls-crypt and tls-crypt-v2 options work by using pre-shared symmetric keys to encrypt the whole control channel and the TLS handshake that occurs there. In essence symmetric keys protect the asymmetric part of the process. Often this kind of protection is called "poor man's post-quantum cryptography".
937880 Arne 2025-05-01 16:02:44 14
15
Quoting the man page:
16
d906a3 novaflash 2025-06-03 21:27:19 17
provides "poor-man's" post-quantum security, against attackers who will never know the pre-shared key (i.e. no forward secrecy).
937880 Arne 2025-05-01 16:02:44 18
19
20
# Post-quantum key agreement
21
d53700 novaflash 2025-06-03 21:13:42 22
The key agreement is what TLS server and client use to agree on a common secret that will be used to derive all encryption keys for the connection. Typically this should be done in a way that ensures the common secret is not recoverable later, even if the secrets of the client and/or server are at some point compromised. This principle is called [Perfect Forward Secrecy](https://de.wikipedia.org/wiki/Perfect_Forward_Secrecy) and is typically achieved by using finite field Diffie-Hellman (see also `--dh`) or [Elliptic-curve Diffie–Hellman](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie–Hellman). TLS 1.3 typically uses ECDH with the X25519 curve for the key agreement.
937880 Arne 2025-05-01 16:02:44 23
110673 novaflash 2025-06-03 21:22:07 24
To achieve perfect forward secrecy with post-quantum a [hybrid ECDHE-MLKEM Key Agreement](https://datatracker.ietf.org/doc/draft-ietf-tls-ecdhe-mlkem/) is used. Examples are X25519MLKEM768, SecP256r1MLKEM768, and SecP384r1MLKEM1024. Typically X25519MLKEM768 is used.
937880 Arne 2025-05-01 16:02:44 25
26
OpenVPN version 2.7.0 and newer will display the key agreement in use during connection:
27
28
Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, [...], key agreement: X25519MLKEM768
29
30
The allowed key-agreement can be configured using the `--tls-groups` configuration options. E.g. using
31
32
tls-groups X25519MLKEM768
33
d53700 novaflash 2025-06-03 21:13:42 34
will only allow connections that use this post-quantum safe key-agreement. A connection that cannot fulfill this requirement will fail similar to this:
937880 Arne 2025-05-01 16:02:44 35
36
OpenSSL: error:0A000065:SSL routines::no suitable key share:
1ceda8 Arne 2025-05-01 16:21:48 37
d53700 novaflash 2025-06-03 21:13:42 38
This also requires OpenVPN to be used with a TLS library that supports these new key-agreement algorithms like OpenSSL 3.5.0.
1ceda8 Arne 2025-05-01 16:21:48 39
d53700 novaflash 2025-06-03 21:13:42 40
Using a post-quantum key-agreement is also what currently (in 2025) people are talking about when they are talking about software that includes post-quantum crypto.
4b788e Arne 2025-05-01 16:30:12 41
52881b flichtenheld 2025-05-27 14:39:25 42
# Post-quantum signing/certificates
1ceda8 Arne 2025-05-01 16:21:48 43
33147a novaflash 2025-06-11 13:46:58 44
Asymmetric algorithms are used in two major use cases in OpenVPN - verification of identity using certificates, and in the key-agreement for encryption. It is much more critical to focus on the post-quantum key-agreement now. Especially for a TLS/VPN connection where verification of certificates is only needed during the connection itself, and being able to verify signatures and identity later is at least currently of lesser concern. So at least at the moment, the urgency here is not as big as for the key-agreement.
1ceda8 Arne 2025-05-01 16:21:48 45
52881b flichtenheld 2025-05-27 14:39:25 46
But creating certificates with post-quantum algorithms is also possible. E.g. creating a self-signed certificate that is usable with
47
`--peer-fingerprint` using the ML-DSA-65 algorith can be created using OpenSSL (3.5.0 or later):
1ceda8 Arne 2025-05-01 16:21:48 48
49
openssl req -x509 -newkey ML-DSA-65 -keyout styx-mldsa-65.key -out styx-mldsa-65.key -nodes -sha256 -days 3650 -subj '/CN=styx-mldsa-65'