QQ空间密码加密方式

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>无标题</title>
	<script type="text/javascript">
	//http://ptlogin2.qq.com/login?u=**********&p=A51836AE9AE14D8707EC8B2B755050D9&verifycode=!JJG&aid=15004501&u1=http%3A%2F%2Fctc.qzs.qq.com%2Fac%2Fqzone%2Flogin%2Fsucc.html%3Fpara%3Dtoolbar&h=1&ptredirect=0&ptlang=2052&from_ui=1&dumy=&fp=loginerroralert&mibao_css=&t=1&g=1
	</script>

</head>
<body> 

<?php

class qq {
	//新版登陆加密函数
	function jspassword($p,$pt,$vc,$md5 = true){
	if($md5){
	$p=strtoupper(md5($p));
	}
	$len = strlen($p);
	$temp = '';
	for ($i=0; $i < $len ; $i = $i + 2) {
	$temp .= '\x'.substr($p, $i,2);
	}
	return strtoupper(md5(strtoupper(md5($this->hex2asc($temp).$this->hex2asc($pt))).$vc));
	}
	//十六进制转字符
	function hex2asc($str) {
	$str = join('',explode('\x',$str));
	$len = strlen($str);
	$data = '';
	for ($i=0;$i<$len;$i+=2) {
		$data.=chr(hexdec(substr($str,$i,2)));
	}
	return $data;
	}
}


//这'\x00\x00\x00\x00\x67\x7f\x4a\x51'是check返回值【你懂的】:ptui_checkVC('0','!JJG','\x00\x00\x00\x00\x67\x7f\x4a\x51') 





$b = new qq();
echo '<br/>'.'A51836AE9AE14D8707EC8B2B755050D9'.'<br/>';
echo $b->jspassword('zyq001122','\x00\x00\x00\x00\x67\x7f\x4a\x51','!JJG');
?>




</body>
</html>

最后输出结果是相同的。正确
 

你可能感兴趣的:(QQ空间密码加密方式)