cleartext password vulnerability
how to implement SHA1 or MD5 in asp.net
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaganathan BantheswaranPosted Oct 19, 2013, 4:21 AM
.Net provide various namespaces to implement SHA1 and MD5 Hash Algorithms. System.Security.Cryptography.
MD5 md5 = MD5.Create(); // For SHA1 use, SHA1.Create();
byte[] hashData = md5.ComputeHash(Encoding.Default.GetBytes(data));
StringBuilder hashedValue = new StringBuilder();
for (int i = 0; i < hashData.Length; i++)
{
hashedValue .Append(hashData[i].ToString());
}
hashedValue will have the MD5 hashed data.