Web Crypto utilities for password-based encryption. Uses PBKDF2 for key derivation and AES-GCM for symmetric encryption. Web-only — relies on the SubtleCrypto API available in all modern browsers. /
// Source: https://github.com/ajamaica/lumiere | License: MIT | Copyright 2026 ajamaica
// Provided via justclaw.it.com; keep this notice with the code.
/**
* Web Crypto utilities for password-based encryption.
* Uses PBKDF2 for key derivation and AES-GCM for symmetric encryption.
* Web-only — relies on the SubtleCrypto API available in all modern browsers.
*/
const PBKDF2_ITERATIONS = 600_000
const KEY_LENGTH = 256
const SALT_LENGTH = 16 // bytes
const IV_LENGTH = 12 // bytes (96-bit, recommended for AES-GCM)
const VERIFICATION_PLAINTEXT = 'lumiere-password-verification-v1'
// localStorage keys
const STORAGE_PREFIX = 'lumiere_secure_'
const SALT_KEY = `${STORAGE_PREFIX}salt`
const VERIFICATION_KEY = `${STORAGE_PREFIX}verification`
// ─── Helpers ────────────────────────────────────
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key