Skip to content

Hybrid PQC + Classical Mode

By default, @brivora/crypto operates in hybrid mode — every operation uses both classical and post-quantum algorithms simultaneously.

  • Classical algorithms (Ed25519, X25519) are battle-tested and well-understood
  • PQC algorithms (ML-DSA, ML-KEM) are newer and still being studied
  • Hybrid mode means security is maintained as long as EITHER algorithm remains secure
  • Provides backward compatibility during the PQC transition
  • Applications with no classical dependencies
  • Maximum quantum resistance without classical overhead
  • Systems that will operate beyond the expected lifetime of classical cryptography
// Hybrid (default) -- both classical + PQC
const signed = await crypto.sign(data, key.privateKey);
// PQC-only -- ML-DSA-65 only
const signed = await crypto.sign(data, key.privateKey, { hybrid: false });
OperationClassicalPost-QuantumHybrid
SigningEd25519ML-DSA-65Both signatures generated
EncryptionX25519 + AES-256-GCMML-KEM-768 + AES-256-GCMShared secret from both
Key exchangeX25519ML-KEM-768Combined shared secret

In hybrid mode, the shared secret for encryption is derived from both the classical and PQC key exchanges using HKDF. Both must be compromised for the encryption to break.