Hashes/Crypto

PBKDF2 Hash + Verify

Derive a key with PBKDF2 (RFC 8018) from a password, HMAC-SHA1/256/384/512, with a configurable iteration count.


                    

PBKDF2 (RFC 8018) applies HMAC to a password and salt repeatedly to deliberately slow down computation — it's the oldest of the standardized algorithms for password hashing and encryption key derivation.

How to use it

Common uses

Things to keep in mind

Unlike bcrypt and Argon2, PBKDF2 isn't memory-hard — it only requires CPU time, so it's less resistant to attacks on GPUs with many parallel compute units.

The recommended iteration count rises over time in NIST and OWASP guidance as hardware gets faster — check against current recommendations periodically.

Article about this tool: PBKDF2: the oldest key-stretching standard

Frequently asked questions

How is PBKDF2 different from bcrypt or Argon2 for password hashing?

PBKDF2 repeatedly applies an HMAC hash function to slow down brute-force attempts, but unlike bcrypt or Argon2 it isn't memory-hard, making it comparatively cheaper to crack using GPUs. It's still widely used and FIPS-approved, but Argon2 is generally preferred for new systems.

What does the iteration count control, and how high should it be?

The iteration count sets how many times the underlying hash is applied, directly trading speed for resistance to brute-force. Current guidance recommends hundreds of thousands of iterations for SHA-256, adjusted upward over time as hardware gets faster.

Why does PBKDF2 need a salt?

A salt ensures that identical passwords produce different output, preventing attackers from using precomputed rainbow tables and forcing them to attack each hash individually.

Does the underlying hash function PBKDF2 uses matter?

Yes. Older implementations often defaulted to HMAC-SHA1 — within HMAC's construction that's not a critical vulnerability, but modern guidance consistently recommends HMAC-SHA256 or stronger for a larger safety margin at negligible speed cost.

Where else is PBKDF2 used besides password storage?

PBKDF2 is widely used to derive cryptographic encryption keys from passwords — for example, in WPA2/WPA3 for Wi-Fi and in many encrypted file container formats.

Articles: Hashes/Crypto

Hash Generator: how MD5, SHA-1, and SHA-256 differ from each other

Why MD5 is still used to verify file integrity, but not for passwords.

Checksum Verifier: how to check that a file isn't corrupted

Why a matching checksum confirms a file's integrity, but not who created it.

HMAC: how a keyed hash differs from a regular hash

Why a plain SHA-256 doesn't protect against message tampering, but HMAC does.

Bcrypt: why passwords are hashed slowly, not quickly

Why fast SHA-256 is a bad choice for passwords, and slow bcrypt is the right one.

UUID: how identifiers that almost never repeat are generated

Why UUID v4 can be generated independently on millions of machines without collision risk.

Password Generator: what actually makes a password strong

Why a long dictionary-word password is stronger than a short one with symbols and digits.

AES: how symmetric encryption works

Why the same key both encrypts and decrypts data in AES, and how that differs from asymmetric encryption.

Argon2: why this algorithm won the password hashing competition

How Argon2 defends better against GPU-based attacks than older password hashing algorithms.

Scrypt: why the algorithm needs so much memory

Why scrypt deliberately demands a lot of memory to make cracking on ASIC devices harder.

TOTP: how one-time codes in authenticator apps work

Why the code in Google Authenticator works offline and syncs with the server only via time.

X.509: what's inside an SSL certificate

What exactly the browser checks in a site's certificate before showing the green padlock.

PGP: how public-key and private-key encryption works

Why you can freely share a PGP public key but never the private one.