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.
A global salt is not a thing. Not is a pepper. The actual cryptographic construct is an HMAC and secret HMAC key.
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'.
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.
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?
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.
I agree with someone up there that email address != password. It's refreshing to see someone that gives a crap about my privacy though.