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

@quantpass/pqc-liboqs

v0.1.0

Published

A unified, environment-aware TypeScript library providing Post-Quantum Cryptographic (PQC) primitives for the QuantPass ecosystem. This library wraps the NIST-standardized `liboqs` C-library using WebAssembly (WASM), providing pure-JavaScript portability

Readme

@quantpass/pqc-liboqs

A unified, environment-aware TypeScript library providing Post-Quantum Cryptographic (PQC) primitives for the QuantPass ecosystem. This library wraps the NIST-standardized liboqs C-library using WebAssembly (WASM), providing pure-JavaScript portability without requiring native C++ compilation (node-gyp).

🛡️ Patent Implementation Reference

This library serves as the core "Enablement" engine for the following QuantPass patents:

  • QP-02 (Hybrid Storage): Implements the AES-PQC key wrapping logic via TigerKEM (Kyber/ML-KEM).
  • QP-05 (Trust Audit): Provides the Dilithium (ML-DSA) signature verification used in apps/admin-dashboard.

🏗️ Architecture

This package is designed as a Universal Isomorphic Library. It runs flawlessly in Node.js (CLI / AWS Lambda) and the Browser (Next.js / Browser Extensions) using a single, unified codebase.

Core Modules (/src)

  • wasm_bindings.ts: A custom, memory-safe wrapper around the raw WebAssembly C-pointers. Bypasses Emscripten's WebIDL generator to manually manage WASM heap allocations (_malloc, _free) and memory bridging (getValue, setValue).
  • web/wasm-wrapper.ts: The universal loader.
    • In Node: Injects the .wasm binary into an isolated node:vm sandbox, wiring up node:crypto to supply secure entropy directly to the C-engine.
    • In Browser: Utilizes dynamic imports and the native Web Crypto API.

🚀 Getting Started

Installation

This is a private workspace package. Link it to your application via pnpm:

pnpm add @quantpass/pqc-liboqs --workspace

Usage: Dilithium (ML-DSA) Signatures

import { Signature, getOqsWasm } from '@quantpass/pqc-liboqs/web';

async function generateAndSign() {
  // 1. Load the universal WASM module
  const oqs = await getOqsWasm();
  
  // 2. Instantiate the Dilithium primitive
  const sig = new Signature(oqs, 'Dilithium2');
  
  try {
    // 3. Generate Post-Quantum Keys
    const keys = sig.generate_keypair();
    console.log(`Public Key: ${keys.publicKey.length} bytes`);
    console.log(`Secret Key: ${keys.privateKey.length} bytes`);
    
    // 4. Sign a message
    const message = new TextEncoder().encode("Hello, Quantum World!");
    const signature = sig.sign(message, keys.privateKey);
    console.log(`Signature: ${signature.length} bytes`);
    
  } finally {
    // 5. CRITICAL: Free the C-pointers to prevent WASM memory leaks
    sig.free();
  }
}

Usage: Kyber (ML-KEM) Key Encapsulation

import { TigerKEM, getOqsWasm } from '@quantpass/pqc-liboqs/web';

async function encapsulate() {
  const oqs = await getOqsWasm();
  const kem = new TigerKEM(oqs, 'Kyber512');
  
  try {
    const keys = kem.generateKeypair();
    // ... logic to encapsulate/decapsulate AES keys ...
  } finally {
    kem.free();
  }
}

⚠️ Important Developer Notes

  • Memory Management (CRITICAL): Because this library interfaces directly with C-pointers, JavaScript's garbage collector cannot automatically clean up WASM heap allocations. You must call .free() on instances of Signature and TigerKEM inside a finally block when you are done with them to prevent memory leaks in production.
  • Never use naive .wasm imports: Do not attempt to natively import oqs from './liboqs.wasm'. This will crash Node's module loader. Always use the getOqsWasm() wrapper to ensure the Node.js vm sandbox successfully bridges the environment and supplies the required cryptographic entropy.