๐Ÿ” Password Manager Cryptographic Library

Secure, zero-dependency cryptographic library with universal runtime support

CI/CD Pipeline Security Checks NPM Version

Quick Installation

npm install password-manager-crypt

Zero dependencies โ€ข Production ready โ€ข Universal compatibility

Why Choose This Library?

๐ŸŒ

Universal Runtime Support

Works seamlessly across Node.js, CloudFlare Workers, and Browser environments with automatic optimization.

โšก

High Performance

WebCrypto API provides 2-15x performance boost. Smart factory pattern selects optimal implementation.

๐Ÿ”’

Security First

Timing attack resistant, NIST-compliant algorithms, sanitized error handling, zero dependencies.

๐Ÿงช

Test-First Development

85 comprehensive tests including NIST test vectors, >95% coverage, cross-environment validation.

๐Ÿ“ฆ

Zero Dependencies

Production build has zero dependencies for minimal attack surface and easy auditing.

๐Ÿ—๏ธ

TypeScript Native

Comprehensive type definitions, type-safe APIs, full IntelliSense support across all environments.

Universal Environment Support

๐ŸŸข

Node.js

Native crypto module
๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ Fastest performance
Perfect for servers & CLI tools

โšก

CloudFlare Workers

WebCrypto API
๐Ÿ”ฅ๐Ÿ”ฅ High performance
Edge computing optimized

๐ŸŒ

Browsers

WebCrypto API
๐Ÿ”ฅ๐Ÿ”ฅ High performance
Client-side encryption

Quick Start Example

import { cryptoServiceFactory, DEFAULT_KEY_DERIVATION_PARAMS } from 'password-manager-crypt';

// Automatic environment detection and optimal performance
const cryptoService = cryptoServiceFactory.createForPerformance('high');

// Encrypt vault data
async function encryptVault(masterPassword: string, vaultData: string) {
  const salt = cryptoService.generateSalt();
  
  const key = await cryptoService.deriveKey(
    masterPassword, 
    salt, 
    DEFAULT_KEY_DERIVATION_PARAMS
  );
  
  const encryptedData = await cryptoService.encrypt(
    new TextEncoder().encode(vaultData), 
    key
  );
  
  return { encryptedData, salt };
}

// Decrypt vault data
async function decryptVault(masterPassword: string, salt: Uint8Array, encryptedData: EncryptedData) {
  const key = await cryptoService.deriveKey(masterPassword, salt, DEFAULT_KEY_DERIVATION_PARAMS);
  const decryptedBytes = await cryptoService.decrypt(encryptedData, key);
  
  if (!decryptedBytes) {
    return null; // Invalid password or tampered data
  }
  
  return new TextDecoder().decode(decryptedBytes);
}