Security & Crypto · PBKDF2

Local PBKDF2-SHA256 / SHA-512 Key Derivation & Benchmark

Stretch passwords into 256-bit cryptographic keys using native browser WebCrypto PBKDF2—benchmarking real millisecond latency across OWASP-recommended iteration counts with zero server upload.

✓ 100% Browser-Local · Zero Upload Reviewed: 2026-11-26

Initializing local browser workspace...

Test Password Stretching & Key Derivation Parameters Locally

Fast hashes like raw SHA-256 can be brute-forced at billions of guesses per second on modern GPUs. Password-Based Key Derivation Function 2 (PBKDF2) intentionally stretches hashing across hundreds of thousands of iterations with a unique per-user salt to defeat offline cracking.

  • Supports both PBKDF2-HMAC-SHA256 and PBKDF2-HMAC-SHA512 via native WebCrypto deriveBits
  • Adjustable iteration count from 1,000 up to 1,000,000 with real-time millisecond execution timing
  • One-click 128-bit cryptographic random salt generator using window.crypto.getRandomValues
  • Outputs 256-bit derived key in lowercase Hex, Base64, and standard PHC hash string notation
  • Helps developers calibrate OWASP password stretching latency directly on real hardware
  • 100% browser-local execution so passwords and salts never leave your machine

Step-by-Step Guide

  1. Select PBKDF2-HMAC-SHA256 or PBKDF2-HMAC-SHA512 and set your target iteration count (e.g. 210,000 for SHA-512 or 600,000 for SHA-256).
  2. Enter a test password and click New Salt to generate a fresh random 16-byte cryptographic salt.
  3. Click Derive Key to compute the 256-bit key in Hex, Base64, and PHC string formats.
  4. Inspect the green timing readout to verify that derivation stays responsive (~50–300 ms) while slowing down brute-force attackers.

Password Hashing & KDF Security Pitfalls

Reusing a Static Application-Wide Salt

Sharing one fixed salt across every user allows attackers to precompute rainbow tables and spot identical passwords across accounts. Always generate a fresh 128-bit random salt per password.

Using Outdated 1,000 or 10,000 Iteration Counts

Legacy tutorials recommending 10,000 PBKDF2 iterations are dangerously weak on modern GPU rigs. Current OWASP guidance recommends 600,000 iterations for PBKDF2-SHA256 or 210,000 for PBKDF2-SHA512.

Storing Plain SHA-256 Instead of a Key Derivation Function

Never hash user login passwords with plain SHA-256 or MD5. Always use PBKDF2, Argon2id, or scrypt.

Authentication & Client-Side Encryption Uses

  • Verifying cross-platform WebCrypto PBKDF2 test vectors between browser JavaScript and Node.js/Python backends.
  • Benchmarking real user-device latency before raising PBKDF2 iteration counts in production auth systems.
  • Deriving deterministic 256-bit encryption keys for zero-knowledge local vault prototypes.

Frequently Asked Questions

What OWASP iteration count should I choose for PBKDF2?

OWASP recommends at least 600,000 iterations for PBKDF2-HMAC-SHA256 and 210,000 iterations for PBKDF2-HMAC-SHA512 (or Argon2id where native libraries are available).

Does PBKDF2 output the exact same key given the same password, salt, and iterations?

Yes. PBKDF2 is deterministic, which lets your backend re-derive and compare the hash during login by storing the salt and iteration count alongside the digest.

Is my password transmitted to a remote server during benchmarking?

No. Key stretching runs strictly inside your browser's WebCrypto API with zero network traffic.

Local Privacy Guarantee: All PBKDF2 password derivation and random salt generation happen exclusively inside local browser WebCrypto.