Zero-dependency post-quantum HTTPS server, reverse proxy, X.509v3 PKI toolkit, multi-family signature layer, application-layer hybrid encryption envelope, and live TLS 1.3 auditor built directly on Node.js (>=24.7.0) and OpenSSL 3.5+.
Every cryptographic operation uses established OpenSSL 3.5+ implementations of NIST-standardised algorithms rather than custom primitives.
Relying on a single mathematical assumption creates a single point of failure. postquantum-https combines distinct hardness families across transport, certificates, and payload layers:
| Layer | Algorithms | Mathematical Family | Purpose |
|---|---|---|---|
| TLS 1.3 key exchange | X25519MLKEM768, SecP256r1MLKEM768, SecP384r1MLKEM1024, MLKEM1024, MLKEM768 |
Module-Lattice (FIPS 203) + Elliptic Curve (ECDHE) | Defends against harvest-now, decrypt-later attacks while preserving classical security if lattices fail |
| TLS 1.3 leaf and CA certificates | ML-DSA-44, ML-DSA-65, ML-DSA-87, ECDSA P-256/P-384, Ed25519 |
Module-Lattice (FIPS 204) and Elliptic Curve | Full PQC TLS/mTLS for private PKI, or browser-compatible ECDSA/Ed25519 certs with hybrid PQC key exchange |
| Trust anchors and HTTP attestation | ML-DSA + SLH-DSA (SHA-2 / SHAKE) + Ed25519 |
Lattice (FIPS 204) + Stateless Hash-Based (FIPS 205) + Elliptic Curve | Detached HTTP response attestation and certificate cross-signing independent of lattice assumptions |
| Symmetric transport and envelopes | AES-256-GCM, ChaCha20-Poly1305, HKDF-SHA-512, SHA-384 |
Symmetric AEAD and Hash Functions | 256-bit keys and 384/512-bit hashes to retain 128-bit+ security margin under Grover search |
| End-to-end payload envelope | X25519 + ML-KEM-1024 + HKDF-SHA-512 + AES-256-GCM |
Elliptic Curve + Module-Lattice + Symmetric AEAD | Application-layer encryption that stays confidential even across classical intermediaries |
Client / Browser
|
| TLS 1.3 (X25519MLKEM768 / SecP384r1MLKEM1024 / MLKEM1024)
| Cipher: TLS_AES_256_GCM_SHA384 or TLS_CHACHA20_POLY1305_SHA256
| Server Cert: ECDSA (browser mode) or ML-DSA-65 / ML-DSA-87 (PQC PKI)
v
postquantum-https (Server or Reverse Proxy)
|-- /.well-known/pqc-keys.json Public attestation ring & SLH-DSA hash anchor
|-- PQC-Attestation header Multi-family signature (ML-DSA + SLH-DSA + Ed25519)
|-- X-PQC-Profile / X-PQC-Enforced Transport telemetry headers
v
Upstream HTTP / WebSocket Application
- Node.js
24.7.0or newer linked against OpenSSL3.5.0or newer (tested on Node26.8.1with OpenSSL3.5.7). - No external npm dependencies.
Check your runtime capabilities immediately:
npx postquantum-https infonpx postquantum-https audit https://cloudflare.comExample output:
Target: cloudflare.com:443 (SNI: cloudflare.com)
Grade: A
PQC Ready: YES
Hybrid PQC: X25519MLKEM768
Pure PQC: none
Classical TLS13: X25519
Cipher: TLS_AES_256_GCM_SHA384
Cert Key Type: ec
Cert Subject: CN=cloudflare.com
Use --json for CI pipelines. The command exits with status code 2 when an endpoint does not negotiate any post-quantum TLS 1.3 group.
npx postquantum-https proxy \
--target http://127.0.0.1:3000 \
--listen 0.0.0.0:8443 \
--profile browser-hybrid \
--attestPass --cert /path/to/fullchain.pem --key /path/to/privkey.pem to use your existing CA-issued certificate. When omitted, postquantum-https generates an ephemeral PKI for local development and testing.
npx postquantum-https certgen --host app.internal --san api.internal,127.0.0.1 --mode dual --client --out ./certsThis creates:
pqc-ca.crt/pqc-ca.key(ML-DSA-87root CA)pqc-server.crt/pqc-server-chain.crt/pqc-server.key(ML-DSA-65server leaf)pqc-client.crt/pqc-client.key(ML-DSA-65mTLS client leaf)pqc-hash-anchor.crt/pqc-hash-anchor-attestation.json(SLH-DSA-SHA2-128fstateless hash-based cross-attestation)browser-ca.crt/browser-server-chain.crt/browser-server.key(ECDSA P-384 / P-256chain for standard browser trust alongsideX25519MLKEM768hybrid key exchange)
Private key files are written with mode 0600.
npx postquantum-https config nginx --domain example.com --upstream http://127.0.0.1:3000 --profile browser-hybrid
npx postquantum-https config caddy --domain example.com --upstream 127.0.0.1:3000
npx postquantum-https config haproxy --domain example.com --upstream 127.0.0.1:3000 --profile cnsa-2docker build -t postquantum-https .
docker run --rm -p 8443:8443 postquantum-https proxy \
--target http://host.docker.internal:3000 \
--listen 0.0.0.0:8443 \
--profile browser-hybrid| Profile | TLS 1.3 Groups | Classical Fallback | Default Cert Algorithm | Symmetric Ciphers |
|---|---|---|---|---|
browser-hybrid |
X25519MLKEM768:SecP256r1MLKEM768:SecP384r1MLKEM1024:X25519:P-256 |
Allowed | ecdsa-p256 |
AES-256-GCM, ChaCha20, AES-128-GCM |
hybrid-strict |
X25519MLKEM768:SecP384r1MLKEM1024:SecP256r1MLKEM768 |
Rejected at TLS handshake | ml-dsa-65 |
AES-256-GCM, ChaCha20 |
cnsa-2 |
SecP384r1MLKEM1024:MLKEM1024 |
Rejected at TLS handshake | ml-dsa-87 |
AES-256-GCM, ChaCha20 |
lattice-only |
MLKEM1024:MLKEM768 |
Rejected at TLS handshake | ml-dsa-65 |
AES-256-GCM, ChaCha20 |
Install as a package or import directly from src/index.mjs:
npm install postquantum-httpsimport { createPqcServer, pqcRequest } from 'postquantum-https';
const server = createPqcServer(
{
profile: 'hybrid-strict',
certAlgorithm: 'ml-dsa-65',
attestResponses: true
},
(req, res) => {
res.setHeader('Content-Type', 'application/json; charset=utf-8');
res.end(JSON.stringify({ ok: true, profile: req.pqc.enforcedGroups }));
}
);
server.listen(8443, '127.0.0.1', async () => {
const response = await pqcRequest('https://127.0.0.1:8443/', {
profile: 'hybrid-strict',
ca: server.pqcPki.ca.certPem,
servername: 'localhost',
attestationPublicKeyRing: server.pqcPublicAttestationRing
});
console.log(response.tls);
console.log(response.attestation.verifiedFamilies);
});import {
exportPublicKeyRing,
generateAttestationKeyRing,
signMultiAlgorithm,
verifyMultiAlgorithm
} from 'postquantum-https';
const ring = generateAttestationKeyRing(['ml-dsa-65', 'slh-dsa-sha2-128f', 'ed25519']);
const publicRing = exportPublicKeyRing(ring);
const payload = Buffer.from('release-manifest-v1', 'utf8');
const bundle = signMultiAlgorithm(payload, ring, { context: 'release' });
// Require every configured algorithm to pass:
const strict = verifyMultiAlgorithm(payload, bundle, publicRing, { policy: 'all' });
// Or require a quorum of distinct mathematical families (e.g. 2 of 3):
const quorum = verifyMultiAlgorithm(payload, bundle, publicRing, { policy: 'quorum', minFamilies: 2 });import {
generateHybridRecipientKeys,
openHybridEnvelope,
sealHybridEnvelope
} from 'postquantum-https';
const recipient = generateHybridRecipientKeys('ml-kem-1024');
const envelope = sealHybridEnvelope('confidential payload', recipient.publicBundle, {
aad: 'tenant=alpha'
});
const { plaintext } = openHybridEnvelope(envelope, recipient.privateBundle);Measured with node ./bin/postquantum-https.mjs bench on linux/x64, Node v26.8.1, OpenSSL 3.5.7:
| Operation | Average Latency | Throughput |
|---|---|---|
ML-KEM-768 encapsulate + decapsulate |
0.056 ms |
18,007 ops/s |
ML-KEM-1024 encapsulate + decapsulate |
0.084 ms |
11,848 ops/s |
ML-DSA-65 sign (4 KiB) |
0.717 ms |
1,395 ops/s |
ML-DSA-65 verify (4 KiB) |
0.130 ms |
7,714 ops/s |
ML-DSA-87 sign (4 KiB) |
0.774 ms |
1,292 ops/s |
SLH-DSA-SHA2-128f sign (4 KiB) |
10.467 ms |
95.5 ops/s |
SLH-DSA-SHA2-128f verify (4 KiB) |
0.627 ms |
1,596 ops/s |
Multi-family sign (ML-DSA-65 + SLH-DSA + Ed25519) |
11.188 ms |
89.4 ops/s |
Multi-family verify (ML-DSA-65 + SLH-DSA + Ed25519) |
0.846 ms |
1,182 ops/s |
Hybrid envelope seal (X25519 + ML-KEM-1024 + AES-256-GCM) |
0.290 ms |
3,447 ops/s |
Hybrid envelope open (X25519 + ML-KEM-1024 + AES-256-GCM) |
0.332 ms |
3,008 ops/s |
Live TLS 1.3 HTTPS (X25519MLKEM768 + ML-DSA-65 cert) |
3.755 ms |
266.3 ops/s |
Live TLS 1.3 HTTPS (SecP384r1MLKEM1024 + ML-DSA-87 cert) |
6.071 ms |
164.7 ops/s |
Run npm run bench to measure on your own hardware.
- Public browser WebPKI: Public browsers (Chrome, Firefox, Edge, Safari) already negotiate
X25519MLKEM768hybrid post-quantum TLS 1.3 key exchange, which protects traffic confidentiality today. Browser root stores still require classical CA-issued certificates (ECDSAorRSA). For public websites, use thebrowser-hybridprofile with your CA-issued ECDSA certificate; useML-DSAcertificates for internal PKI, service meshes, mTLS, and custom-CA clients. - SLH-DSA in TLS 1.3 handshakes: OpenSSL 3.5+ supports
SLH-DSAkey generation, signing, verification, and X.509 certificate verification, but does not assign a TLS 1.3 leaf handshakeSignatureSchemeforSLH-DSA.postquantum-httpsusesSLH-DSAfor independent hash-based root trust anchors, cross-attestation records, and detached HTTP response / envelope signatures. - HTTP header size for multi-family attestation:
SLH-DSA-SHA2-128fsignatures are 17,088 bytes raw (~22.8 KB base64url).postquantum-httpssetsmaxHeaderSizeto 128 KiB on its own server and client, and uses single-pass header encoding. If placing another proxy in front of an attesting server, configure its maximum header size accordingly or selectslh-dsa-sha2-128s(7,856 bytes raw).
npm testMIT. See LICENSE.