PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (2024)


PBKDF2 is worse than bcrypt.

scrypt is better than bcrypt.

bcrypt has the advantage of being both very good, and also broadly available on web platforms. scrypt does not yet have that advantage; when it does, I will start saying "just use scrypt".

But the simple fact is: all three of these functions are fine. ANY of them is a huge step forward from what people do without them.

"Just use bcrypt" is 1000x more effective as a meme than "just use adaptive hashing" (which is what all these constructions are).

So, while I have few specific technical qualms with this article (e.g. why do I care whether something is a PKCS standard or not?), the overall message is a bit hyperbolic.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (1)

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).

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (2)

tptacek on March 19, 2012 | parent | next [–]


For 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.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (3)

regularfry on March 19, 2012 | parent | prev | next [–]


When 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?

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (4)

zobzu on March 19, 2012 | root | parent | next [–]


its 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.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (5)

cheald on March 19, 2012 | root | parent | next [–]


This 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.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (6)

repsilat on March 20, 2012 | root | parent | next [–]


> 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
PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (7)

mikeash on March 19, 2012 | root | parent | prev | next [–]


How do you know that mathematically-secure cryptography can actually exist?

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (8)

willvarfar on March 20, 2012 | root | parent | next [–]


This 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

Fun further reading: http://en.wikipedia.org/wiki/Venona_project

Also, fun reading: The Code Book by Simon Singh, and Spycatcher by Peter Wright

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (9)

dekz on March 19, 2012 | root | parent | prev | next [–]


I 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.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (10)

maaku on March 19, 2012 | root | parent | prev | next [–]


No you were not wrong. That is the correct, conservative attitude to take in most instances.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (11)

marshray on March 19, 2012 | parent | prev | next [–]


> By roughly a factor of (5|4000).

Do you have this written up anywhere? Link?

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (12)

marshray on March 19, 2012 | root | parent | next [–]


OK, it's in the Scrypt paper. 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.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (13)

cperciva on March 19, 2012 | root | parent | next [–]


The Scrypt x5000 seems to only apply when your attacker has access to a chip foundry

If your attacker is using GPUs, scrypt probably gives you an even bigger win, due to the compute/memory balance they use.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (14)

marshray on March 19, 2012 | root | parent | next [–]


So I reckon he won't use GPUs then, eh?

Note that the defender pays a cost for this too though. Where he could be happily running PBKDF2 or Bcrypt in multiple Apache process on his multicore servers, Scrypt is going to completely trash the L2/L3 caches and saturate the memory bus and make everything else on the server run like a dog.

Scrypt is operating as designed, of course, but it raises the question of whether or not a defender with a busy website on a farm of multicore servers would be able to configure his work factor as high (in terms of single thread benchmark ms) with Scrypt as he would with Bcrypt or PBKDF2.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (15)

moxie on March 19, 2012 | root | parent | next [–]


I tend to think of this stuff from the cloudcracker.com perspective, which is all about cheap jobs rather than millions spent. I rarely do brute force because, honestly, it's rarely necessary. But the single biggest factor in cloudcracker.com support of a hash format really is its efficiency in GPU space.

For instance, right now I'm implementing support for the modern SHA-512 crypt() variation. It doesn't translate well into GPU space at all, which will end up meaning that I can only offer dictionaries that are half a trillion words smaller than formats which are fast on GPUs.

So far the data I'm seeing indicates that differences of that scale in dictionary size really do make a difference on the success rate of the job. So for what it's worth, from that perspective, it is a factor.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (16)

Xylakant on March 19, 2012 | root | parent | prev | next [–]


I've yet to see a website that get bogged down with authentication request in normal operation, even if those request measure in the multiples of 10ms. The basic idea with all those "slow" password hashes is that authentication is a pretty rare request compared to all other request. Usually authentication requires a single request, at most a handfull. If you run into trouble with bcrypt/scrypt on your webservers, you're doing things wrong. If you have that many authentication requests, direct them to a dedicated server - you'll be in the league that has a large farm running anyways.

Granted, an attacker could use your slow hash for a DOS-attack, but most websites I've seen so far always had some sort of slow operation that was easily exploitable without authentication.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (17)

marshray on March 19, 2012 | root | parent | next [–]


OK, but what if you're a web app that specializes in authentication (like, say, an Oath provider) or a database server where the attacker-facing app doesn't use connection pooling?

> but most websites I've seen so far always had some sort of slow operation that was easily exploitable without authentication

Yes, but those things are typically easy to optimize or temporarily disable in a hurry once they come under attack. Not so much with authentication.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (18)

Xylakant on March 20, 2012 | root | parent | next [–]


> OK, but what if you're a web app that specializes in authentication (like, say, an Oath provider)

Then I'd hope that you make extra double sure that your user's passwords are secure. Let's call it the cost of business.

> or a database server where the attacker-facing app doesn't use connection pooling?

We're talking how to store user-passwords here, don't we? If your database server passwords get lost or cracked, change them. Use random-generated passwords, don't reuse them.

>> but most websites I've seen so far always had some sort of slow operation that was easily exploitable without authentication

> Yes, but those things are typically easy to optimize or temporarily disable in a hurry once they come under attack. Not so much with authentication.

That depends on the website. If your major content is available unauthenticated, then you might as well go and disable authentication. My major point was that you can't defend against a DOS attack by using a weaker password hash, the attacker will just throw more requests at you. In a DOS, the attacker does have the advantage of needing less computational ressources.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (19)

marshray on March 20, 2012 | root | parent | next [–]


The discussion is about best practices and the relative merits of password hashing functions. So the baseline assumption is that the server-side password database isn't perfectly secure.

In practice, the user gets to choose the password and the website at best gets to veto it or accept it without knowing how many other places it's re-used. There aren't too many sites assigning randomly generated passwords right now, I wish there were more.

Yes, some DoS attackers may be able to throw more and more resources at you until you go down. But some don't and you don't have to make it easy for them by preemptively DoSing yourself with too much password hashing! Alternatively: for some fixed amount of attacker DoS resources, your system can support a certain amount of password hash cracking resistance. Cracking resistance is thus a tradeoff with DoS resistance. The root cause of this situation is the poor entropy present in many users' choice of passwords.

Turning off authentication is generally not an option if your site has any data worth securing. If it were, an attacker could bypass your access controls by simply DoSing you until you disabled authentication.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (20)

Xylakant on March 20, 2012 | root | parent | next [–]


> The discussion is about best practices and the relative merits of password hashing functions. So the baseline assumption is that the server-side password database isn't perfectly secure.

That's right. So I don't see where database connection pooling is part of the issue and that's what my remark about random generated passwords was pointed at. You should use secure passwords to authenticate your app at the database. You should probably use md5 [1] or similar as password hashing scheme for the database credentials since this is where you really have a valid tradeoff between performance and security that allows any attacker to bog down your database. But this issue is not the scope of this discussion.

It's certainly a valid technical concern to not increase your password hashing work factor to a point where this it is a valid attack vector for DoS attacks, my point simply is that you can go quite far in terms of work factor until you reach that limit. Increasing the work-factor to a point where authentication takes 10ms will in many cases still leave other parts of your application more vulnerable.

And well, turning off authentication should imply denying access to data that requires authentication. This certainly is an option if the majority of your data is available for unauthenticated users. It certainly is not if you only store data worth securing.

[1] as postgres and mysql both do

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (21)

moxie on March 19, 2012 | root | parent | prev | next [–]


Yep, I work close to an extremely high traffic OAuth endpoint. I think scrypt would probably "cost" a lot more in terms of actual servers required to operate it.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (22)

cperciva on March 20, 2012 | root | parent | next [–]


scrypt is tunable; you can make it use as much or as little CPU time as you want. For any particular amount of CPU time, scrypt will give you more security than bcrypt or PBKDF2 would give you for the same amount of CPU time.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (23)

marshray on March 20, 2012 | root | parent | next [–]


Perhaps it's more accurate to measure scrypt in terms of cache misses rather than CPU time? This is a different resource on multicore servers with different performance implications (at least if we're down to counting 3 or 4 bits of security).

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (24)

sirclueless on March 19, 2012 | root | parent | prev | next [–]


I thought the definition of "better" in this case is that it requires less work to get the same computational strength with scrypt. Are you saying that the memory locality issues that scrypt causes more than cancel out the computational win?

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (25)

marshray on March 19, 2012 | root | parent | next [–]


In this context, work is computational strength so what we're mainly concerned about is an attacker finding a way to do the task significantly more efficiently than the defender. E.g., if the attacker can evaluate the function with half the cost on his power bill relative to the defender, then that can be thought of as knocking off 1 bit of security off the top.

The primary advantage of Scrypt over the others is that it enters a completely pathological memory locality access pattern and stays there for almost the whole function. This works to neutralize the advantage of an attacker who has a custom CPU because he probably can't also develop a custom RAM subsystem to feed it with (at least not one that's many times more efficient than what the defender has in his server).

But if you've done any performance tuning on multithreaded code, you know that cache effects caused by memory access patterns very quickly begin to dominate as multiple cores and threads are added. Things that look great in single-threaded benchmarks almost never scale linearly and there's probably nothing that will scale worse on our shared-memory multiprocessors than Scrypt. It's a feature.

So the defender (say, a busy website with commodity multicore servers) with Scrypt is likely not going to be able to take as good an advantage of his hardware. He won't be able to crank up the work factor quite as high as he could with Bcrypt or PBKDF2.

This may represent an advantage to the attacker, who doesn't have the additional constraint of keeping the response time up on a busy webserver. This attacker's advantage is probably not significant by cryptographic standards (maybe 2 or 3 bits of security lost), but pathological multithreading could represent a big issue operationally.

I'm honestly not trying to cast FUD on Scrypt here, I think it's the best function. I'm just saying like everything else multithreaded you really need to benchmark it under real-world conditions.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (26)

cperciva on March 20, 2012 | root | parent | next [–]


scrypt's memory access pattern isn't particularly pathological; it's random, sure, but it reads large blocks.

The key issue isn't the design of the RAM subsystem but instead the design of the RAM subsystem -- in particular, making sure the attacker can't "cheat" by using a smaller circuit than the defender.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (27)

JoachimSchipper on March 19, 2012 | root | parent | prev | next [–]


You'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?)

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (28)

marshray on March 19, 2012 | root | parent | next [–]


Yep. There are off-the-shelf FPGA arrays available. Still, bad guys would probably find it much cheaper to rent botnet time for a $0.02/(host*day) or whatever the going rate is.

A solid 80 bits of security out of any of these functions might turn out to be safe forever. But, in practice, most password databases are going to have some fraction of users choosing passwords straight out of the cracker's dictionary, some fraction that will never ever be cracked, and the smallest fraction being crackable according to the defender's choice of work factor.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (29)

JoachimSchipper on March 19, 2012 | root | parent | next [–]


COPACOBANA cost ~$10 000 and apparently is as fast as 2500 PCs for the DES cracking it's optimized for, so ~$4/PC-work-unit plus insignificant power costs. You'd need to find someone with experience with implementing crypto in hardware, though. On the other hand, botnets risk detection.

(If you're buying in bulk, ASICs are cheaper, but few will be willing to pay for that much cracking power.)

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (30)

mukyu on March 19, 2012 | root | parent | next [–]


http://events.ccc.de/congress/2010/Fahrplan/events/4203.en.h...

precis: exhaustive search on DES for $1000 in FPGAs from eBay, 2 years ago

DES is in the range of 'costs less than a new phone/iPad' to do an exhaustive search at this point

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (31)

marshray on March 19, 2012 | root | parent | prev | next [–]


Yeah, I suspect it depends on your bad guys (er, sorry, "threat model") whether or not they feel more comfortable trying to buy botnet time or acquire $10,000 worth of FPGAs in an untraceable way.

If I were a bad guy, I would prefer to not have a password-cracking special-purpose supercomputer in my possession. (But I'm not a bad guy, and in fact I would love to have a few around the house. :-)

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (32)

dhimes on March 19, 2012 | root | parent | prev | next [–]


There are a couple of links on this page:

http://www.tarsnap.com/scrypt.html

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (33)

haberman on March 19, 2012 | prev | next [–]


> PBKDF2 is worse than bcrypt.

You seem to be speaking only to its compute time -- what do you say to the article's claim that bcrypt has a higher probability of having an unexpected attack that mitigates its computational complexity?

Also, since all of these algorithms have adjustable work factors, what does it even mean to say that one is stronger than another? Couldn't you just calibrate the work factors so that they are equivalently strong? Though naturally scrypt has strength in another dimension also (memory).

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (34)

tptacek on March 19, 2012 | parent | next [–]


It's nonsensical. It essentially argues that SHA2 is less likely to have cryptographic results relevant to hashing in the next 5 years than Blowfish. It's also an argument the post doesn't support with any actual evidence.

But that's not my issue with the article. My issue with the article is that it takes a simple security issue with no "real" wrong answers and turns it into a tribal conflict, which has the net effect of reducing the number of people who will use adaptive hashing at all.

I'm familiar with Tony Arcieri's work and generally think highly of him; this article, though, is inexplicable and smacks of hipsterism. "I liked Nirvana but then they got popular and sold out, so now I listen to Sleater Kinney". Well, that's going to sound dumb in 10 years.

Let me say yet again that if you use PBKDF2, bcrypt, or scrypt, you are going to look smarter than the average webdev, no matter which one you pick. Do whichever is easiest.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (35)

bascule on March 19, 2012 | root | parent | next [–]


I fully admit the title is linkbait. My goal was to get people interested in the alternatives to bcrypt.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (36)

JoachimSchipper on March 19, 2012 | root | parent | next [–]


Why? "Use bcrypt" is boring from a crypto-nerd point of view, but it's a really useful meme.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (37)

bascule on March 19, 2012 | root | parent | next [–]


I thought I explained that in my blog post. scrypt is superior to bcrypt in every regard.

At the very least, I'd rather the meme be: Use bcrypt, scrypt, or PBKDF2.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (38)

tptacek on March 19, 2012 | root | parent | next [–]


The problem is that PBKDF2 isn't superior to bcrypt in every regard:

* It has marginally worse library support and is built out of universally available primitives, which increases the odds that generalist devs will DIY it.

* It is actually faster than bcrypt (see Colin's paper); in other words, even without waiting for a hypothetical research result against bcrypt, PBKDF2 is already "vulnerable".

* PBKDF2 deployments virtually all use SHA2 as their PRF, and PBKDF2/SHA2 is a construction that depends entirely on the security of hash functions; hash functions are more poorly studied than block ciphers.

* Attacker tools are (mostly, but not entirely) built out of preexisting infrastructure and not by cryptographers; of the three functions, the best accelerated brute force support is available for PBKDF2/SHA2. For instance, is there a widely-available GPU implementation of bcrypt?

* The standards process that ran for PBKDF2 did not include the extensive peer review that (say) AES went through, and isn't a significant asset for PBKDF2. Meanwhile, bcrypt had broad deployment long before PBKDF2 was widely deployed, and on higher-value target systems.

You'd rather the meme be "Use bcrypt, scrypt, or PBKDF2". I'm fine with that meme! But that's not what you said. You said "please don't use bcrypt".

PBKDF2 isn't bad. It has one significant asset: you can point to a PKCS standard to convince pointy-haired product managers to accept it into systems. But given the choice between an HN cargo cult and "technology made palatable to enterprise-grade engineering managers", I'll take the cargo cult in this instance.

(Another strength of PBKDF2 that it shares with scrypt but not bcrypt: you can use it as a proper KDF for your AES keys... but note that if you need to generate your own AES keys, you're very likely in trouble for other reasons).

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (39)

JoachimSchipper on March 19, 2012 | root | parent | next [–]


I agree, but:

> PBKDF2 deployments virtually all use SHA2 as their PRF, and PBKDF2/SHA2 is a construction that depends entirely on the security of hash functions

A quick look at Wikipedia (and my own recollection) suggests that it may be more commonly used with HMAC-SHA2. Although the HMAC construction is not provably secure [1] and poorly understood, it seems to be fairly resistant to attack (e.g. HMAC-MD5 is not known to be broken, AFAIK.) Also, iterated hashes are much harder to break than single hashes.

[1] Bellare has a result based on a nonstandard but not entirely implausible assumption about the underlying hash function, IIRC. But, as you point out, hash functions are poorly understood...

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (40)

tptacek on March 19, 2012 | root | parent | next [–]


You're right, but the kinds of research results that would accelerate a brute force PBKDF2/HMAC-SHA2 cracker are a superset of the results that would jeopardize HMAC-SHA2 as a MAC. Not to downplay it (it's very important that you get HMAC right) but HMAC-SHA2 is just double-applying SHA2.

I was imprecise, but my point is just, PBKDF2/xSHAx is a construction that relies entirely on the properties of cryptographic hash algorithms; scrypt and bcrypt rely instead on properties of ciphers.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (41)

marshray on March 19, 2012 | root | parent | next [–]


Except that SHA-1 and SHA-2 are constructed from a block cipher too.

"SHACAL". Look it up! ;-)

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (42)

drivebyacct2 on March 19, 2012 | root | parent | prev | next [–]


Which is fine, but you've clearly dressed it up as flamebait "don't use bcrypt" outright.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (43)

bdhe on March 19, 2012 | prev | next [–]


PBKDF2 is worse than bcrypt.

Can you elaborate a little bit on this? Or point to a reference. Wikipedia mentions that PBKDF2 is easier to implement with ASICs or GPUs. Is that the primary reason?

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (44)

j_baker on March 19, 2012 | prev | next [–]


How does one stay up-to-date on this stuff? Or is it just something that's easier to remember for someone who specializes in security?

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (45)

tptacek on March 19, 2012 | parent | next [–]


bcrypt is something like a decade old. You don't have to stay up-to-date on it. The vulnerability that bcrypt accounts for dates back to 1972.

All you have to do is not design your own password hashes with SHA-2 (or Whirlpool or CubeHash or whatever some random Stack Overflow answer says you should use). You can safely keep PBKDF2, bcrypt, and scrypt in your bag of tools --- of those, only scrypt is recent --- and reach for whichever one is easiest.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (46)

bascule on March 19, 2012 | prev | next [–]


I can't speak for other platforms, but at least as far as Ruby goes:

 $ gem install scrypt Building native extensions. This could take a while... Successfully installed scrypt-1.0.3 1 gem installed
PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (47)

Xylakant on March 20, 2012 | parent | next [–]


Still I'd stick with bcrypt for ruby. It's in ActiveModel, so it's in Rails. It's in Authlogic. It's the default password storage in Datamapper. I can just point my fellow developer towards the documentation and say "use bcrypt" and be reasonably sure that a basically competent developer will get it right. That's a good thing in my book. Neither scrypt or PBKDF2 have that level of integration so far. When that changes, I'll reevaluate my decision.

Still, it's certainly good to keep in mind that there are alternatives, usage profiles and requirements differ and so do the solutions.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (48)

tptacek on March 19, 2012 | parent | prev | next [–]


You can't go wrong with Ruby scrypt.

But then, unless you give up and don't use any of the three, you can't go wrong with any of these constructions.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (49)

Isn't that a self-fulfilling prophecy? If you buying into the "just use bcrypt" idea, how will scrypt ever change the fact that it's not widely available on the web?

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (50)

tptacek on March 19, 2012 | parent [–]


I addressed this directly downthread. I don't care whether TweetYourCatFood.com uses bcrypt. Specifically, I care that:

* It's got a reliable Gem for Ruby

* It's got a reliable easy_install package for Python

* It's got a good reliable CPAN entry for Perl

* It's got a Java jar file from a reputable source

* It's got a .NET assembly from a reputable source

And what I'm saying is not that scrypt will be "safe to use" when that happens. scrypt is safe to use now; safer, marginally, than bcrypt. What I'm saying is that when that set of things happens, I will personally stop recommending bcrypt and start recommending scrypt. And I only point that out because I always feel a little bad about not recommending scrypt, which is strictly speaking better than bcrypt.

PBKDF2 is worse than bcrypt. scrypt is better than bcrypt. bcrypt has the advant... (2024)
Top Articles
Is Ergo Mining Worth it? Uncovering Ergo's Mining Process | HackerNoon
Bridging and VLANs | Junos OS
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Stevie Stamm

Last Updated:

Views: 5841

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Stevie Stamm

Birthday: 1996-06-22

Address: Apt. 419 4200 Sipes Estate, East Delmerview, WY 05617

Phone: +342332224300

Job: Future Advertising Analyst

Hobby: Leather crafting, Puzzles, Leather crafting, scrapbook, Urban exploration, Cabaret, Skateboarding

Introduction: My name is Stevie Stamm, I am a colorful, sparkling, splendid, vast, open, hilarious, tender person who loves writing and wants to share my knowledge and understanding with you.