/*******************************************************************************
* Copyright © 2017-2020 Znyc.Recruitment.Admin.Framework 版权所有
* Author: Znyc
* Description: Znyc快速开发平台
* Website:http://www.Znyc.Recruitment.Admin.com
*********************************************************************************/
using System;
using System.Text;
namespace Znyc.Recruitment.Admin.Commons.Encrypt
{
///
/// QQ密码加密操作辅助类
///
public class QQEncryptUtil
{
///
/// QQ根据密码及验证码对数据进行加密
///
/// 原始密码
/// 验证码
///
public static string EncodePasswordWithVerifyCode(string password, string verifyCode)
{
return MD5(MD5_3(password) + verifyCode.ToUpper());
}
private static string MD5_3(string arg)
{
System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] buffer = Encoding.ASCII.GetBytes(arg);
buffer = md5.ComputeHash(buffer);
buffer = md5.ComputeHash(buffer);
buffer = md5.ComputeHash(buffer);
return BitConverter.ToString(buffer).Replace("-", "").ToUpper();
}
private static string MD5(string arg)
{
System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] buffer = Encoding.ASCII.GetBytes(arg);
buffer = md5.ComputeHash(buffer);
return BitConverter.ToString(buffer).Replace("-", "").ToUpper();
}
}
}