string s1=textbox1.Text;
string s2="";
foreach(char c in s1) {
s2 = s2 + Convert.ToInt32(c).ToString();
}
UTF8Encoding ue = new UTF8Encoding();
byte[] bytes = ue.GetBytes(s2);
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
byte[] h1 = md5.ComputeHash(bytes);
textbox2.Text = System.Text.RegularExpressions.Regex.Replace(BitCo nverter.ToString(h1), "-", "").ToLower();
答案 0 :(得分:0)
MD5CryptoServiceProvider
是使用MD5
加密算法加密字节的类。如果您询问'MD5'变量,则它是MD5CryptoServiceProvider
对象的实例。
http://www.encrypt.ro/cryptography/md5-message-digest-algorithm-5.html