using System.Security.Cryptography;
//MD5 md5 = MD5.Create();
MD5 md5 = new MD5CryptoServiceProvider();
byte[] buffer = Encoding.Default.GetBytes(str);
byte[] bufferStr = md5.ComputeHash(buffer);
string md5Str = "";
foreach (byte item in bufferStr)
{
md5Str += item.ToString("x2");
}
return md5Str;
加密的还有des可逆对称加密,RSA非对称加密 数字整数ssl