Earlier quoted context omitted.
No; I use standard, time-proven, secure designs. SHA1(salt + password) is sufficient in almost all cases, and if anybody is capable of deriving the original input from the digest, they can do so no matter what digest algo is used. I know there's lots of ways to screw up security, but most of them derive from lazy people taking shortcuts. They run the httpd, database, and authentication all off the same server so a vu…
SHA1(salt || password) is an incompetent design that is debatably even easier to crack than the Gawker hashes. The insecurity of that construction is why we have PBKDF2. If the entire knowledge you have of cryptography comes from _Applied Cryptography_ --- wait; let me extend that: if you even feel the need to cite _Applied Cryptography_ --- you should be careful debating crypto constructions. You're not going to end…
How To Safely Store A Password
131–140 of 219 posts
Re: How To Safely Store A Password
#132Earlier quoted context omitted.
> That salt is a public value. The security of salted password schemes is meant not to depend on the secrecy of the salt. I don't understand why you'd add extra content to the password unless you keep it secret. The whole point of a salt/nonce is to prevent attackers from attacking the digest, right? You need some per-user data, to defend against rainbow tables, and some per-site data, to protect weak passwords. My f…
Basic version: The salt prevents an attacker from being able to pre-compute a mapping from password hash value. It's most effective when it changes per-password and it doesn't matter if it's public. http://en.wikipedia.org/wiki/Salt_(cryptography)
SELECT username FROM users WHERE password=HASH('secret');
I've seen systems where that statement will give a list of all usernames with the password "secret".Re: How To Safely Store A Password
#133Earlier quoted context omitted.
You're overthinking both the security aspect of this and the performance aspect of it. User-imperceptible hash times are adequate to make most conceivable brute force attacks intractable.
That's true of passwords over a certain strength, for sure. And it always has been; "6ab$TRa?" has never been counting on the difficulty of hashing for security, and probably won't for some time. But as computing power increases, that minimum strength is being pushed out. bcrypt lets us hold the line by keeping pace with computing power— couldn't it also give us the ability to push back? How many users are using the…
False.
Re: How To Safely Store A Password
#134Earlier quoted context omitted.
Imagine this Python code (I'm using SHA1 iterated multiple times, basically PBKDF2): import hashlib hashed = password for i in range(50000): hashed = hashlib.sha1(salt + hashed) Provided we also store the number of iterations (along with the salt), and provided I didn't do anything stupid above, we could simply add more iterations after these 5 years and update hash and number of iterations field. Would it be a viabl…
Yes.
import timeit
t = timeit.Timer(stmt="""\
def test(pwd, n_iter):
for i in range(n_iter):
pwd = hashlib.sha1(pwd).hexdigest()
test('hello', 50000)
""", setup='import hashlib')
print t.timeit(100) / 100
>>> 0.126629960537Re: How To Safely Store A Password
#135Earlier quoted context omitted.
Why would you use this "poor man's approach" over bcrypt or scrypt? My understanding is that these two work on a very similar concept (work factor) and are free to use.
I can think of one reason: Lack of the available libraries on a particular platform.
Re: How To Safely Store A Password
#136Earlier quoted context omitted.
If you have 10 people logging in per second, you put a 1 second delay on future requests which is certainly noticeable. Maybe the correct thing to do is to make the key derivation executed on the client side, but then this would erode the experience of mobile phone users.
There is no way to securely do this clientside. It's hard to imagine a situation in which login overhead is painful where scaling in general isn't already a huge concern; presumably, anything you do after login is going to be more painful than bcrypt.
Re: How To Safely Store A Password
#137Earlier quoted context omitted.
What do you mean by "my salting algorithm is very strong"?
Instead of just concatenating a salt to the password string, I use a dispersion method. I first concat the salt to the beginning of the password and SHA512 that. I then have a globally configured list in my app (it's different for every app I produce) that defines at which index, in the hashed salt+password digest, chunks of the (same) salt are sliced and interspersed. Given the same list of indexes, I can then "find…
This is essentially what bcrypt does for you anyway (in a really crude sense).
Re: How To Safely Store A Password
#138Earlier quoted context omitted.
Why would you use this "poor man's approach" over bcrypt or scrypt? My understanding is that these two work on a very similar concept (work factor) and are free to use.
I can think of one reason: Lack of the available libraries on a particular platform.
Re: How To Safely Store A Password
#139Earlier quoted context omitted.
I think the point is that you should use bcrypt and salt at the same time.
You don't need to do anything like that; bcrypt does all this stuff for you. Don't salt bcrypt.
Re: How To Safely Store A Password
#140Earlier quoted context omitted.
If you lose code execution on your server to an attacker, you're done. 100% fucked. Everything in your environment needs to get stripped down and rebuilt from trusted sources. Do not be one of those people who rationalizes "oh, I just lost uid=4294967294". Gawker lost root. So will you.
And if you lose root, the disk must be reimaged. Rootkits are too advanced these days to ever make the assumption that you have removed them.
http://www.theregister.co.uk/2010/11/23/network_card_rootkit...
(Why yes, I _did_ have that problem weighing on my mind while I investigated several machines that had a weekends worth of exposure to the recent Exim remote root exploit...)