Live data from Hacker News

A Better Way to Store Password Hashes?

opine.me

31–40 of 59 posts

Re: A Better Way to Store Password Hashes?

#31
post #23
post #14

Earlier quoted context omitted.

Thanks for citing your source! You rock. They are claiming 6.57 * 8 = 52.5 bits of entropy would cost $4.8m to crack a single password in a year. They also state 4.7 * 8 = 37.6 bits of entropy would cost $150 to crack a single password in a year. Their own citation of 'A large scale study of web password habbits' http://research.microsoft.com/pubs/74164/www2007.pdf found that the average password has only 40.5 bits o…

[deleted]

[deleted]

Re: A Better Way to Store Password Hashes?

#33
post #29

This won't make an appreciable difference if your entire db is captured by the attacker (ala LinkedIn). You are just asking them to buy a box (rent a virtual server) with more RAM because the equals operation just became memory intensive. A machine with 128GB of RAM will still give a near-constant result to "does my test hash equal the user's password?" "Just add more fake hashes", you say. To get around the above, y…

This is absolutely only to be used with bcrypt or scrypt, not instead of. Facebook has 100PB of data, but all the password salts and hashes for their 800m active users fits on a single USB stick . One maligned employee and that data can walk right out the door. The theft of all your users' passwords should make one heck of a racket on its way out of your data center. A thief should need the equivalent of a 747 to fly…

[deleted]

Re: A Better Way to Store Password Hashes?

#34
This would increase the complexity of the hash verification by log2(N) times, where N is the number of user records. So even if you do have a billion hashes, you only slowed the attackers 30 times. You might as well increase the BCRYPT complexity and skip this scheme.

Re: A Better Way to Store Password Hashes?

#36
post #34

This would increase the complexity of the hash verification by log2(N) times, where N is the number of user records. So even if you do have a billion hashes, you only slowed the attackers 30 times. You might as well increase the BCRYPT complexity and skip this scheme.

This should be used with scrypt or bcrypt set to the highest difficulty your application can support.

The point is to increase difficulty of targeting an individual user, and increase difficulty of stealing the data in the first place. This is separate and distinct protection from what scrypt/bcrypt gives you.

[Edit] In a typical GPU accelerated brute force attack, the target hash and salt are both known as fixed 20 or 32-byte values, and you iterate through candidate passwords until you find a match.

In the proposed technique, the target hash is NOT known! Instead, what you do know is a salt and a list of a few billion hashes, ONE of which can be obtained by combining the salt with some unknown password. This is a very different equation, and I believe, much harder to solve, since your target value can't just be kept in a register or L1 cache for comparison purposes.

Re: A Better Way to Store Password Hashes?

#37
I think you need to make sure that each user has a unique salt.

If you happen to assign me the same salt as another user then either my or their password will unlock either account and the attacker only needs to guess the weaker of the passwords.

Re: A Better Way to Store Password Hashes?

#38
post #37

I think you need to make sure that each user has a unique salt. If you happen to assign me the same salt as another user then either my or their password will unlock either account and the attacker only needs to guess the weaker of the passwords.

Absolutely correct. A 'salt' by definition, is always random.

For example, you could use a 32-byte salt with scrypt and you would get back a 32-byte hash. Both are equally unlikely to ever collide (see numbers in the article) even with trillions of entries in the table.

Re: A Better Way to Store Password Hashes?

#39
post #17

Earlier quoted context omitted.

Current algorithms allow you to increase cost in terms of CPU and RAM only. I want to increase cost on as many axis as possible, in this case, by requiring you to steal 1TB of mostly meaningless data, and not just 100 odd bytes. [Edit] sillysaurus - It's a great image, but a little hard to parse since it doesn't actually show you the bits of entropy for each choice. If they did show a column for 40.5bits (average str…

It's worse than the average strength would suggest, too. You can't do an arithmetic average and get a meaningful figure because cracking difficulty doubles with every bit. Say passwords were distributed evenly at 35, 40.5 and 46 bits. You may have a lot of difficulty cracking the 46-bit passwords, but the 35-bit ones will be easy. Now, you can't tell which users have easy passwords, but it's easy enough to try the "t…

You can't do a join because the hash table contains only hashes - nothing to relate them back to the user record.

This idea uncouples the password from the username and salt, which seems a good idea. But assuming you have access to the database, the additional work required is an indexed lookup instead of a simple equality - not actually a huge deal.

Having said that, when it comes to security I'll defer every time to someone with real chops in this area. Wake me up when Bruce Schneier comments on this.

Re: A Better Way to Store Password Hashes?

#40
post #38
post #37

I think you need to make sure that each user has a unique salt. If you happen to assign me the same salt as another user then either my or their password will unlock either account and the attacker only needs to guess the weaker of the passwords.

Absolutely correct. A 'salt' by definition, is always random. For example, you could use a 32-byte salt with scrypt and you would get back a 32-byte hash. Both are equally unlikely to ever collide (see numbers in the article) even with trillions of entries in the table.

With this scheme random isn't quite enough though, it needs to be unique as well doesn't it?
Post reply on HN