Skip to content

v1.0.0 — initial release

Choose a tag to compare

@gmpassos gmpassos released this 27 Oct 06:33
e8cd2d7

Initial release of post_quantum_crypto: high-level post-quantum cryptography (PQC) in pure Dart. It runs on the Dart VM, Flutter, dart2js and dart2wasm.

⚠️ No independent cryptographic review has been performed. Algorithms are checked against official test vectors and against OpenSSL, but the design has not been audited. Read doc/SECURITY.md before relying on it.

Highlights

  • Envelope encryption:
    • ML-KEM-512/768/1024 (FIPS 203) and X-Wing recipients.
    • Each recipient's data key is wrapped with HPKE (RFC 9180, HKDF-SHA-384), and the payload is AES-256-GCM or ChaCha20-Poly1305.
    • One or many recipients, authenticated context, and rewrapping under a fresh data key.
  • Streaming and files:
    • A STREAM construction that detects reordering, duplication, truncation and appended data.
    • Bounded memory, with progress and cancellation.
    • decryptFile publishes its output only after the whole file has verified.
  • Signatures:
    • ML-DSA-44/65/87 (FIPS 204) and SLH-DSA-SHAKE (FIPS 205), with context strings.
    • Detached signatures, signed artifacts, signed manifests, and TrustStore.
  • Hybrid key establishment: X-Wing with transcript binding and downgrade rejection. It is unauthenticated; it is not TLS or an authenticated key exchange.
  • Keys:
    • Seed-form keys, fingerprints and lifecycle metadata.
    • SPKI/PKCS#8, interoperable with OpenSSL 3.5+.
    • Argon2id-protected exports.
    • KeyStore with rotation, revocation and encrypted backup.
  • Policy: SecurityPolicy covers allowed and minimum algorithms, hybrid-only mode, resource limits, and key expiry, revocation and usage.
  • Swappable backend: pqcrypto, package:cryptography and PointyCastle each sit behind package-owned interfaces.

Entry points: PostQuantumCryptoEngine (configurable) and PostQuantumCrypto (static defaults). File helpers are in package:post_quantum_crypto/post_quantum_crypto_io.dart.

Verification

  • Official vectors:
    • NIST ACVP for ML-KEM, ML-DSA and SLH-DSA.
    • The X-Wing and HPKE-PQ drafts.
    • Wycheproof (AES-GCM, ChaCha20-Poly1305, HKDF, HMAC, X25519).
    • RFC 9106 (Argon2id).
  • OpenSSL interoperability: both directions for ML-KEM, ML-DSA and SLH-DSA.
  • CI: Linux, macOS and Windows on the VM; Chrome with dart2js and dart2wasm, with byte-identical output across platforms; parser fuzzing.
  • Published format vectors: test/vectors/post_quantum_crypto_v1.json.

Limitations

  • No constant-time or side-channel-resistance claims on any platform. Zeroization is best-effort.
  • Flutter mobile is not CI-tested separately; it is the same pure-Dart code as the VM.
  • SLH-DSA key generation uses pqcrypto's own Random.secure().
  • Argon2id is slow on web targets.

See CHANGELOG.md, doc/FORMATS.md and doc/BENCHMARKS.md.