News for hackers. Stuff that matters.
Re:Project Euler Returns by runamok on Friday August 15, 2014 @03:45PM (#8183783)
You could have one of two approaches. 1. Don't use a per user salt and just use a global salt. You can counteract this decrease (a bit) in security by increasing the key stretching part of your hashing algorithm. or 2. Require the user to submit their email address AND username and store the salt in the user's record.

I agree with someone up there that email address != password. It's refreshing to see someone that gives a crap about my privacy though.

Re:Project Euler Returns by Arnor on Friday August 15, 2014 @04:42PM (#8184075)
I had a visceral reaction to "global salt" (I've always heard this called: "pepper") because it's so insecure for passwords, but I guess it's not as bad for email addresses. In the case of passwords, we find that a global salt is fairly ineffective because too many people use common (stupid) passwords like "password." If 10% of the hashes are the same, you can probably figure out what that hash means pretty quickly. We don't have this overlap problem with emails so it's less scary.

Still, simply storing the create time or a randomly generated salt right on the user table is more secure than using a global salt.

Re:Project Euler Returns by stouset on Saturday August 16, 2014 @03:31AM (#8185640)
A global salt is not a thing. Not is a pepper. The actual cryptographic construct is an HMAC and secret HMAC key.
Re:Project Euler Returns by runamok on Friday August 15, 2014 @05:12PM (#8184249)
Right but in this case you would essentially have to use every salt from every user to hash the submitted email and say "aha user 123,456 has a salt and hashed email which matches the submitted email of [email protected]" which is why I suggested method 2. I am user "Arnor" and my email is "[email protected]". Ok, your salt is #@$%@#$%DGDFfdgdawer.

If your hashing algorithm is appropriately "expensive" the scan all user salts would not work.

Re:Project Euler Returns by owenversteeg on Friday August 15, 2014 @07:31PM (#8184870)
A global salt is called 'pepper'.
Re:Project Euler Returns by stouset on Saturday August 16, 2014 @03:21AM (#8185620)
This thread is dishearteningly full of cargo-culted cryptography. You would think HN would do better. A global salt is not a thing. It's a misapplication of a cryptographic component. The appropriate tool when you think you need something like this is an HMAC and a secret HMAC key.
Re:Project Euler Returns by runamok on Sunday August 17, 2014 @08:47PM (#8191017)
Once again we are talking about having an email retrieval function while not storing the email address in plaintext. A "global salt" or "pepper" (as we are apparently calling it now) just prevents enormous pre-generated rainbow tables but admittedly in today's gpu dominated cracking environment it probably doesn't get you much.

Personally I think not having a password retrieval function while simultaneously forcing all of your users to reset their password is a pretty user unfriendly tactic for the protection of an ostensibly public piece of information.

Re:Project Euler Returns by owenversteeg on Saturday August 16, 2014 @05:29AM (#8185777)
I wasn't saying it was a good idea, just that the majority of people using one refer to it as a pepper.
Re:Project Euler Returns by lallysingh on Friday August 15, 2014 @07:02PM (#8184768)
.. can't you just use a few bits of hashing (via a second algorithm) the original email address for the salt?
Re:Project Euler Returns by stouset on Saturday August 16, 2014 @03:23AM (#8185625)
Now you just have a different, slightly more complicated hashing function.
Re:Project Euler Returns by lallysingh on Monday August 18, 2014 @10:49AM (#8192861)
Ah, indeed.