Thread: Decrypt MD5
View Single Post
Old 03-14-2006, 03:41 PM   #5 (permalink)
khanhlq
Registered User
 
Join Date: Mar 2006
Posts: 7
khanhlq is on a distinguished road
Example I encrypt by:
Quote:
private string encryptString(string strToEncrypt)
{
System.Text.UTF8Encoding ue = new System.Text.UTF8Encoding();
byte[] bytes = ue.GetBytes(strToEncrypt);

// encrypt bytes
System.Security.Cryptography.MD5CryptoServiceProvi der md5 = new System.Security.Cryptography.MD5CryptoServiceProvi der();
byte[] hashBytes = md5.ComputeHash(bytes);

// Convert the encrypted bytes back to a string (base 16)
string hashString = "";

for(int i=0;i<hashBytes.Length;i++)
{
hashString += Convert.ToString(hashBytes[i],16).PadLeft(2,'0');
}

return hashString.PadLeft(32,'0');
}
Now i want decrypt the password, but i can't write the best code. Please help me.
khanhlq is offline