QQ使用的加密方式

//QQ的EncryptUtil
public class QQEncryptUtil
{
public static string EncodePasswordWithVerifyCode(string password, string verifyCode)
{
return MD5(MD5_3(password) + verifyCode.ToUpper());
}

static string MD5_3(string arg)
{
System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();

byte[] buffer = System.Text.Encoding.ASCII.GetBytes(arg);
buffer = md5.ComputeHash(buffer);
buffer = md5.ComputeHash(buffer);
buffer = md5.ComputeHash(buffer);

return BitConverter.ToString(buffer).Replace("-", "").ToUpper();
}
static string MD5(string arg)
{
System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();

byte[] buffer = System.Text.Encoding.ASCII.GetBytes(arg);
buffer = md5.ComputeHash(buffer);

return BitConverter.ToString(buffer).Replace("-", "").ToUpper();
}
}

posted @ 2021-10-22 09:28  龙丶谈笑风声  阅读(359)  评论(0编辑  收藏  举报