.net有提供现成的MD5摘要算法: System.Security.Cryptography 命名空间 MSDN示例: byte[] data = new byte[DATA_SIZE]; // This is one implementation of the abstract class MD5. MD5 md5 = new MD5CryptoServiceProvider(); byte[] result = md5.ComputeHash(data);如果处理string的话,用Convert.FromBase64String方法先转换成byte[]
http://www.microsoft.com/china/msdn/library/security/DataSecureEncryp.mspx?mfr=true
最简单的
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Password,"MD5");
用动网的加密是这样 7a57a5a743894a0e
两个不一样啊
System.Security.Cryptography 命名空间
MSDN示例:
byte[] data = new byte[DATA_SIZE];
// This is one implementation of the abstract class MD5.
MD5 md5 = new MD5CryptoServiceProvider();
byte[] result = md5.ComputeHash(data);如果处理string的话,用Convert.FromBase64String方法先转换成byte[]