I could barely find any good hash+salt guide specified for Asp.net Mvc. So far I managed to hash my password and store it in database(upon register). For login, I hash users input, check if it's same hash value in db.
Password = HashPass(input.Password).ToString();
Using following method to hash password, that I later store in db.
public string HashPass(string password) {
byte[] encodedPassword = new UTF8Encoding().GetBytes(password);
byte[] hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(encodedPassword);
string encoded = BitConverter.ToString(hash)
.Replace("-", string.Empty)
.ToLower();
return encoded;
}
Now to Salt, what are they really? How do they work? How do I combine salt with my solution?
Any help is much appreciated.