Menu

PBKDF2 in the browser with Web Crypto: salt, iterations, and OWASP's 600,000 in encloom 2.1.0
📰

PBKDF2 in the browser with Web Crypto: salt, iterations, and OWASP's 600,000 in encloom 2.1.0

DEV Community: typescript·Alejandro Rodriguez·13 days ago
#uaY9duVj
#devtotypescript#devto#dev#pbkdf2#iterations
Long article (3334 words) — no AI summary yet.
Reading 0:00
15s threshold

You have a password and want a key out of it. In the browser, Web Crypto lets you do that with PBKDF2: you pass it the password, a salt, an iteration count, and a hash, and it gives you bits back. In encloom 2.1.0, encloom/pbkdf2 does exactly that with crypto.subtle.deriveBits . If you don't pass any options, you get a 32-byte key, a random 16-byte salt, 600,000 iterations, and HMAC-SHA-256.

That figure isn't arbitrary. The OWASP Password Storage Cheat Sheet , checked on 20 November 2026, recommends 600,000 iterations for PBKDF2-HMAC-SHA256. The PBKDF2_DEFAULT_ITERATIONS default matches that recommendation and leaves SHA-256 as the default digest. If you pass a SHA-512 digest and omit the iterations, it uses PBKDF2_DEFAULT_ITERATIONS_SHA512 (220,000), which is OWASP's figure for that hash.

Not a compliance guide and not an audit. encloom isn't audited, it isn't FIPS-140 validated, and OWASP doesn't certify libraries.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.