标签:
private void button1_Click(object sender, EventArgs e) { string s = GetMd5(textBox1.Text.Trim()); MessageBox.Show(s); } private static string GetMd5(string sDataIn) { MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); byte[] bytValue, bytHash; bytValue = System.Text.Encoding.UTF8.GetBytes(sDataIn); bytHash = md5.ComputeHash(bytValue); md5.Clear(); string sTemp = ""; for (int i = 0; i < bytHash.Length; i++) { sTemp += bytHash[i].ToString("X").PadLeft(2,‘0‘); } return sTemp.ToLower(); }
加盐就是在原来输入的密码后边再加一个比较复杂大字符串
标签:
原文地址:http://www.cnblogs.com/lushixiong/p/4567144.html