4 ms·
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 increasin
by runamok 12y ago
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.
- Arnor 12y agoI 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.
- runamok 12y agoRight 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 foo@example.com" which is why I suggested method 2. I am user "Arnor" and my email is "foo@example.com". Ok, your salt is #@$%@#$%DGDFfdgdawer. If your hashing algorithm is appropriately "expensive" the scan all user salts would not work.
- stouset 12y agoA global salt is not a thing. Not is a pepper. The actual cryptographic construct is an HMAC and secret HMAC key.
- lallysingh 12y ago.. can't you just use a few bits of hashing (via a second algorithm) the original email address for the salt?
- stouset 12y agoNow you just have a different, slightly more complicated hashing function.
- lallysingh 12y agoAh, indeed.
- owenversteeg 12y agoA global salt is called 'pepper'.
- stouset 12y agoThis 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.
- owenversteeg 12y agoI wasn't saying it was a good idea, just that the majority of people using one refer to it as a pepper.
- runamok 12y agoOnce 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.