2026-12-04 21:07:03David Sommerseth:
Replaced --tls-auth with --tls-crypt/tls-crypt-v2
Pages/Getting started with OpenVPN.md ..
@@ 149,47 149,87 @@
**WARNING:** By default OpenVPN does currently use the Blowfish cipher, but that is now discouraged due to general issues with Blowfish, RC4, CAST5 and DES/3DES. If you need to use any of these weaker algorithms, do at least consider to add `--reneg-bytes 64000000` to your configuration. If your server version is >= 2.3.14 or 2.4.1 this will be done for you. For more information see [wiki:SWEET32].
-
To use the preferred AES algorithm with 256 bits encryption, add this line to both client and server configs:
+
To use the preferred AES-GCM algorithm with 256 bits encryption, add this line to both client and server configs:
```
-
cipher AES-256-CBC
+
cipher AES-256-GCM
```
-
For most initial VPN setups, starting with Blowfish provides a fairly good security level. But remember that once you decide to upgrade your ciphers, you need to modify all server and client configs to the same --cipher value.
-
-
You can do another step to strengthen the encryption layer. The temporary session key was already mentioned, which is used for encrypting the tunnelled network data. This key will rotate by default every hour. But you can also tweak how often it gets rotated by adjusting --reneg-sec, --reneg-pkts and --reneg-bytes. See the [OpenVPN man page](/Openvpn24ManPage) for more information about these options.
+
You can do another step to strengthen the encryption layer. The temporary session key was already mentioned, which is used for encrypting the tunnelled network data. This key will rotate by default every hour. But you can also tweak how often it gets rotated by adjusting --reneg-sec, --reneg-pkts and --reneg-bytes. See the [OpenVPN man page](https://build.openvpn.net/man/openvpn-2.7/openvpn.8.html) for more information about these options.
## Configuring authentication
There are several more authentication layers which can be added in OpenVPN on top of the basic one which certificates provides. The authentication layers in this section is purely optional. But it is advisable to add at least one or more of them.
-
### TLS Authentication
-
This is kind of like a crypto firewall. Each packet going over the Internet will be signed using a shared secret on both servers and clients. When OpenVPN receives a packet, it will calculate a signature and check it against the signature provided in the received packet. If it doesn't match, OpenVPN will drop the packet. When coupled with UDP, this can also be a good way to avoid troubles with port scanners; as it will not see the OpenVPN port at all. This feature is also a good way to protect yourself against unknown bugs in
-
the SSL library or protocol, as it reduces the attack surface to only your own users. Enabling TLS authentication is HIGHLY recommended.
+
### TLS Crypt
+
OpenVPN has supported `--tls-auth` many years, which added a kind of firewall against attacks when using the UDP protocol. It would also give some layer of protection when the VPN tunnel used the TCP protocol too. This enabled OpenVPN to be able to drop network packets coming from the Internet which wasn't signed correctly with a key provided to the `--tls-auth`.
+
+
This feature has been extended, with `--tls-crypt` and later on `--tls-crypt-v2`. Using one of these features, another layer of symmetric encryption is added on top of the encrypted OpenVPN. In these days where Post-Quantum encryption is a hot topic, this feature can add a good layer of protection to what is considered plausible attack vectors from systems capable of quantum computing. This is especially important if you are concerned encrypted OpenVPN traffic will be stored now, to be cracked open later on in the future. And this can add some post-quantum protection if your connecting devices are not capable of using any post-quantum algorithms.
-
To enable TLS authentication, first generate a static encryption key. This needs to be securely copied to all OpenVPN clients and servers.
+
There are two versions of TLS Crypt. For smaller setups where you trust all the users connecting to your VPN server, using the `--tls-crypt` alone gives you a reasonable protection. All users will here use a shared secret key. The risk is if this shared secret key is leaked. And a leaked shared key can be used to crack open already collected encrypted VPN traffic. The `--tls-crypt` shared secret key uses the exact same key format as `--tls-auth`.
+
+
If you have more users, you might want to consider using `--tls-crypt-v2`. And this is what will be described here.
+
+
First you need to generate a TLS Crypt v2 server key:
```
-
$ openvpn --genkey --secret myvpn.tlsauth
+
$ openvpn --genkey tls-crypt-v2-server server.tc2
```
-
In the configuration files, you need to add:
-
+
In the OpenVPN server configuration, add this line:
```
-
tls-auth myvpn.tlsauth KEYDIR
+
tls-crypt-v2 server.tc2
```
-
-
The KEYDIR must be 0 on one of the sides and 1 on the other. So if you choose the KEYDIR value of 0 for the server, all clients must be 1, and vice versa.
-
-
If you are using OpenVPN v2.4 or later, you can make this even a bit stronger by replacing `--tls-auth` with `--tls-crypt`. Using tls-crypt also don't need to care about the KEYDIR - that is handled automatically.
-
+
+
For each client you prepare a configuration profile for, you will need to create a unique tls-crypt-v2 client key as well.
If a client tries to connect to your server with `--tls-crypt-v2` enabled and that client tries to use a `tls-crypt-v2` client key
+
which is not generated with the same `tls-crypt-v2` key the server uses, the client will fail to connect. You could say that the
+
client keys are signed by the server key, and the server will recognise its signature when a client tries to connect.
+
### Username / password authentication
There exists many methods for adding username/password authentication. There exists plenty of plug-ins and scripts for PAM, LDAP, Radius and so on. There are also more advanced authentication and access controls available, such as
the eurephia project. We will not cover any of these setups here.