Text Blob and Object Dumper
Project description
openvpn_generator
Python-native deterministic generator for OpenVPN TLS Crypt v2 Keys.
In some experiments I've been doing, I have a need to generate an OpenVPN Server/Client key independent of the OpenVPN binary. This code attempts to generate keys that will match and work, and generate the same keys if given the same seeds.
Not guaranteed to be secure for any production use-case, actually work, or to be kept current as OpenVPN makes changes. Just releasing the code in case anyone else is interested.
Quick start
$ ./gen_ovpn_keys.py --server-seed 'test123' --client-seed 'test123'
Generating TLS-crypt-v2 keys...
Server key written to: tls-crypt-v2-server.key
Client key written to: tls-crypt-v2-client.key
Keys generated successfully!
To use these keys with OpenVPN:
Server config: tls-crypt-v2 tls-crypt-v2-server.key
Client config: tls-crypt-v2 tls-crypt-v2-client.key
$
Usage
$ ./gen_ovpn_keys.py --server-seed 'test123' --client-seed 'test123' -h
usage: gen_ovpn_keys.py [-h] --server-seed SERVER_SEED --client-seed CLIENT_SEED [--server-output SERVER_OUTPUT] [--client-output CLIENT_OUTPUT] [--metadata METADATA] [--test] [--json]
Generate deterministic OpenVPN TLS-crypt-v2 keys from seed data
options:
-h, --help show this help message and exit
--server-seed SERVER_SEED
Seed data for server key (hex string or text)
--client-seed CLIENT_SEED
Seed data for client key (hex string or text)
--server-output SERVER_OUTPUT
Output file for server key (default: tls-crypt-v2-server.key)
--client-output CLIENT_OUTPUT
Output file for client key (default: tls-crypt-v2-client.key)
--metadata METADATA Custom metadata to include in client key (hex string)
--test Test generated keys with OpenVPN (requires openvpn binary)
--json Output keys as JSON to stdout instead of writing to files
$
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ovpn_tls_crypt_v2_generator-1.0.1.tar.gz.
File metadata
- Download URL: ovpn_tls_crypt_v2_generator-1.0.1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
826b3c1e5ce3a890a973ed7f6aa9894b348ffd0a3746fa60776ba971b5bc8877
|
|
| MD5 |
29e00156d8dbfd301d5976cca05d09f2
|
|
| BLAKE2b-256 |
cd36fc98bf6570cd164c8e89c5ab90cc3c2bce06c67e2e656598bc1752e73281
|
File details
Details for the file ovpn_tls_crypt_v2_generator-1.0.1-py3-none-any.whl.
File metadata
- Download URL: ovpn_tls_crypt_v2_generator-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3b2d2362988bd992e9d65c309b0096853bf6874d83fd5617a8feed37ec1dd68
|
|
| MD5 |
96a67c71027a03070710c97e8c58928a
|
|
| BLAKE2b-256 |
f8c5ed9e64f163a47bd05886f01cba152acd26ec106f21e17e565f676e610786
|