5 ms·
I salt passwords with the first half of the username at the front and the second half at the back. Is that significantly less secure than generating a random sa
by Hexstream 17y ago
I salt passwords with the first half of the username at the front and the second half at the back. Is that significantly less secure than generating a random salt for each user?
- LargeWu 17y agoIt is if somebody figures out what you're doing, or if you tell them, like you just did... The whole point of doing it randomly is that even if somebody figures out the salt for one user, they would still need to figure it out individually for every other user too. Using a "system", like you're doing, significantly decreases the effort required to figure out the salt. I think it was in WWII where the Americans would intercept the German broadcasts, which were encrypted by Enigma. But because the Germans routinely broadcast the same sorts of information in the same format every day - weather reports, for example, it gave the US a known set of data of limited scope which significantly improved their chances of breaking the codes. What you are doing, especially because you're broadcasting it on the internet, is essentially the same thing.
- cschneid 17y agoI disagree. Salts are not secret. The passwords are. The idea is that it just prevents massive pre-computation attacks, where the same set of precomputed hashes can be reused. At the point there are salts introduced (different for each user), there's no way to precompute a huge rainbow table and use it. So from my un-trained-in-cryptography eyes, the username approach is solid.
- LargeWu 17y agoYes you are correct. I'm not sure what I was thinking there.
- streety 17y agoThe idea behind salting is that you expand the possible options to the point where rainbow tables can't be precomputed. The characters comprising your users usernames would likely be a smaller set than the characters you would use for a random string. As such it would be easier to backtrack to the password from the username salt than a random salt. It's a trade off between storage capacity/simplicity and security. Previously I've used a hash of site-wide random string - password - user specific random string. For my latest project I've moved to phpass which is an implementation of bcrypt. My understanding is that in terms of security: bcrypt > stretched salted hash > hashed salted hash > salted hash > hash > plaintext