5 ms·
PBKDF2 is worse than bcrypt. By roughly a factor of 5. scrypt is better than bcrypt. By roughly a factor of 4000. why do I care whether something is a PKCS
by cperciva 15y ago
PBKDF2 is worse than bcrypt.
By roughly a factor of 5.
scrypt is better than bcrypt.
By roughly a factor of 4000.
why do I care whether something is a PKCS standard or not?
You don't care, and I don't care, but I'm sure you know lots of companies which do care (especially since PBKDF2 is a NIST standard too).
- tptacek 15y agoFor what it's worth: when dealing with banks and financial firms, where any technology without an adequately staid and reassuring web presence is frowned upon, we happily recommend PBKDF2. There's nothing "wrong" with PBKDF2. It's just not as good as bcrypt.
- regularfry 15y agoWhen we were looking at password hashing, and the choice came down to bcrypt or scrypt (about a year ago, so recently enough), I said we should go for bcrypt because scrypt was comparatively new; inasmuch as it makes a difference, it's just had less time to be attacked. Was I wrong?
- zobzu 15y agoits a sane decision. just make sure you implement properly. like everything crypto, it will be broken, eventually. but its a safer choice than a new algoritm. it reminds me of the vulnerability issues. when apps have no known vulnerabilities, all is fine. when a new "instant root compromise of any system" comes out, its omgomgomg. Then its fixed, and all is fine again. Except that vulnerability was always there. And other ones that are yet to be public are there too. And many of them are "omgomgomg" material. Well crypto is the same. We don't have public data on which algorithm are broken. We just know they will be eventually, by logic or by brute force. So, take the wise decisions, and don't forget you might eventually need to update it.
- cheald 15y agoThis is a naive attitude. Mathematically-secure cryptography with an implementation that avoids all side-channel attacks is unbreakable, as in, would take more time than the projected heat death of the universe to brute force. That's not to say that all implementations are secure, or that there are not undiscovered mathematical flaws in common algorithms, but the idea that all encryption is brute-forcable given enough AWS instances is just plain incorrect.
- mikeash 15y agoHow do you know that mathematically-secure cryptography can actually exist?
- willvarfar 15y agoThis is not related to password hashing algorithms being discussed here, but: mathematically-secure cryptography was invented in 1882/1917: http://en.wikipedia.org/wiki/One-time_pad http://en.wikipedia.org/wiki/One-time_pad Fun further reading: http://en.wikipedia.org/wiki/Venona_project http://en.wikipedia.org/wiki/Venona_project Also, fun reading: The Code Book by Simon Singh, and Spycatcher by Peter Wright
- dekz 15y agoI don't think I follow your definition of 'Mathematically-secure' is this even an attainable definition? To expect all crypto to be eventually broken is an attitude with foresight.
- repsilat 15y ago> Mathematically-secure cryptography ... is unbreakable To expand on sibling comments: Cryptography essentially depends on the assumption that P=NP (well, not exactly, but...). It's possible, though unlikely, that mathematical discoveries could undermine all possible conventional cryptographic schemes. As for brute-force, that's a tricky one as well. If you allow a strengthening of Moore's law that says that operations per second per dollar increase exponentially, then you can construct the following "polynomial time" algorithm for any cryptographic problem: Wait n*k years, where - n is the problem size in bits, and - k is a scaling factor to get the exponents to align Buy a computer Run the brute force algorithm on your new computer
- maaku 15y agoNo you were not wrong. That is the correct, conservative attitude to take in most instances.
- marshray 15y ago> By roughly a factor of (5|4000). Do you have this written up anywhere? Link?
- dhimes 15y agoThere are a couple of links on this page: http://www.tarsnap.com/scrypt.html http://www.tarsnap.com/scrypt.html
- marshray 15y agoOK, it's in the Scrypt paper. http://www.tarsnap.com/scrypt/scrypt.pdf http://www.tarsnap.com/scrypt/scrypt.pdf Here's my opinion on this: * These numbers are more appropriately expressed exponentially. I.e. "factor of 5" = 2 bits of security. * 2 bits of security is not significant at all. * The Scrypt x5000 seems to only apply when your attacker has access to a chip foundry and it buys you maybe about 12 bits of security against such an attacker. * For comparison, 128 bits of security is often considered a minimum for resisting offline bruteforce attacks (e.g. AES has a 128 bit key). Of course passwords usually don't come anywhere near close to 128 bits of effective security, so 12 bits might make the difference for some of them if you're lucky. * In a sense, table 1 in the Scrypt paper shows that the relative difference between the functions is less significant than even relatively small variations in password strength. When the defender has 100ms of CPU to spend authenticating each password, all three functions compared cost less than $200 to break an 8 letter password and more than $150M to break a 10 character password. * Very few attackers are going to actually spend $M++ trying to break your password (cue XKCD strip). A relevant exception might be botnets, the operators of which don't pay the power bill for their computations. Therefore, I conclude that for most purposes these functions are mostly equivalent and quality-of-implementation and password strength issues dominate in practice.
- JoachimSchipper 15y agoYou're right, but don't forget Deep Crack. (FPGA-)hardware-based attacks have only become cheaper since then; I would be surprised if the NSA doesn't have a few arrays. (Also, 80 bits is usually enough to withstand attack, no?)