//C#版
public static string Encrypt(string plain)//对密码加密
{
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(plain);
System.Security.Cryptography.SHA1CryptoServiceProvider sha = new System.Security.Cryptography.SHA1CryptoServiceProvider();
byte[] hash = sha.ComputeHash(buffer);
System.Text.StringBuilder passwordBuilder = new System.Text.StringBuilder(32);
foreach (byte hashByte in hash)
{
passwordBuilder.Append(hashByte.ToString("x2")); }
return passwordBuilder.ToString();
}
给出的加密算法,希望能得到解密算法,非常感谢
public static string Encrypt(string plain)//对密码加密
{
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(plain);
System.Security.Cryptography.SHA1CryptoServiceProvider sha = new System.Security.Cryptography.SHA1CryptoServiceProvider();
byte[] hash = sha.ComputeHash(buffer);
System.Text.StringBuilder passwordBuilder = new System.Text.StringBuilder(32);
foreach (byte hashByte in hash)
{
passwordBuilder.Append(hashByte.ToString("x2")); }
return passwordBuilder.ToString();
}
给出的加密算法,希望能得到解密算法,非常感谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货