Password Storage: How to do it.





5.00/5 (1 vote)
I think it has error, for example:A user is:string userId = "OriginalGriff"; string password = "NotMyPassword";And other user is:string userId = "Original"; string password = "GriffNotMyPassword";Problem to store two user.My idea is:private static...
I think it has error, for example:
A user is:
string userId = "OriginalGriff";
string password = "NotMyPassword";
And other user is:
string userId = "Original";
string password = "GriffNotMyPassword";
Problem to store two user.
My idea is:
private static byte[] GetSHA1(string userID, string password)
{
SHA1CryptoServiceProvider sha = new SHA1CryptoServiceProvider();
byte[] hashedPassword = sha.ComputeHash(System.Text.Encoding.ASCII.GetBytes(userID);
hashedPassword += sha.ComputeHash(System.Text.Encoding.ASCII.GetBytes(password);
return sha.ComputeHash(hashedPassword);
}
Thanks.