This is a (work in progress) DDS security plugin C/C++ library integrating Post-Quantum Cryptography (PQC) algorithms trough Open Quantum Safe's liboqs library and oqs-provider.
It follows the DDS Security specification (v1.1) and it has been designed to be compatible with the following DDS implementations:
The dinamical loading of external plugins is well documented in Cyclone DDS. See External Plugin Development here.
Preliminary ideas and results of this project were presented at the IX Jornadas Nacionales de Investigación en Ciberseguridad held from 27-29th May in Sevilla, Spain. The conference paper
- PQSec-DDS: Integrating Post-Quantum Cryptography into DDS Security for Robotic Applications by F. J. Blanco-Romero, V. Lorenzo, F. Almenares, D. Dı́az-Sánchez and A. Serrano Navarro
was presented on 29th May. You can find the paper at pages 396-403 of the proceedings Actas de las IX Jornadas Nacionales de Investigación en Ciberseguridad.
This project includes contributions from Adrián Serrano Navarro's master's thesis Integrating post quantum criptography on a publisher-consumer communication over CycloneDDS, with the integration of the Kyber768 KEM and Dilithium3 signature via liboqs.
The code of this project has been developed by
-
v0.0.1 (Experimental): Initial implementation using liboqs directly for post-quantum cryptographic operations.
-
Current (v0.1.0+): Migrated to OpenSSL-based implementation using the oqs-provider, providing better integration with standard OpenSSL workflows and improved compatibility.
- Minimum: OpenSSL 3.0
- Latest: OpenSSL 3.5+ includes native ML-KEM and ML-DSA support
PQSec-DDS inherits the same OpenSSL version requirements and behaviors as the oqs-provider:
- OpenSSL 3.0+ with development headers
- liboqs 0.13.0+ (built automatically by oqs-provider)
- Eclipse CycloneDDS (built by provided scripts)
Note: When using OpenSSL 3.5+, some algorithms will automatically use OpenSSL's native implementations instead of oqs-provider.
The easiest way to build PQSec-DDS is using the provided build scripts:
# 1. Build OQS (OpenSSL with Post-Quantum support)
./scripts/build_oqs.sh
# 2. Build CycloneDDS
./scripts/build_cyclonedds.sh
# 3. Build the PQSec-DDS plugin
./scripts/build_plugin.sh
# 4. Set up environment and test
source setup_env.shThis script builds OpenSSL 3.x with OQS provider for post-quantum cryptography support. bash
./scripts/build_oqs.sh [OPTIONS]Options:
-p DIR- Installation directory (default: /opt/oqs_openssl3)-d0|1 - Debug mode (default: 0)-oVERSION - OpenSSL version (default: openssl-3.5.0)-lVERSION - liboqs version (default: 0.13.0)-qVERSION - OQS provider version (default: 0.9.0)-jJOBS - Parallel build jobs (default: $(nproc))-f- Force clean rebuild-h- Show help
This script builds Eclipse CycloneDDS with examples and testing enabled.
./scripts/build_cyclonedds.sh [OPTIONS]Options:
-pDIR` - Installation directory (default: ./cyclonedds_install)-vVERSION - CycloneDDS version (default: 0.10.5)-tTYPE - Build type: Debug|Release (default: Debug)-jJOBS - Parallel build jobs (default: $(nproc))-f- Force clean rebuild-h- Show help
This script builds the PQSec-DDS authentication plugin with configurable cryptographic algorithms.
./scripts/build_plugin.sh [OPTIONS]Options:
-cDIR - CycloneDDS path (default: ./cyclonedds_install)-lDIR - liboqs path (default: /opt/oqs_openssl3/.local)-oDIR - OQS provider path (default: /opt/oqs_openssl3)-tTYPE - Build type: Debug|Release (default: Debug)-jJOBS - Parallel build jobs (default: $(nproc))--pq- Enable PQ crypto (default)--no-pq- Disable PQ crypto (use traditional DH)--kemALGORITHM - Select KEM algorithm (see below)--debug-levelLEVEL - Set debug level (NONE|ERROR|WARN|INFO|TRACE|DATA)-f- Force clean rebuild-h- Show help
Classical (traditional):
ecdh_p256- ECDH P-256 (default for --no-pq)dh_2048- Diffie-Hellman 2048-bit
Post-Quantum (ML-KEM):
mlkem512- ML-KEM-512 (128-bit security)mlkem768- ML-KEM-768 (192-bit security, recommended default)mlkem1024- ML-KEM-1024 (256-bit security)
Hybrid:
X25519MLKEM768- X25519 + ML-KEM-768p256_mlkem768- P-256 + ML-KEM-768
NONE- No debug outputERROR- Error messages onlyWARN- Warnings and errorsINFO- General information + above (default)TRACE- Detailed tracing + aboveDATA- Data dumps and hex output + above
Generate DDS security certificates for testing:
cd certs
./generate_certs.shThis script generates a set of certificates for different algorithms and levels of security, including:
- ML-DSA: mldsa44 (Level 2), mldsa65 (Level 3), mldsa87 (Level 5)
- Falcon: falcon512 (Level 1), falcon1024 (Level 5)
- Traditional: RSA 2048, ECDSA P-256 for comparison
- Organized in folders:
mldsa/,falcon/,rsa/,traditional/
Each certificate set includes CA certificates, entity certificates, and private keys required for DDS security authentication.
Three CycloneDDS XML configuration files are available in config/cyclonedds/:
custom_auth_plugin.xml- PQSec-DDS plugin with traditional ECDSA certificatescustom_auth_plugin_mldsa44.xml- PQSec-DDS plugin with post-quantum ML-DSA44 certificates (default)test_auth_config.xml- Built-in CycloneDDS authentication for baseline testing
Set the configuration, for example, for the post-quantum ML-DSA44 plugin, you can use:
export CYCLONEDDS_URI=./config/cyclonedds/custom_auth_plugin_mldsa44.xmlYou can use the provided environment setup script to configure all necessary environment variables:
source setup_env.shThis script automatically:
- Sets up OQS provider environment (uses
/opt/oqs_openssl3- default frombuild_oqs_enhanced.sh) - Configures DDS library paths (uses
./cyclonedds_install- default frombuild_cyclonedds.sh) - Sets the plugin configuration (uses
./src/build/lib- default frombuild_plugin.sh) - Verifies all components are found
Note: The environment setup uses the default installation paths from the build scripts above. If you used custom paths with the -p, -c, -l, or -o options in the build scripts, you'll need to either modify setup_env.sh accordingly or use manual environment setup.
You can have a quick test running the test application with
source setup_env.sh
./bin/HelloworldSubscriberand
source setup_env.sh
./bin/HelloworldPublisherYou should see the debug messages from the custom plugin and the publisher/subscriber exchanging messages:
=== [Publisher] Writing : Message (1, Hello World)
and
=== [Subscriber] Received : Message (1, Hello World)
Contributions are welcome!