Skip to main content

Getting started

quantum-resistant-rustykey is a TypeScript-first npm package of WebAssembly post-quantum primitives for Node.js and browsers — including SQIsign (NIST additional-signatures / on-ramp), ML-DSA, FN-DSA, SLH-DSA, and ML-KEM.

RustyKey® is a FIDO Alliance member. This package exists especially for constrained WebAuthn / CTAP2 contexts where lattice signatures are too large for the classic ~1024-byte buffer.

:::caution Pre-production Await v1.0.0 (after security audit) for production / regulated deployment. Until then, prefer @latest or a caret range so dependents pick up patches. :::

Install​

pnpm i quantum-resistant-rustykey@latest
# or
bun add quantum-resistant-rustykey@latest
npm add quantum-resistant-rustykey@latest
Requires Node ≥ 26.10.0.

TypeScript types​

Types ship inside the package (dist/index.d.ts, wired through package.json "types" / exports). After install, editors and tsc resolve them automatically — do not install a separate DefinitelyTyped package:

# Not needed — there is no @types/quantum-resistant-rustykey
# pnpm i -D @types/quantum-resistant-rustykey

Useful named exports include IFnDsa, IMlKem, KeyPair, MlKemKeyPair, BytesLike, and EncryptResult. See API overview and the security note on what types do / do not prove.

What you get​

FamilyVariantsNotes
SQIsignL1 / L3 / L5Small signatures; NIST on-ramp. See cose-sqisign.
ML-DSA65 / 87NIST FIPS 204
FN-DSA512 / 1024Falcon family
SLH-DSA128s / 192s / 256sHash-based FIPS 205 (pure JS via @noble/post-quantum)
ML-KEM512 / 768 / 1024From mlkem-native

Quick taste (ML-KEM)​

import { loadMlKem768, type IMlKem } from "quantum-resistant-rustykey";

const kem: IMlKem = await loadMlKem768();
const kp = kem.keypair();
const enc = kem.encrypt(kp.get("public_key"));
const sharedA: ArrayBuffer = await enc.get("secret");
const sharedB: ArrayBuffer = await kem.decrypt(enc.get("cyphertext"), kp.get("private_key"));

Live playground​

Try algorithms interactively at pqc.rustykey.me.

Next​