by mijoharas · 5y ago · 0 comments
Why would you pick one over the other? Or are both "pretty much fine" for most workloads and a casual user shouldn't worry too much?
bcrypt, scrypt, Argon2: it doesn't practically matter. Actual cryptographers don't stop recommending safe and well-tested algorithms just because newer ones have been published. There has been no cryptanalytic break in bcrypt or scrypt. The benefits of Argon2 are largely academic for common workloads.
So something like pbkdf2 is intended to be "CPU hard" ie: it bottlenecks you on CPU. Then people started using GPUs for pbkdf2.
So we got bcrypt, which is CPU hard and uses enough memory that a GPU stops being particularly practical.
And then people build ASICs to bruteforce bcrypt faster. So we got scrypt and argon2, which are memory hard.
But the thing is that even PBKDF2 is pretty good. You can always just bump up the iteration count for PBKDF2 to increase security. I use a combination of PBKDF2 and bcrypt myself (pbkdf2 on the frontend, bcrypt on the backend).