@dottedice/secure-key-store
v1.0.4
Published
Secure IndexedDB key storage with client-side Web Crypto PBKDF2/AES-GCM encryption
Maintainers
Readme
Legal Terms & Disclaimer
This open-source package is distributed strictly for technical education and architectural research purposes. For full warranty disclaimers, export control notices (US EAR / EU Dual-Use), and limitation of liability terms, please review our Open Source Terms & Disclaimer.
@dottedice/secure-key-store
Secure, browser-native IndexedDB database for Web Cryptography keys. Supports direct structured cloning of non-extractable keys, as well as PBKDF2/AES-GCM encrypted persistence of exportable keys.
Installation
npm install @dottedice/secure-key-storeFeatures
- Non-Extractable Support: Save private keys in IndexedDB without exporting them (safest browser practice).
- Password Encryption: Encrypt exportable keys before writing to disk using PBKDF2 iterations and AES-GCM 256-bit envelopes.
- 100% Offline: Leverages standard browser APIs (
indexedDBandcrypto.subtle).
API Reference
Password-Encrypted Storage
storeEncryptedKey(alias, cryptoKey, password): Encrypts and writes the key to IndexedDB.retrieveDecryptedKey(alias, password): Reads, decrypts, and imports the key back as aCryptoKey.
Direct Storage (Non-Extractable Keys)
storeRawKey(alias, cryptoKey): Saves aCryptoKeyobject directly in IndexedDB.retrieveRawKey(alias): Retrieves aCryptoKeyfrom IndexedDB.
Utilities
deleteKey(alias): Removes a key.listKeys(): Returns an array of stored aliases.
