The quantum-enabled hybrid key rotator for WireGuard tunnels.
Project description
wg-Qrotator is the quantum-enabled hybrid key rotator for WireGuard IP tunnels.
Check the documentation for more in-depth information about the solution.
How to setup and run
Before starting
wg-Qrotator, the peers must be already connected through WireGuard.
First, install the main dependencies:
sudo apt install python3 python3-pip libexplain-dev build-essential automake autoconf libtool pkg-config git
Then, from the root directory of the repository, install wg-Qrotator:
pip install .
Next, create a yaml configuration file that includes information about the WireGuard network interface, the KMS and the peers.
Example of a configuration file:
interface: wg0 # WireGuard interface to manage
kms:
uri: "https://127.0.0.1:8443/api/v1/keys" # KMS URI
certificate: private/certs/sae_001.crt # SAE certificate
root_certificate: private/certs/root.crt # Root CA certificate
secret_key: private/certs/sae_001.key # SAE secret key
sae: sae_001 # SAE ID
interface: 14 # KMS interface (4 for ETSI QKD 004, 14 for ETSI QKD 014)
# Port where the rotator will be exposed to its peers on the specified WireGuard's interface
port: 2345
# Information about the peers
peers:
- 9OmSKzF5QHD5mckhBHyoN2uPPRGJNDYOl15+DKbtV1M=: # ID (public key) of the peer
ip: 10.0.0.2 # IP of the peer
port: 2347 # Port of the peer rotator
sae: sae_002 # SAE of the peer in the KMS
mode: client # Mode (client/server)
extra_handshakes: # PQ extra handshakes
- ML_KEM_512: # KEM to use in PQ-KE
secret_key: private/private_alice.key # Private key location
public_key: private/public_bob.key # Peer public key location
- 12mSKzF5QHd57ckhBHyoN2uPPRGJNDYOl15+dfbt19L=: # Another peer
ip: 10.0.0.3
port: 3456
sae: sae_003
timer: 15
mode: server
Note that each entity that participates must be registered in the KMS and the certificate and keys must be set up for the requests to be made. Also, make sure that the IPs that are being used are the ones that point to WireGuard's interface, this way all the communications will go through the already established secure tunnel.
The mode tells the role for this rotator when interacting with a given peer. The client is the initiator, and the server will only act upon the client's request. Note that the indicated mode is the one used by the entity that uses this configuration file, for the other peer it shall be the opposite.
Start the rotator on each peer by running:
wg-qrotator up <config.yaml>
Note that sudo privileges might be needed in order to monitor and update WireGuards PSKs.
A log file is stored in the default logs directory (e.g. /var/log/ for Linux) under the name wg_qrotator_<wg_interface>.log.
Key combination
There is the possibility to add key exchanges, broadly considered as handshakes, and use their respective resulting keys in the key combination process. The final pre-shared key will be the OTP of the key given by the KMS and all the other keys extracted from extra key exchanges.
To activate extra key exchanges just add the field extra_handshakes for a given peer and enumerate the name of the exchanges and the private and public keys to be used. For example:
...
peers:
- 9OmSKzF5QHD5mckhBHyoN2uPPRGJNDYOl15+DKbtV1M=:
...
extra_handshakes:
- ML_KEM_512:
secret_key: private/mlkem_private_alice.key
public_key: private/mlkem_public_bob.key
- ...
The following key exchanges are supported:
ML_KEM_512ML_KEM_768ML_KEM_1024
License
© 2025, IT - Instituto de Telecomunicações
This project is licensed under the GNU Affero General Public License v3.0.
Acknowledgements
This project was supported by:
- the members of the NATO STO IST-218 RTG with title “Multi-Domain Quantum Key Distribution (QKD) for Military Usage”;
- the NATO Emerging Security Challenges Division through the Science for Peace and Security (SPS) programme under the project QSCAN reference: G6158-MYP;
- the European Union’s Horizon Europe research and innovation programme under the project "Quantum Secure Networks Partnership" (QSNP, grant agreement No 101114043).
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 wg_qrotator-0.1.2.tar.gz.
File metadata
- Download URL: wg_qrotator-0.1.2.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
770890fec5478b85ded371ecfd6f81d9f81dfa62ec293e8a276f96c4e923725b
|
|
| MD5 |
17d63e2c275ca050c983d912a0cba812
|
|
| BLAKE2b-256 |
4f94411ae7f528da37547484ef7945ba9e2ecc0e03578e9851377d484f516ea3
|
Provenance
The following attestation bundles were made for wg_qrotator-0.1.2.tar.gz:
Publisher:
python-publish.yml on Quantum-Communication-Group/wg-Qrotator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wg_qrotator-0.1.2.tar.gz -
Subject digest:
770890fec5478b85ded371ecfd6f81d9f81dfa62ec293e8a276f96c4e923725b - Sigstore transparency entry: 692448461
- Sigstore integration time:
-
Permalink:
Quantum-Communication-Group/wg-Qrotator@fb72f13267cd9d1faf2e6d997fe9e1db159bfe34 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Quantum-Communication-Group
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fb72f13267cd9d1faf2e6d997fe9e1db159bfe34 -
Trigger Event:
release
-
Statement type:
File details
Details for the file wg_qrotator-0.1.2-py3-none-any.whl.
File metadata
- Download URL: wg_qrotator-0.1.2-py3-none-any.whl
- Upload date:
- Size: 51.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a49de591832897209566d947af7f18b6919c4b9c6b9a635f406017a30e019648
|
|
| MD5 |
a49e7cc5b45308d14405bc569f4a7d1e
|
|
| BLAKE2b-256 |
4ce9f79f0824687e7769614219d2b260b798283636769ecea3c86311a0eaef38
|
Provenance
The following attestation bundles were made for wg_qrotator-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on Quantum-Communication-Group/wg-Qrotator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wg_qrotator-0.1.2-py3-none-any.whl -
Subject digest:
a49de591832897209566d947af7f18b6919c4b9c6b9a635f406017a30e019648 - Sigstore transparency entry: 692448470
- Sigstore integration time:
-
Permalink:
Quantum-Communication-Group/wg-Qrotator@fb72f13267cd9d1faf2e6d997fe9e1db159bfe34 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Quantum-Communication-Group
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fb72f13267cd9d1faf2e6d997fe9e1db159bfe34 -
Trigger Event:
release
-
Statement type: