@envelopa/argon2
v0.3.0
Published
Argon2id KDF provider for Envelopa
Readme
@envelopa/argon2
Argon2id KDF provider for Envelopa.
Envelopa requires a KdfProvider at vault creation and unlock. This package supplies the default Argon2id implementation using WASM (hash-wasm), compatible with Node.js >= 20 and modern browsers.
Install
npm install @envelopa/argon2You typically install this alongside envelopa:
npm install envelopa @envelopa/argon2Usage
import { argon2id } from '@envelopa/argon2';
import { createVault, unlockVault } from 'envelopa';
const kdfProvider = argon2id();
const { header, session } = await createVault({
password: 'user-password',
kdfProvider,
});
const unlocked = await unlockVault({
password: 'user-password',
header,
kdfProvider,
});
session.destroy();
unlocked.destroy();Create one provider instance and reuse it across your application. Omit the kdf option in production to use Envelopa's default Argon2id parameters (64 MiB memory).
License
MIT
