pqlock docs
pqlock is a small SDK for TypeScript, Python and Go that replaces RSA and elliptic-curve cryptography with NIST post-quantum algorithms, hybrid by default.
01What pqlock does
pqlock gives applications four everyday operations with post-quantum security underneath: seal and open for encryption, sign and verify for signatures, login tokens, and keysets that carry keys through rotation. The same calls exist in all three languages and produce the same bytes.
Every default key pairs a post-quantum algorithm (ML-KEM, ML-DSA) with a classical one (X25519, Ed25519). Data stays protected as long as either half holds, which covers both a future quantum computer and an unexpected weakness in the newer algorithms.
02Find your way
03Modules
| Module | Does | Guide |
|---|---|---|
seal | Encrypt to a public keyset, open with the private one | Encrypt data |
sign | Composite signatures, both halves always verified | Signatures |
keyset | Create, load, serialize, add, promote, retire | Keysets |
tokens | ML-DSA-65 JWS login tokens, reference cookies | Login tokens |
seal_batch | Many database fields under one data key, bound to table, column and row | Database fields |
stream | Large files and backups in 64 KiB chunks | Files and streams |
rotate | Re-wrap data keys to a new key without touching the data | Key rotation |
webhooks | Signed webhook deliveries with replay protection | Webhooks |
audit | Signed AI agent tool calls and a hash-chained audit log | Agent tool calls |
tls | Hybrid TLS key exchange (X25519MLKEM768) | Hybrid TLS |
legacy | Read-only verification of old RS256 and ES256 tokens | Migration |
policy | App-wide settings from pql.policy.yaml | Policy file |
04What pqlock is not
pqlock does not implement cryptographic math. ML-KEM, ML-DSA, X25519, Ed25519, AES-GCM, SHA-2, SHA-3 and HKDF all come from validated engines: node:crypto on OpenSSL 3.5 or later, pyca cryptography 47 or later, and the Go 1.27 standard library. pqlock writes only the compositions in spec/: the hybrid combiners, the key schedule, and the envelope and keyset formats.
pqlock v0.1.0 has not had an external cryptographic audit. Do not protect production data with it until an audit is published. The wire format can still change before 1.0.
pqlock v0.1.0 · unaudited preview · source of truth: spec/