C# |
Encryption/Decryption not working
This code isnt giving me the correct text decrypted...
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Murali krishna Ande39 pointsPosted Nov 15, 2010, 9:46 PM EST
code for encryption:
using System.Security.Cryptography;
MD5 md = new MD5CryptoServiceProvider();
UTF8Encoding encoder = new UTF8Encoding();
byte[] hash = md.ComputeHash(encoder.GetBytes(textBox1.Text));
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hash.Length - 1; i++)
{
sb.Append(hash[i].ToString("X2"));
}
label1.Text = sb.ToString();
MD5 is used for secure purpose we are not able to decrypt it.