首先把加密字符串进行编码成Unicode,然后使用系统的不对称加密算法MD5加密用户密码串。
public static String Encrypt(string password)
{
Byte[] clearBytes=new UnicodeEncoding().GetBytes(password);
Byte[] hashedBytes=((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
return BitConverter.ToString(hashedBytes);
}