奇怪的MD5加密问题,请达人解决,顶者有分
MD5公司内部服务器加密正常,放到网络服务器上所有新增用户时不管杂填密码,储存到数据库都变成1234了,遇到过米有?
public class JString
{
//加密
static public string GetEmcryptMd5(string strinput)
{
byte[] data = System.Text.Encoding.Unicode.GetBytes(strinput);
System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] result = md5.ComputeHash(data);
string sResult = System.Text.Encoding.Unicode.GetString(result);
string EnPswdStr = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sResult, "MD5 ");
return EnPswdStr;
}
////以下省略.........
//写入model
private void WriteModel(db.dm_qxgl_czy model)
{ model.mm = JString.GetEmcryptMd5(tbMm.Text);
------解决方案--------------------up
------解决方案--------------------sdm
------解决方案--------------------up
------解决方案--------------------/// MD5 16位加密
/// </summary>
/// <param name= "input "> 输入的字符串 </param>
/// <returns> MD5后的结果 </returns>
public static string GetMd5Hash(string input)
{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
string output =
BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(input)), 4, 8);
output = output.Replace( "- ", " ");
return output;
}
------解决方案--------------------没遇到过
------解决方案--------------------up