Skip to content
npm · crypto · webcrypto

Browser crypto & secure storage —KhashVault

A browser-side cryptography and secure-storage library built on the Web Crypto API and OpenPGP. It bundles symmetric encryption, hashing, key derivation, PGP key management, and encrypted persistence behind a small TypeScript API, with optional Web Worker offloading for heavy operations.

Off-thread crypto

KhashVaultWorkerClient plus SharedArrayBuffer helpers let heavy crypto run off the main thread in cross-origin-isolated contexts.

  • Foundations — Web Crypto API + OpenPGP.
  • Storage — SecureLocalStorage + SecureIndexedDB.
TypeScriptLanguage
AES-GCMSymmetric
PGP + PBKDF2Keys
MITLicense

What it gives you

Features

AES-GCM encryption

aesEncrypt / aesDecrypt plus password-based variants.

Hashing

sha256, sha512, and generic hash / hashBytes.

Key derivation

deriveKey and deriveRawBits (PBKDF2).

Key management

generateAesKey, exportKey, importKey, randomBytes.

PGP

pgpGenerateKeyPair, pgpEncrypt, pgpDecrypt via OpenPGP.

Secure storage

SecureLocalStorage and SecureIndexedDB for encrypted browser persistence.

Web Worker offload

KhashVaultWorkerClient with SharedArrayBuffer helpers for cross-origin-isolated contexts.

Questions

Frequently asked

What is KhashVault?

KhashVault is a browser-side cryptography and secure-storage npm library built on the Web Crypto API and OpenPGP, offering AES-GCM encryption, SHA-256/512 hashing, PBKDF2 key derivation, PGP key pairs, and encrypted local and IndexedDB storage.

What cryptographic primitives does KhashVault provide?

It provides AES-GCM encryption and decryption (including password-based), SHA-256 and SHA-512 hashing, PBKDF2 key derivation, AES key generation and import/export, and PGP key generation, encryption, and decryption via OpenPGP.

Does KhashVault support Web Workers?

Yes. It ships a KhashVaultWorkerClient plus SharedArrayBuffer helpers for cross-origin-isolated contexts so heavy crypto can run off the main thread.