Pikkola PBKDF2, tool No. 92

What an iteration count actually costs on this machine.

Derive a key with WebCrypto PBKDF2, write it as a record you can store, verify a stored hash against a password, and measure the milliseconds each count takes here instead of trusting a number from an article.

3
hash choices
16
byte salt
1
measured call

The derivation bench

A password, a salt, and a number that matters

PBKDF2 is deliberately slow. The three decisions are the hash, the salt and the iteration count; this page computes the key, shows it in hex and base64, writes the record, and times the call so the count can be chosen with evidence.

Derived key, hex
Derived key, base64
A record to store

What the count costs here

Four counts are derived one after another.

Iterations Time Per 1,000 Rate

Three numbers, one decision each

A password hash is slow on purpose. The work has to be enough to hurt an attacker and small enough that a login is still quick.

01

The salt is per record

A random salt of sixteen bytes makes two users with the same password store different records, and stops a table of precomputed hashes from answering for every account at once. It is not secret and it belongs beside the record.

02

The count is the cost

Each iteration is one more HMAC over the previous block, so the attacker pays the same multiplication the server pays. The page measures the multiplier on this CPU rather than quoting a number, because phone and server differ by a factor of ten.

03

The record holds the recipe

Scheme, count, salt and key in one line. The count and the salt have to travel with the hash, or a later verify has no way to reproduce it, and a record without them cannot be upgraded when the guidance moves.

What is derived, and what this is not

The page is a correct PBKDF2 implementation around WebCrypto, and it is honest about where PBKDF2 sits in 2026.

Part What this page does What it will not do
The hash HMAC-SHA-256, SHA-384 or SHA-512 through WebCrypto Implement a hash by hand, or offer MD5 and SHA-1
The salt Sixteen random bytes from the platform generator, editable as hex Reuse one salt across accounts, or derive it from the password
The count Whatever you set, measured and compared with a published figure Choose a count for you and call it secure
The comparison Constant time, over the full length of both keys Compare as strings, which leaks the length of a correct prefix
The record One line with the scheme, count, salt and key in base64 Store a bare hash with no parameters, which cannot be verified later
The algorithm itself PBKDF2, which is FIPS approved and widely available Claim PBKDF2 is the best choice: Argon2id is memory hard and preferred where it is available

A six hundred thousand iteration PBKDF2 hash resists a GPU at a cost that is roughly one hex core's throughput per guess. Argon2id resists it better because memory is the scarce resource on a graphics card. PBKDF2 is the right answer when a standard or a platform demands it, not because it is strongest.

Field guide

Salt, count and the cost of a guess

PBKDF2 turns a password into a key by doing the same small amount of work many times. The design is old, well understood and still correct where a standard asks for it. These are the three numbers and what each one buys.

The salt is not a secret, and that is the point

A salt is random bytes stored beside the hash. It makes two identical passwords produce different records, so an attacker cannot hash one guess once and match every account at the same time, and it defeats a table of precomputed hashes. Sixteen bytes is the usual size. It does not need to be secret, it does not need to be encrypted, and deriving it from the password (a "pepper" made of the password itself) removes the only property it has.

A pepper, by contrast, is a secret key mixed in as well, kept outside the database. It helps against a database dump alone and does nothing against a full server compromise. PBKDF2 accepts an extra key only through HMAC's key, which is why a pepper is usually applied as HMAC(pepper, pbkdf2(password, salt)) rather than an argument.

What an iteration count buys

Each iteration is an HMAC over the previous output, so the total cost is linear in the count and identical for the defender and the attacker. Doubling the count doubles both. That only helps if the attacker's cost per guess is higher than yours: a GPU does SHA-256 thousands of times faster than a CPU core, so the defender pays more than the attacker in absolute terms.

This is why PBKDF2 is the weaker of the two current answers. Argon2id makes memory the cost, and a graphics card has far less memory bandwidth than raw hash throughput, so the attacker's advantage shrinks. Where Argon2id is available, it is the recommendation. Where a standard, a library or a compliance rule requires PBKDF2, a measured count in the hundreds of thousands is the right answer, and the record format here makes raising it later possible.

The measured call, not the quoted one

The benchmark tab derives the same password and salt at 1,000, 10,000, 100,000 and the count you set, one after another. The numbers are for this machine and this browser: a phone is often five to ten times slower than the laptop a developer tests on. The useful question is not "is 600,000 enough" but "what does 600,000 cost on the hardware that will run this login", and the answer is a number of milliseconds you can see.

A common target is under about a quarter of a second per login on the real server. Above that, a login feels slow and a burst of attempts can starve the service. The record keeps the count, so a later decision to raise it can be applied at the next password change instead of locking everyone out.

Constant time, and why a string compare is wrong

Comparing two keys with === returns as soon as one byte differs. If an attacker can measure that time, the number of correct leading bytes is a signal, and a guess can be built one byte at a time. The verifier here XORs every byte of both keys and checks the accumulator once, so the time does not depend on where they differ. This matters less over a network than in a local timing attack, and it is cheap enough that there is no reason not to do it.

What a record has to carry

The line this page writes is pbkdf2-sha256$100000$<salt base64>$<key base64>. Django's own format, pbkdf2_sha256$iterations$salt$hash, is the same shape, which is why a Django hash verifies here. The parameters have to travel with the hash: a key with no count cannot be recomputed, and a database of bare hashes cannot be upgraded when the guidance moves. That mistake is old and still common, and it is the one thing on this page worth checking in your own schema.

For checksums and file identity rather than passwords, Pikkola Hash is the fast digest. For the session a login creates, Pikkola JWT covers the token.

Questions

Does my password leave the page?

No. The derivation happens in WebCrypto in this tab, the key is drawn from memory and nothing is stored, so a reload forgets the password and the salt. The only request after the page loads is the cookieless page-view count. Still, a real password should never be typed into a page you do not control; use a test passphrase here.

How many iterations should I use?

Use the number your platform's guidance gives and measure it: OWASP's Password Storage Cheat Sheet says 600,000 for PBKDF2-HMAC-SHA256 and 210,000 for SHA-512. If one login takes more than about a quarter of a second on your hardware, pick a lower count rather than accept a login that times out, and write the count in the record so it can be raised later.

Why is SHA-512 allowed fewer iterations than SHA-256?

Because each iteration of HMAC-SHA-512 does more work than HMAC-SHA-256, so fewer iterations buy the same cost. The figures are chosen to be comparable in time, not in count. Compare the measured milliseconds rather than the numbers.

Can I verify an existing Django or PHC hash?

Django's pbkdf2_sha256$600000$salt$hash fits this record shape with the scheme written as pbkdf2-sha256, and its salt and hash are base64, so it verifies here as-is. A PHC string such as $pbkdf2-sha256$i=600000$... uses a different field order and is not read; the parser will say so rather than guess.

Is PBKDF2 still acceptable?

Yes, where a standard, a library or a compliance rule asks for it, and it remains far better than a plain hash. Where you are free to choose, Argon2id with a memory cost is the current recommendation because it makes a GPU's parallelism expensive. This page exists to make PBKDF2 correct and measurable, not to argue it is the best option.