Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Salting: Is it reasonable to use the user name?

Tags:

hashtable

salt

I am debating using user-names as a means to salt passwords, instead of storing a random string along with the names. My justification is that the purpose of the salt is to prevent rainbow tables, so what makes this realistically less secure than another set of data in there?

For example,

hash( md5([email protected]), p4ss\/\/0rD)

vs

hash( md5(some_UUID_value), p4ss\/\/0rD)

Is there a real reason I couldn't just stick with the user name and simplify things? The only thing my web searching resulted was debates as to how a salt should be like a password, but ended without any reasoning behind it, where I'm under the impression this is just to prevent something like a cain-and-able cracker to run against it without being in the range of a million years. Thinking about processing limitations of reality, I don't believe this is a big deal if people know the hash, they still don't know the password, and they've moved into the super-computer range to brute force each individual hash.

Could someone please enlighten me here?

like image 454
Incognito Avatar asked Jul 27 '10 19:07

Incognito


People also ask

Can I use username as salt?

Usernames must never be used as salt values. They are not only predictable but are also heavily overused by the user across several sites. This reduces their security. Since these usernames such as 'admin' and 'root' are very commonly looked up as well, it is easy to crack the hashes and cause a breach of privacy.

Should you salt and hash usernames?

Note that most modern hash algorithms, such as bcrypt and Argon2id, salt the password before they get hashed to protect passwords from hash table attacks and slow down dictionary and brute-force attacks. Don't use the username as the salt.

Is salting password secure?

Salting prevents hackers who breach an enterprise environment from reverse-engineering passwords and stealing them from the database. Password salting increases password complexity, making them unique and secure without affecting user experience.

Do you need to hash usernames?

Not necessary. Just use a hashing function designed to make brute force attacks unperformant, like bcrypt. SHA is insufficient.


1 Answers

You'll run into problems, when the username changes (if it can be changed). There's no way you can update the hashed password, because you don't store the unsalted, unhashed password.

like image 123
Chris Lercher Avatar answered Dec 10 '22 09:12

Chris Lercher