2 ms·
scrypt has the advantage that it can be memory-tuned and is designed to be both CPU-hard and memory-hard. PBKDF2 and bcrypt are only cpu-hard. Though IME it's
by masklinn 11y ago
scrypt has the advantage that it can be memory-tuned and is designed to be both CPU-hard and memory-hard. PBKDF2 and bcrypt are only cpu-hard.
Though IME it's bcrypt which is considered cooler, scrypt is regularly mentioned in KDF discussions but not widely available let alone used.
The big advantage of bcrypt is its cost factor is exponential rather than linear, so the changes in cost factor are much lower and less frightening (you need to double the pbkdf2 cost factor to double the cost, on bcrypt you just increase the cost factor by 1, to match Moore's Law you just need to increment the cost factor by 1 every 2 years). And that's ignoring pbkdf2 can also be tuned using the hash function.
So is PBKDF2 just fine? Yeah, that's what I generally use. But it's easier to create a simple and correct interface for bcrypt, it has less moving part and the parts which do move move slower.