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

paranoia-ts

v1.0.2

Published

Hybrid post-quantum end-to-end encryption for frontend applications — ML-KEM-1024 + P-521 + AES-256-GCM + Argon2id, built for the browser and Node.js.

Readme

paranoia-ts

Hybrid post-quantum end-to-end encryption for frontend applications.

ML-KEM-1024 (NIST FIPS 203) + P-521 ECDH + AES-256-GCM + Argon2id — built for the browser and Node.js.

npm License: MIT TypeScript FIPS 203

Full documentation and source: github.com/mateocallec/paranoia.ts


Installation

npm install paranoia-ts

Requirements: Browser with SubtleCrypto + WebAssembly, or Node.js ≥ 18.


Core concept

paranoia-ts uses a hybrid KEM construction — both ML-KEM-1024 (post-quantum) and P-521 (classical) must be broken simultaneously to compromise any sealed message. If a mathematical flaw is discovered in either algorithm, the other one still protects your data.


Usage

Passphrase encryption

Derive an AES key from a passphrase via Argon2id, then encrypt with AES-256-GCM. The Argon2id parameters are embedded in the sealed packet so decryption is always self-contained.

import { Paranoia } from 'paranoia-ts';

const paranoia = new Paranoia();

const sealed = await paranoia.seal(
  new TextEncoder().encode('secret message'),
  'my-strong-passphrase',
);

const plain = await paranoia.unseal(sealed, 'my-strong-passphrase');
console.log(new TextDecoder().decode(plain)); // secret message

Hybrid asymmetric encryption

Encrypt to a recipient's public key. The AES session key is wrapped with ML-KEM-1024 + P-521 ECDH combined via HKDF-SHA-384.

// Generate a hybrid keypair (ML-KEM-1024 + P-521)
const keyPair = await paranoia.generateKeyPair();

// Encrypt to recipient's public key
const sealed = await paranoia.sealTo(plaintext, keyPair.publicKey);

// Decrypt with private key
const plain = await paranoia.unsealWith(sealed, keyPair);

// Wipe private key material from memory when done
paranoia.wipe(keyPair.privateKey.mlkem, keyPair.privateKey.p521);

Deterministic keypair derivation

Derive a reproducible keypair from a master password using Argon2id + HKDF. The same inputs always produce the same keypair — the private key never needs to be stored.

import { deriveKeyPairFromMasterPassword, getSecureRandom } from 'paranoia-ts';

// derivationNonce is a per-user random value stored server-side (public, like a salt)
const nonce   = getSecureRandom(32);
const keyPair = await deriveKeyPairFromMasterPassword('master-password', 'username', nonce);

WebAuthn PRF — biometric keypair unlock

Store the encrypted keypair in IndexedDB and unlock it with a single biometric touch (Touch ID, Windows Hello, YubiKey). Requires a FIDO2 authenticator that supports the PRF extension.

import { registerWebAuthnPRF, getWebAuthnPRFKey, storeKeyPair, loadKeyPair, wipe } from 'paranoia-ts';

// Registration — once per device
const { credentialId, prfKey } = await registerWebAuthnPRF('user-id');
await storeKeyPair(keyPair, prfKey, 'my-keypair');
localStorage.setItem('cred', btoa(String.fromCharCode(...credentialId)));
wipe(prfKey);

// Unlock — one biometric touch on every page load
const credId = Uint8Array.from(atob(localStorage.getItem('cred')!), c => c.charCodeAt(0));
const prf    = await getWebAuthnPRFKey(credId);
const kp     = await loadKeyPair(prf, 'my-keypair');
wipe(prf);

Webcam TRNG

Harvest pixel noise from the webcam, hash with SHA-3-256, and mix with the system CSPRNG via HMAC. Additive only — cannot reduce entropy even if the camera feed is static or dark.

const stream = await navigator.mediaDevices.getUserMedia({ video: true });
await paranoia.enableWebcamEntropy(stream);

// All subsequent getSecureRandom() calls use the enhanced entropy pool
const sealed = await paranoia.sealTo(data, recipientPublicKey);

paranoia.disableWebcamEntropy();
stream.getTracks().forEach(t => t.stop());

API

Class Paranoia

| Method | Description | |---|---| | generateKeyPair() | Generate hybrid ML-KEM-1024 + P-521 keypair | | seal(data, passphrase, opts?) | Passphrase encrypt (Argon2id + AES-256-GCM) | | unseal(sealed, passphrase) | Passphrase decrypt | | sealTo(data, pubKey) | Hybrid KEM encrypt to public key | | unsealWith(sealed, keyPair) | Hybrid KEM decrypt | | enableWebcamEntropy(stream) | Mix webcam noise into CSPRNG pool | | disableWebcamEntropy() | Stop and wipe webcam pool | | storeKeyPair(kp, wrappingKey, id?) | Encrypt keypair to IndexedDB | | loadKeyPair(wrappingKey, id?) | Load keypair from IndexedDB | | wipe(...buffers) | Zero-fill sensitive Uint8Array buffers | | random(n) | Return n bytes of secure random data |

Standalone exports

import {
  // KEM
  hybridEncapsulate, hybridDecapsulate,
  encapsulatePqc,   decapsulatePqc,
  encapsulateP521,  decapsulateP521,
  // KDF
  deriveKey,
  deriveKeyPairFromMasterPassword,
  deriveKeyPairAndWrapKey,
  // AES
  aesGcmEncrypt, aesGcmDecrypt,
  // Entropy
  getSecureRandom, injectEntropy,
  enableWebcamEntropy, disableWebcamEntropy,
  // Memory
  wipe, constantTimeEqual,
  // WebAuthn
  registerWebAuthnPRF, getWebAuthnPRFKey,
  // Storage
  storeKeyPair, loadKeyPair, deleteKeyPair,
} from 'paranoia-ts';

Security

  • P-521 ECDH and HKDF run via crypto.subtle — constant-time guaranteed by the browser vendor
  • AES-256-GCM authentication is hardware-accelerated via SubtleCrypto
  • Argon2id parameters are authenticated as AAD — tampering is detected
  • Private key material is wiped after use with wipe() (best-effort in JS)

See SECURITY.md for the full threat model and vulnerability reporting process.


License

MIT © Matéo Florian Callec