Docs / Get started

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.

Seal pipeline: public key into X-Wing (ML-KEM-768 and X25519 combined by SHA3-256), HKDF-SHA256, AES-256-GCM, key commitment, PQL1 envelope.

02Find your way

03Modules

ModuleDoesGuide
sealEncrypt to a public keyset, open with the private oneEncrypt data
signComposite signatures, both halves always verifiedSignatures
keysetCreate, load, serialize, add, promote, retireKeysets
tokensML-DSA-65 JWS login tokens, reference cookiesLogin tokens
seal_batchMany database fields under one data key, bound to table, column and rowDatabase fields
streamLarge files and backups in 64 KiB chunksFiles and streams
rotateRe-wrap data keys to a new key without touching the dataKey rotation
webhooksSigned webhook deliveries with replay protectionWebhooks
auditSigned AI agent tool calls and a hash-chained audit logAgent tool calls
tlsHybrid TLS key exchange (X25519MLKEM768)Hybrid TLS
legacyRead-only verification of old RS256 and ES256 tokensMigration
policyApp-wide settings from pql.policy.yamlPolicy 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.

Unaudited preview

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/