-
Notifications
You must be signed in to change notification settings - Fork 3
Design Philosophy
The architecture of pqcrypto is deliberately constrained. By reducing our dependency tree to zero and adhering strictly to FIPS specifications, we ensure maximum security and portability.
Post-Quantum Cryptography is foundational. If a cryptographic library relies on dozens of external packages, any one of those packages becomes a supply chain vulnerability.
We explicitly vendor standard primitives (like FIPS 202 Keccak/SHA-3 and FIPS 180-4 SHA-2) directly into the src/common/ directory.
- No
ffibindings to fragile C-libraries. - No relying on third-party hashing wrappers.
- The only import required is the standard Dart SDK (
dart:typed_data,dart:math).
Because we do not use native bindings (dart:ffi), pqcrypto is inherently cross-platform. It runs perfectly on:
- iOS & Android (via Flutter)
- Windows, macOS, Linux (Dart VM)
- Web Browsers (
dart2jsanddart2wasm)
We do not invent cryptography; we translate it. We treat the NIST Known Answer Tests (KATs) as absolute mathematical truth. Every algorithm in this library is tested against the thousands of official vectors generated by NIST. If a single byte in a 3,000-byte signature differs from the spec, the build fails.
Cryptography APIs are notoriously easy to misuse. We design the public API to prevent footguns:
-
ML-DSA is hedged by default: Deterministic signatures are vulnerable to fault attacks. Our
signmethod injects fresh entropy (hedging) automatically, as recommended by FIPS 204. - Strict Validation: All keys and ciphertexts are validated for structural integrity and mathematical boundaries before they are processed.
-
Zeroization: Sensitive intermediate buffers in KEM and DSA are explicitly scrubbed in
finallyblocks to limit memory exposure.
pqcrypto — pure Dart, zero-dependency post-quantum cryptography (ML-KEM FIPS 203 · ML-DSA FIPS 204) for Dart, Flutter, and the web · MIT License · pub.dev · Repository · Documentation Index
Algorithm/KAT-conformance and interoperability evidence — not a CMVP/FIPS 140 module validation.
pqcrypto Wiki
Getting started
Algorithms
Design & internals
Assurance
Integration
Project
Links