Cleartext password vulnerability
how to implement SHA1 or MD5 in asp.net
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Oct 19, 2013, 12:21 AM EDT
.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.