News for hackers. Stuff that matters.
Re:How To Safely Store A Password by tptacek on Sunday January 31, 2010 @06:51PM (#1091362)
I'm not even checking your math, because that's 4.8 months to crack one user's password. A spectacular win compared to "salted hashes".
Re:How To Safely Store A Password by sorbus on Sunday January 31, 2010 @10:40PM (#1091722)
I'm sorry if I'm completely misunderstanding, but couldn't a hacker generate a rainbow table once - of all the common passwords, say - and then, once they get a copy of the database in which the password hashes are stored, simply compare them? In the same way that md5 rainbow tables exist, which greatly reduce the computations required when looking for passwords?

Unless, of course, you salt them (which would turn it into 4.8 months to break all the common passwords in a table, building a rainbow table with the salt taken in mind - the only situation in which you're spending 4.8 months per user is if they're each salted differently, for example with the username)- but the article doesn't suggest salting bcrypt, so I'm ignoring that.

Re:How To Safely Store A Password by tptacek on Sunday January 31, 2010 @11:24PM (#1091774)
No. Bcrypted passwords have nonces in them, just like "salted" hashes. You don't have to think about it. You just use bcrypt.
Re:How To Safely Store A Password by boundlessdreamz on Monday February 01, 2010 @12:47AM (#1091877)
Complete noob. Can you explain this more. if you bcrypt(12345) isn't the result always same ? If the hash varies then what does the inbuilt nonce depend on ?
Re:How To Safely Store A Password by tptacek on Monday February 01, 2010 @10:21AM (#1092518)

   >> BCrypt::Password.create("hi,mom", :cost => 10)
   => "$2a$10$L/c.1uoZSh3oaU1fLrnYK.yyU4PiJXsIAzN22qnbU41liyLn5/of  2"
   >> BCrypt::Password.create("hi,mom", :cost => 10)
   => "$2a$10$3F0BVk5t8/aoS.3ddaB3l.fxg5qvafQ9NybxcpXLzMeAt.nVWn.NO"
   >> BCrypt::Password.create("hi,mom", :cost => 10)
   => "$2a$10$VEVmGHy4F4XQMJ3eOZJAUeb.MedU0W10pTPCuf53eHdKJPiSE8sMK"
Despite the pages and pages and pages and pages of conversation about how to select and format "salts", adding random nonces to hashes is not one of the world's great CS problems.
Re:How To Safely Store A Password by boundlessdreamz on Monday February 01, 2010 @03:12PM (#1093327)
I don't understand it still. The cost factor and the string remains the same but different hashes are produced. So if a user inputs "hi,mom" and the app generates a hash, how is it going to be the same as the one in DB ?

Or did you make a mistake and the cost factors are supposed to different ?

Re:How To Safely Store A Password by tptacek on Monday February 01, 2010 @03:55PM (#1093439)
Just do what the library tells you to do to check passwords and trust me that bcrypt hashes already have nonces built into them.
Re:How To Safely Store A Password by kasterma on Monday February 01, 2010 @04:03PM (#1093452)
I had the same question; I don't know the answer yet, but I found a location for the answer http://www.openbsd.org/papers/bcrypt-paper.ps

The documentation for py-bcrypt ( http://www.mindrot.org/projects/py-bcrypt/) doesn't explain what happens, but shows use is very very easy.

EDIT: current guess is that searching for the salt that was used might be part of what makes it hard.