Keeping passwords safe by staying up to date
blog.cloudflare.com
blog.cloudflare.com
But this post explained it all so clearly, I found it immensely useful to put some of the pieces together. Have already shared it with some of my even-less-technical colleagues so they too can appreciate 1) the complexity, 2) the problem, and 3) the importance of their role in setting passwords. Well written JGC!
For those who are interested in how to do the hash upgrade, I wrote a blog post on my personal site here: http://blog.jgc.org/2012/06/one-way-to-fix-your-rubbish-pass...
For Django: https://docs.djangoproject.com/en/dev/topics/auth/#password-...
It may not be be implemented across as many platforms as bcrypt yet, but there's plenty for people to experiment with [1], if only for learning and educational purposes.
1. http://www.freebsd.org/cgi/cvsweb.cgi/ports/security/scrypt/
http://manpages.ubuntu.com/manpages/oneiric/man1/scrypt.1.ht...
http://rubygems.org/gems/scrypt
I fully expect that scrypt will stand the test of time and I'll probably be happy using it.
Repeating it one more time won't change anything.
It's very instructive, especially for people new to this stuff, to see the contrast between bcrypt's CPU-hard algorithm and scrypt's CPU-hard + memory-hard algorithm.
But jgrahamc's clarification above makes sense - it wasn't meant to be a general survey, but only what CloudFlare has done.
E-mailing it around isn't a great idea, certainly, but it's not as bad as storing it reversibly.
// question asked by an attorney who knows nothing about this subject but what he's read on HN.
Plenty of situations where cracking the administrator's password via a custom rainbow table is potentially worth it.
Otherwise, it's silly - building a rainbow table means 1) using a large amount of storage to store the results, and 2) waisting cycles organizing your data in that space to ensure efficient lookup. Doing this makes no sense if you already have the one hash you're going to check against - just do a regular brute-force attack.
See: http://static.usenix.org/events/usenix99/provos/provos_html/...
> "At the time of deployment in 1976, crypt could hash fewer than 4 passwords per second. Since the only known way of inverting crypt is to guess preimages, the algorithm made passwords very difficult to recover from their hashes--so much so, in fact, that the designers of UNIX felt comfortable leaving the password file readable by all users. Today, over 20 years later, a fast workstation with heavily optimized software can perform over 200,000 crypt operations per second. Attackers can now expediently discover plaintext passwords by hashing entire dictionaries of common passwords and comparing the results to entries in a password file."
> "While salted passwords defeat lookup tables, given a particular salt and hash, an adversary can still mount a brute force attack by evaluating F(s,t) on every possible password. It follows that the best security one can achieve is $\epsilon\approx 1/\vert F\vert$, where |F| is the cost in gates of implementing F. Usability requirements therefore effect a lower limit on $\epsilon$--if people can only tolerate a one second delay for checking passwords, F can take at most one second to evaluate. F should not take significantly less, however, as this would unnecessarily weaken security."
> "The number of gates |A| that an adversary can reasonably muster for an attack increases constantly as hardware improves. Fortunately, so does the speed of machines that must legitimately evaluate F. That means passwords should not be hashed by a single function F with fixed computational cost, but rather by one of a family of functions with arbitrarily high cost. Instead of repeatedly throwing out functions like crypt and MD5 crypt to start over with more expensive but incompatible ones, systems should allow the cost of any password manipulation software to scale gracefully with a tunable parameter. Thus, $\epsilon$ can decrease as fast as hardware improves and users will tolerate. Compromised password databases will then enjoy maximum security against off-line attacks."
The purpose of bcrypt was to allow for a single algorithm that can be tuned for existing speed of existing computers to produce a "slow" algorithm. Then, as Moore's law makes computers faster, bcrypt can be progressively slowed to keep pace, so that performing a brute force still takes an unreasonable amount of time.
Which is precisely what calculating a rainbow table involves.
Wouldn't bcrypt without a salt would be vulnerable to a lookup table of the top 100K passwords, say?
Two things:
1. Rainbow tables are today an irrelevance because of the speed of computers. What you need to worry about is not precomputed tables, but the ability to compute hashes when needed. The point of the salt is to prevent you precomputing anything.
2. So, suppose you have a database where (hash, salt) has been compromised for each user. Assuming salt was chosen randomly for each user then attacking the database boils down to calculating the hashes for common passwords incorporating the salt. The security of that will depend on the security of the hash algorithm and its slowness.
I totally get the slow algorithm part. Seems to me that's the trick.
Our IT department is dead set against using password managers. I've been trying to learn why, given companies like lastpass use excessive salting/hashing and slow algorithms. Unfortunately, at this point, I fear my limited knowledge may actually surpass theirs. All I hear is grumbling about all my eggs being in one basket.
jgrahamc, when does the spdy beta start? :)