How does password salt help against a rainbow table attack?

I’m having some trouble understanding the purpose of a salt to a password. It’s my understanding that the primary use is to hamper a rainbow table attack. However, the methods I’ve seen to implement this don’t seem to really make the problem harder. I’ve seen many tutorials suggesting that the salt be used as the … Read more

How do I search within an array of hashes by hash values in ruby?

I have an array of hashes, @fathers. a_father = { “father” => “Bob”, “age” => 40 } @fathers << a_father a_father = { “father” => “David”, “age” => 32 } @fathers << a_father a_father = { “father” => “Batman”, “age” => 50 } @fathers << a_father How can I search this array and return an … Read more

Where do you store your salt strings?

I’ve always used a proper per-entry salt string when hashing passwords for database storage. For my needs, storing the salt in the DB next to the hashed password has always worked fine. However, some people recommend that the salt be stored separately from the database. Their argument is that if the database is compromised, an … Read more

What data type to use for hashed password field and what length?

I’m not sure how password hashing works (will be implementing it later), but need to create database schema now. I’m thinking of limiting passwords to 4-20 characters, but as I understand after encrypting hash string will be of different length. So, how to store these passwords in the database? 10 Answers 10