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

cryptonism

v1.0.2

Published

End-to-end encryption library for browser

Downloads

23

Readme

🔐 Cryptonism · GitHub license

Frontend End-to-End Encryption Library
Secure your authentication flows and sensitive data with zero-knowledge architecture directly in the browser.


✨ Features

  • 🔑 Argon2id Key Derivation: Memory-hard password hashing resistant to attacks
  • 🔐 AES-GCM Encryption: Authenticated encryption for maximum security
  • 🛡️ Recovery System: Secure mnemonic-based key recovery
  • 🔄 Password Rotation: Safe password updates without data loss
  • 📊 Attempt Tracking: Built-in protection against brute force attacks
  • ⚡ TypeScript Support: Full type safety and IntelliSense support

📚 Documentation

Full documentation is available here: View the Docs

📦 Installation

npm install cryptonism

Usage Example

Encrypt An Account

import { generateEncryptedKey } from 'cryptonism';

const result = await generateEncryptedKey({
  password: 'user-master-password'
});

if (result.success) {
  // Store these in your database
  const data = {
    encryptedKey: result.encryptedKey,
    salt: result.salt,
    iv: result.iv,
    encryptedRecoveryKey: result.encryptedRecoveryKey,
    recoverySalt: result.recoverySalt,
    recoveryIV: result.recoveryIV
  };
  
  // CRITICAL: Show recovery phrase to user ONCE
  alert(`Save this recovery phrase: ${result.recoveryPhrase}`);
  
} else {
  console.error('Key generation failed:', result.error.message);
}

With Custom Argon2 Configuration

// Note: use same custom argonConfig for all functions
const result = await generateEncryptedKey({
  password: 'user-master-password',
  argonConfig: {
    time: 3,      // More iterations for higher security
    mem: 32000,  // 32MB memory usage
    hashLen: 32   // 32-byte output
  }
});

// The Default Argon2 Config
const defaultArgonConfig = {
  time: 3,
  mem: 65536,
  hashLen: 32
};

Decrypt An Account

import { decryptGeneratedKey } from 'cryptonism';

// Data from your database
const data = {
  salt: 'base64-salt-string',
  iv: 'base64-iv-string', 
  encryptedKey: 'base64-encrypted-key'
};

const result = await decryptGeneratedKey({
  salt: data.salt,
  iv: data.iv,
  encryptedKey: data.encryptedKey,
  password: 'user-entered-password'
});

if (result.success) {
  const { decryptedKey } = result;
  // Now you can use this key to encrypt/decrypt secrets
  console.log('Vault unlocked successfully!');
} else {
  console.error('Failed to unlock vault:', result.error.message);
}

Decrypt With Attempt Tracking

const result = await decryptGeneratedKey({
  salt: data.salt,
  iv: data.iv,
  encryptedKey: data.encryptedKey,
  password: userPassword,
  trackAttempts: {
    enable: true,
    id: `user-${userId}`,     // Unique identifier for this user
    maxAttempts: 5            // Lock after 5 failed attempts
  }
});

if (result.success) {
  console.log('Login successful!');
} else {
  console.error(`Login failed. Attempts: ${result.attempts}/5`);
  
  if (result.attempts >= 5) {
    console.error('Account locked due to too many failed attempts');
  }
}

Encrypt Each Secret Data

import { encryptSecret } from 'cryptonism';

// Assuming you have a decrypted key from decryptGeneratedKey
const result = await encryptSecret({
  secret: 'my-api-key-abc123',
  decryptedKey: userDecryptedKey
});

if (result.success) {
  // Store these values in your database
  const secretRecord = {
    encryptedSecret: result.encryptedSecret,
    iv: result.iv,
  };
  
  await saveSecretToDatabase(secretRecord);
  console.log('Secret encrypted and saved!');
} else {
  console.error('Encryption failed:', result.error.message);
}

Decrypt Each Secret

import { decryptSecret } from 'cryptonism';

// Data retrieved from your database
const secretRecord = {
  encryptedSecret: 'base64-encrypted-data',
  iv: 'base64-iv-string'
};

const result = await decryptSecret({
  encryptedSecret: secretRecord.encryptedSecret,
  iv: secretRecord.iv,
  decryptedKey: userDecryptedKey  // From decryptGeneratedKey
});

if (result.success) {
  console.log('Secret:', result.decryptedSecret);
  // Use the decrypted secret (API key, password, etc.)
} else {
  console.error('Decryption failed:', result.error.message);
}

For advanced usage, configuration options, and troubleshooting tips, please refer to the Full Documentation.