AegisPQC
Hybrid key exchange, signatures and encrypted sessions for C++20 and C. Classical ECDH and ML-KEM run side by side, so your channel stays safe even if one of them breaks. Read the docs
~1.0 ms mutual handshake
Traffic recorded today can be decrypted once quantum computers arrive. AegisPQC protects it now.
Classical ECDH and ML-KEM run side by side, peers authenticate with ML-DSA, and traffic moves over AES-256-GCM. If either the classical or the post-quantum half breaks, the channel stays safe. One build switch chooses between raw speed and a strict FIPS 140-3 mode, and every mode speaks the same bytes.
Why now
On December 2, 2026, Amazon, Anthropic, Apple, Cloudflare, Google, Meta, Microsoft, OpenAI and Oracle backed the U.S. call to move to NIST post-quantum standards as soon as possible.
An attacker doesn't need a quantum computer today. They store encrypted traffic now and decrypt it later. Health records, contracts, source code and credentials that must stay secret for a decade are already exposed if they travel over classical key exchange. That's why encryption has the earlier deadline.
- Every federal agency names a PQC migration lead
- Agencies review high-value system inventories and plan the migration
- High-value and high-impact systems on post-quantum key establishment
- The same systems on post-quantum digital signatures
- NIST disallows RSA, ECDH and ECDSA
Executive Order 14412, OMB M-26-15 and NIST IR 8547. National Security Systems follow CNSA 2.0, which calls for ML-KEM-1024 and ML-DSA-87: the AegisPQC Level 5 suite. Read the full transition brief.
Two locks, one key
A classical secret and a post-quantum secret are derived side by side, then fused into one.
SS_mlkem || SS_x25519 || eph_pk || peer_pkIf someone records the traffic and later breaks X25519 with Shor's algorithm, ML-KEM keeps it confidential. If ML-KEM suffers a mathematical breakthrough, X25519 still holds. Binding the classical public keys into the combiner matters because raw ECDH is not a CCA-secure KEM on its own.
Three messages
Both peers prove who they are, agree on keys and confirm them before a single record is sent.
-
Client hello
Alice generates a fresh hybrid KEM keypair for this handshake only and sends it with her identity.
ver | suite | client_random | kem_pk | alice_identity -
Server hello
Bob checks that Alice's identity is pinned, encapsulates to her key, signs the transcript with ML-DSA and derives the session keys.
ver | suite | server_random | ct | bob_identity | sig_bob | server_finished -
Client finished
Alice checks Bob's pin and signature, decapsulates, wipes her KEM secret key and signs the transcript back. Both sides are now established.
sig_alice | client_finished
What it guarantees
- Mutual ML-DSA authentication
- Pinned identities stop man-in-the-middle
- Forward secrecy per handshake
- Key confirmation with finished MACs
What it refuses
- Unpinned peers
- Any suite mismatch or downgrade
- Replayed, reordered or reflected records
- Malformed or oversized input
Security levels
Pick a NIST level. AegisPQC builds the full suite, never a weaker one.
| Level | Classical | Post-quantum KEM | Signature | Hash |
|---|---|---|---|---|
| Level 1 | X25519 or P-256 | ML-KEM-512 | ML-DSA-44 | SHA-256 |
| Level 3 | X25519 or P-256 | ML-KEM-768 | ML-DSA-65 | SHA-256 |
| Level 5 | X448 or P-384 | ML-KEM-1024 | ML-DSA-87 | SHA-384 |
Every suite uses AES-256-GCM for records. The X25519 / X448 family is fast and modern; the P-256 / P-384 family is FIPS approved and matches the pairs the IETF uses for TLS. Level 3 is the default, Level 5 meets CNSA 2.0, Level 1 suits constrained devices.
One switch, four builds
Choose the trade-off with AEGIS_PROFILE. The API above it doesn't change.
performance
OpenSSL 3.5+ for ML-KEM, ECDH, AES and HKDF, plus the formally verified mldsa-native for fast ML-DSA with AVX2 and NEON.
Default, productionfips
Everything runs inside the OpenSSL FIPS provider (FIPS 140-3, cert #5586) with P-256 / P-384. Refuses to run outside the provider.
Federal contractors, regulated deploymentsopenssl
OpenSSL only, nothing else in the trust base.
Minimal dependenciesliboqs
Open Quantum Safe backend for experiments and interop testing.
Research onlyAll four speak identical FIPS 203 / 204 bytes, so a FIPS server and a performance-mode device talk to each other.
Fast enough to forget about
| Profile | Level 1 | Level 3 | Level 5 | ML-DSA-65 sign |
|---|---|---|---|---|
| performance | ~0.75 ms | ~1.0 ms | ~2.3 ms | ~105 µs |
| openssl | ~2.9 ms | ~4.4 ms | ~6.6 ms | ~930 µs |
| fips | ~4.9 ms | ~9 ms | ~14 ms | ~1.75 ms |
One cloud vCPU, OpenSSL 3.6.5. Run aegis_bench for your own numbers.
Attacked, then fixed
Every one of these was demonstrated with a working attack against v0.1. Each now has a regression test that must fail closed.
| Attack | Severity | Fix |
|---|---|---|
| Man-in-the-middle with a self-signed identity | Critical | Pinned trust store, transcript signatures |
| Out-of-bounds read on short ciphertext | Critical | Exact length checks, bounds-checked parser |
| Silent downgrade of Level 5 to Level 3 | High | A real suite per level, suite ID on the wire |
| Record replay and reflection | High | Per-direction keys, authenticated sequence numbers |
| Low-order X25519 point | Medium | Every OpenSSL return checked, X-Wing combiner |
| Invalid P-256 / P-384 points | Medium | Full public key validation before derive |
Tested under ASan and UBSan in every profile and fuzzed with libFuzzer across the network parsers.
Where it fits
For the web, turn on hybrid TLS 1.3. AegisPQC is for the channels TLS doesn't reach.
Use AegisPQC for
- Device-to-device, IoT and embedded links over serial, radio, BLE or raw sockets
- Internal message buses where brokers terminate TLS
- App-level end-to-end encryption between known endpoints
- Long-lived pinned links: branch to HQ, sensor to collector
- Seeding other protocols with
export_keying_material()
Use something else for
- Ordinary HTTPS: use TLS 1.3 with
X25519MLKEM768 - Anything that needs an independent audit today
Get started
You need a C++20 compiler, CMake 3.20+ and OpenSSL 3.5+. That's the only external dependency.
git clone https://github.com/PicasoTheDeal/AeigisPQC.git
cd AeigisPQC
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
./build/aegis_demo
./build/aegis_tests
#include "aegis/aegis_session.hpp"
using namespace aegis::session;
aegis_session alice(role::initiator, aegis::security_level::nist_level_3);
aegis_session bob(role::responder, aegis::security_level::nist_level_3);
alice.initialize_identity();
bob.initialize_identity();
alice.trust_peer_identity(bob_identity_pubkey); // pinned out of band
bob.trust_peer_identity(alice_identity_pubkey);
auto client_hello = alice.create_client_hello();
auto server_hello = bob.process_client_hello(client_hello);
auto client_finished = alice.process_server_hello(server_hello);
bob.process_client_finished(client_finished);
auto record = alice.encrypt_record(plaintext, aad);
auto pt = bob.decrypt_record(record, aad);
A stable C interface ships alongside it for C, Rust, Go, Python, Swift and anything else with an FFI. See the C-ABI example.
Status
Version 0.4.0. Every issue from the v0.1 review is closed, and the code is sanitizer-tested and fuzzed.
It has not had an independent audit or formal verification yet. Get one before any regulated or production deployment. A FIPS 140-3 certificate covers OpenSSL's provider, not the AegisPQC protocol.
Next
- Session resumption
- Rekeying in place
- Identity hints, alert frames
- TCP, WebSocket and QUIC adapters
Later
- Suite negotiation, PQ certificates
- SLH-DSA, HQC, FN-DSA
- Rust, Go, Python and Swift bindings
- aegis-scan crypto inventory and CBOM