Exemplo n.º 1
0
 /// <summary>
 /// 返回16位MD5加密Base64字符串
 /// </summary>
 /// <param name="origin">待加密的数据</param>
 /// <returns>MD5 Base64加密字符串</returns>
 public static String EncryptToBase64String(Byte[] origin)
 {
     Byte[] data = MD5Encrypt.EncryptToByteArray(origin);
     return(Convert.ToBase64String(data));
 }
Exemplo n.º 2
0
        /// <summary>
        /// 对指定用户名和密码进行加密
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="passWord">原始密码</param>
        /// <returns>加密后的密码</returns>
        public static String Encrypt(String userName, String passWord)
        {
            String temp = MD5Encrypt.EncryptToHexString(userName + passWord, true) + SALT;

            return(MD5Encrypt.EncryptToHexString(temp, true));
        }