Secure Frontend Encryption Library
bVault-js is a type-safe, lightweight, zero-dependency cryptographic library designed for secure encryption and decryption in browser environments. It provides a simple yet powerful API for protecting sensitive data using industry-standard encryption algorithms.
Key Features
- AES-GCM 256-bit Encryption: Military-grade encryption for maximum security
- Password-based Key Derivation: PBKDF2 with 100,000 iterations for secure key generation
- Automatic Parameter Generation: Built-in salt and IV generation
- Secure Local Storage Wrapper: Encrypted localStorage with automatic encryption/decryption
- TypeScript Support: Full type safety with comprehensive type definitions
- Zero Dependencies: Lightweight and self-contained
- Browser-First: Optimized for modern web browsers using Web Crypto API
Why Choose bVault-js?
bVault-js is designed to bring enterprise-grade encryption directly into your browser applications — without the bloat, without extra dependencies.
It helps you securely store, retrieve, and manage sensitive data using the Web Crypto API, while keeping a simple, type-safe, developer-friendly API.
🔑 Key Advantages
- AES-GCM 256-bit encryption: Industry-standard, modern symmetric encryption.
- PBKDF2 with 100,000 iterations: Derives strong encryption keys from user-provided passwords.
- Zero dependencies: Lightweight, portable, and safe to use in modern browsers.
- Secure Local & Session Storage: Wraps
localStorage
andsessionStorage
so you can transparently encrypt/decrypt app data. - Cross-framework support: Works seamlessly with React, Vue, Svelte, and vanilla JS.
🛡️ How It Works
bVault-js provides two secure storage wrappers:
secureLocalStorage
→ persists data across browser sessions (until cleared).secureSessionStorage
→ keeps sensitive data only for the current session (cleared when the tab/browser closes).
This gives developers flexibility in choosing where and how data should be kept encrypted.
⬇️ Encryption & Storage Flow
bVault-js solves the critical problem of securely storing sensitive data in client-side applications. Unlike plain localStorage or sessionStorage, bVault-js ensures that even if someone gains access to the stored data, they cannot read it without the encryption password.
Use Cases
- User Authentication: Secure storage of authentication tokens and user sessions
- Configuration Files: Protection of sensitive application configuration
- Personal Data: Encryption of user personal information in browser storage
- File Encryption: Client-side encryption of files before upload
- Secure Messaging: End-to-end encryption for messaging applications
Security First
bVault-js prioritizes security by implementing best practices:
- Uses AES-GCM with 256-bit keys for authenticated encryption
- Employs PBKDF2 with 100,000 iterations for key derivation
- Generates unique salts and initialization vectors for each operation
- Provides built-in error handling for cryptographic failures
- Follows OWASP security guidelines for client-side encryption
Ready to get started? Continue to the Installation Guide.