I have used the following code to Encrypt a password using MD5 hashing.But I am stuck on how to decrypt the password . I am sure that it can be acheived easily without writing lot of code. Any help will be apprectiated.
//Password encryption
public string ComputePassword(string password)
{
StringBuilder str = new StringBuilder();
try
{
byte[] bytes = Encoding.Unicode.GetBytes(password);
var md5 = new MD5CryptoServiceProvider();
var md5data = md5.ComputeHash(bytes);
for (int i = 0; i < md5data.Length; i++)
{
str.Append(md5data[i].ToString("x2"));
}
return str.ToString();
}
catch (Exception ex)
{
return null;
}
}
How can I decrypt the above generated encrypted string