Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to store password salt

I've seen various methods on how to properly salt a password. The basic premise is that you attach a random string to each password before it is hashed and stored. Can I store the salt in the same table as the password? Also, does it matter if the salt is stored as plain text, as long as each entry has a different salt?

like image 569
Eric Di Bari Avatar asked Nov 12 '10 17:11

Eric Di Bari


2 Answers

Yes. The idea behind a salt is not that the salt be secret, but that it causes the same password for different users to be hashed differently. This raises the size of needed rainbow tables for cracking, or forces a dictionary (or other) attack to be ran against every password separately.

like image 50
Donnie Avatar answered Nov 01 '22 15:11

Donnie


The point of salting is that no one has the same hash as users have same password, just putting their username in front of the password then hashing it would be enough.

like image 37
James T Avatar answered Nov 01 '22 16:11

James T