npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@quantalabss/quantacipher-wasm

v2.0.6

Published

Zero-trust post-quantum encryption WASM bindings — ML-KEM-1024 (FIPS 203) + AES-256-GCM

Readme

npm version npm downloads License: MIT Built with wasm-pack

Platform · API Docs · GitHub


What is this?

quantacipher-wasm is the compiled WebAssembly binary of the QuantaCipher cryptographic engine. It is the Rust quantacipher-core library compiled to .wasm via wasm-pack, with auto-generated JavaScript bindings.

Most developers should use @quantalabss/quantacipher-sdk — the high-level TypeScript SDK that wraps this package and adds the gateway integration, dual-mode abstraction, and receipt handling. Use @quantalabss/quantacipher-wasm directly only if you need the raw WASM engine without the SDK layer (e.g., in a browser app with a custom architecture, or a non-Node.js runtime).

quantacipher-sdk depends on this package and installs it automatically.


How It Works

This package exposes the entire QuantaCipher cryptographic system as WASM-compiled functions callable from any JavaScript or TypeScript runtime:

Rust source (quantacipher-core)
         ↓  wasm-pack build
  quantacipher_wasm.wasm    ← compiled Rust cryptography
  quantacipher_wasm.js      ← auto-generated JS glue
  quantacipher_wasm.d.ts    ← TypeScript type definitions
         ↓  import
  Your JavaScript / TypeScript application

All cryptographic operations — key generation, encapsulation, encryption, decryption — execute 100% inside the WASM sandbox. Plaintext never leaves the local runtime. No network calls are made by this package.


Installation

npm install quantacipher-wasm
# or
yarn add quantacipher-wasm

Usage (Direct WASM API)

const wasm = require('quantacipher-wasm');

console.log('Engine version:', wasm.get_wasm_version());

// ── VAULT MODE: Permanent sealing (ephemeral key, no decrypt) ────
const vaultCiphertext = wasm.vault_encrypt('Top secret audit log');
// → "QZ_VAULT_V1:..."  — no one can ever decrypt this

// ── SECURE MODE: Encrypt with a persistent keypair ────────────────
const keypairJson = wasm.generate_keypair();
const { publicKey, privateKey } = JSON.parse(keypairJson);

const secureCiphertext = wasm.secure_encrypt('Confidential data', publicKey);
// → "QZ_SECURE_V1:..."

const plaintext = wasm.secure_decrypt(secureCiphertext, privateKey);
// → "Confidential data" ✅

// Wrong key → throws immediately
// wasm.secure_decrypt(secureCiphertext, wrongPrivateKey)
// → Error: QuantaCipher Error: ML-KEM decapsulation failed (wrong key?)

Exported Functions

| Function | Signature | Description | |---|---|---| | vault_encrypt | (plaintext: string) => string | Vault Mode — ephemeral key, permanently sealed | | generate_keypair | () => string | Generate ML-KEM-1024 keypair, returns JSON string | | secure_encrypt | (plaintext: string, public_key_b64: string) => string | Secure Mode encryption | | secure_decrypt | (ciphertext: string, private_key_b64: string) => string | Secure Mode local decryption | | get_wasm_version | () => string | Returns engine version string | | get_algorithm | () => string | Returns "ML-KEM-1024" from core constants | | get_scheme | () => string | Returns "ML-KEM-1024 (FIPS 203) + AES-256-GCM" | | generate_signing_keypair | (algorithm?: string) => string | Generate PQ signing keypair (JSON) | | sign_payload | (payload_b64, private_key_b64, algorithm?) => string | Sign bytes, returns SignatureEnvelope JSON | | verify_signature | (payload_b64, signature_json, public_key_b64) => bool | Verify — alg read from envelope, never assumed | | encrypt_local_kyber | (plaintext: string) => string | Deprecated — alias for vault_encrypt |


Payload Format

All outputs are portable, versionable string tokens cross-compatible with the Python and Rust SDKs:

QZ_VAULT_V1  : <base64 ML-KEM-1024 CT> : <base64 12-byte nonce> : <base64 AES-256-GCM CT>
QZ_SECURE_V1 : <base64 ML-KEM-1024 CT> : <base64 12-byte nonce> : <base64 AES-256-GCM CT>

A ciphertext encrypted in the browser with this WASM package can be decrypted by the Python SDK, and vice versa — the format is runtime-agnostic.


Cryptographic Specification

| Property | Value | |---|---| | KEM Algorithm | ML-KEM-1024 (NIST FIPS 203) | | Symmetric Cipher | AES-256-GCM | | Public Key Size | 1568 bytes | | Private Key Size | 3168 bytes | | KEM Ciphertext | 1568 bytes | | AES Nonce | 12 bytes (96-bit, random per encryption) | | Shared Secret | 32 bytes | | Key Encoding | Base64 (standard) | | Signing | FN-DSA / Falcon-512 (default) · ML-DSA-44 (FIPS 204) |


Browser Usage (ESM / Bundlers)

For browser environments with a bundler (Vite, webpack, Next.js), you may need to configure WASM loading. See the full setup guide for Next.js, Vite, and plain HTML configurations.


Related Packages

| Package | Description | |---|---| | @quantalabss/quantacipher-sdk | High-level TypeScript SDK (recommended for most users) | | quantacipher | Python SDK with native Rust bindings | | quantacipher-core | Pure Rust engine (for Rust applications) |


License

MIT — see LICENSE