Why I Don't Recommend Scrypt (2014)
blog.ircmaxell.com
blog.ircmaxell.com
But now I'm curious: the author states that neither scrypt or PBKDF2 are really designed for password storage. Can anyone explain how a construction designed for this purpose would differ?
Edit: I get that one of the goals for a KDF is to securely hash/expand a short input (password) of N bits out to something potentially >> N bits; and in the case of scrypt, do it in a way that's expensive for bruteforcers but acceptable for authentication.
Is the reason scrypt/PBKDF2 aren't for password "storage" simply because they're not usable as such OOB (missing salt handling which bcrypt gives you for free?)
I think a better take away would be: "If you use scrypt, make sure you choose adequate security parameters. If you're already using bcrypt, there's no need to switch to scrypt."
Edit: the first paragraph of the scrypt paper actually brings up the fact that the problems of password storage and key derivation are equivalent:
Password-based key derivation functions are used for two primary purposes: First, to hash passwords so that an attacker who gains access to a password file does not immediately possess the passwords contained therewithin; and second, to generate cryptographic keys to be used for encrypting and/or authenticating data. While these two uses appear to be cryptologically quite different [...] they turn out to be effectively equivalent
"scrypt is demonstrably weaker than bcrypt for password storage when using memory settings under 4mb"
So don't use memory setting under 4MB. (Duh!)
I often think with the number of hosts in all the botnets out there, some attackers are probably distributing some of the hard work.
Yes, PoW is trying to find near collisions, and password cracking is trying to find direct collisions, but its collisions still the same. What is important here is 'hashrate' which gives you bounds on time to crack your dataset (or find a near collision).
The PoW system adjusts the difficulty based on the current distributed hash-rate, so an individual(or pool) is operating in a percent range of the total hash-rate.
To analogize the two, properly, you'd have to set the PoW system to the highest difficulty, and keep it there for every individual password you want to check.
Also the scrypt currencies have a fixed memory bound, AFAIK. While use in password cases, "could be" modified in the middle, doubling the required time-bound.
ASICs for SHA256 don't break SHA256, and ASICs for scrypt don't break scrypt.
I'm not suggesting this clarification isn't useful, but I was replying to someone claiming that scrypt is effectively broken because there are ASICs for computing scrypt hashes, which according to my understand is not correct.
With hashcash, proof attempt is as hard as proof verification, but there are other asymmetric schemes where the former is much harder.
The first such PoW was primecoin. My own design Cuckoo Cycle is another, that aims to be the most memory bound of all PoWs.
Oh, I understand why they did it. But it still removed the most important property of scrypt. We wouldn't have scrypt ASICs if that change hadn't been made.