<?php
extension_loaded('openssl') or die('php需要openssl扩展支持');
$sy = "-----BEGIN PRIVATE KEY-----
MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQC9hocEMIT7ccXU
D3IPlqhlTRioZviztpyRGJSaPywBGxOpOcN6VnvZt8kRAZiJlSiXVPBEy+aY2tbY
6v/2K1bksjkN4QM5X/38J/+ld33QY/6jCBAZwUJqPpGEm9ZGLgWwSp6uhtA7bFTX
TNiT64yD4izsKjdiyX1D1MAA+ml8iXTwKK2Y9H/BvkOPYwU6Z8cCY5FXwkS5VBL/
lb7w8FwNBbix6nXUsQNl1jacO9Y5YJjnuzwiX5zcIeEjBifNucbJ6F84UQHn/CPX
O3c2FOfxdM7h73PvY7D+uMX9rV5WQmRt0r4j0krJAfpUcH8Cu8cKRQhMIIgiNJPF
Q5l4yvk/5agDe/3hBhKeqivnQMqKWKKSpSVcOn+4zGEErTo/lRXce+3HY1YY9U+I
cDYZRcdFDyO3AZa1assMFk8qLgNMdxsU3YJxYp75qVgE8nwMnulO64ylHdiAM5tr
w5r7u/tGOdzN+3Sh4IRQ/7bbhISpZr+0mpByU9zcIitBtidShwIhcMsWKdGbVPpK
ito7yagGkqYXqVdeVTSreYqOCnUEBegnnpSCcCe8LC4fM8pRWu+tbp6piVuNe3d4
7sK0qhW53SL7RK3iRj6Aw10tEa+HddYvBrs/u+upPTn95e8nzc9V2ODJT22eP3eX
rMePVwgSEp6co5rwBTze2+753UngAQIDAQABAoICAQCrVGrH2cjNues5qgDVoL94
XDq3OecIJ0PgUxU7X3I7Sav7ZjGVbYsmpWMJkaTAc2uvamSN/LnoYqSokcB0XHd/
5LF5H3mXq3RiOBJ+FchR06OE5CwR7EhK3WcVNv98j+wqkzph0ZN6tJL50wlSpzRu
oM81a3CISFeKM1CjUbx8jZJ97HgKdrTrg0F15PD7/IbGXRYt/Hu+AgfurwNeshq0
1wBBLg/5B1BoBj91+w3M7ssraXKSLFcUFTh+PflLm+7d5cf2lByiB6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qFDYGJeAJnHJ
ljZQLw4bz/8kH/EQcM6xg8ulTHERmD0=
-----END PRIVATE KEY-----";
$pub_key = "-----BEGIN RSA PUBLIC KEY-----
MIICCgKCAgEAvYaHBDCE+3HF1A9yD5aoZU0YqGb4s7ackRiUmj8sARsTqTnDelZ7
2bfJEQGYiZUol1TwRMvmmNrW2Or/9itW5LI5DeEDOV/9/Cf/pXd90GP+owgQGcFC
aj6RhJvWRi4FsEqerobQO2xU10zYk+uMg+Is7Co3Ysl9Q9TAAPppfIl08CitmPR/
wb5Dj2MFOmfHAmORV8JEuVQS/5W+8PBcDQW4sep11LEDZdY2nDvWOWCY57s8Il+c
3CHhIwYnzbnGyehfOFEB5/wj1zt3NhTn8XTO4e9z72Ow/rjF/a1eVkJkbdK+I9JK
yQH6VHB/ArvHCkUITCCIIjSTxUOZeMr5P+WoA3v94QYSnqor50DKiliikqUlXDp/
uMxhBK06P5UV3Hvtx2NWGPVPiHA2GUXHRQ8jtwGWtWrLDBZPKi4DTHcbFN2CcWKe
+alYBPJ8DJ7pTuuMpR3YgDOba8Oa+7v7Rjnczft0oeCEUP+224SEqWa/tJqQclPc
3CIrQbYnUocCIXDLFinRm1T6SoraO8moBpKmF6lXXlU0q3mKjgp1BAXoJ56UgnAn
vCwuHzPKUVrvrW6eqYlbjXt3eO7CtKoVud0i+0St4kY+gMNdLRGvh3XWLwa7P7vr
qT05/eXvJ83PVdjgyU9tnj93l6zHj1cIEhKenKOa8AU83tvu+d1J4AECAwEAAQ==
-----END RSA PUBLIC KEY-----";
$privateKey = openssl_pkey_get_private($sy);
// $privateKey = openssl_get_privatekey($sy);
($privateKey && $privateKey) or die('密钥或者公钥不可用');
$na = isset($_REQUEST["na"]) ? $_REQUEST["na"] : ""; //greetings
$na = $na?$na:(isset($_REQUEST["a"]) ? $_REQUEST["a"] : ""); //greetings
// CCCCC();return;
// echo $na;return;
// $na = "AHOaRsaXVlnfZfmyaI+aMEuP/MYxKsAj3iaKTurALsGTKUKTZDkNu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FiqqML/LohWOcI5o77Ev/yAEstfuyUITijxOLy+W7fAxmrU9wZmPdeIeG0MO7FLVmUg6CrNslMs69n945dckyFq1S9LBm6NyZphQJQkaJUHxc1gH30gqIEnhlYMV7o2pvIOT9dewkAdQimN0HaXO/BuAb6hb0tH319uOUKkgFAJyyTJcd7pxq6wxVB6FQ9wVPFZoRn94wHIV0lQpLIEfYkFS7sHwH0sgpxa6wGw4h/Fj4yPqG1/aHCKgvgj+1wC8E3jeZJnLjlZS3M03ozwj1+p9JEdg=";
//002 AES
if(openssl_private_decrypt(base64_decode($h_en), $decryptData, $privateKey)){
// echo "解密数据" . $decryptData;
//003换位字符
$huanwei = encode_E($decryptData,true);
// echo $huanwei;
//取出头|尾
$arr_tp = explode("|",$huanwei);
$hand_Hex_lem = $arr_tp[0]; // 04a
$data_3D = $arr_tp[1]; // data [1,2] 3
$hand_len = hexdec($hand_Hex_lem);
// echo $data_3D."<br>";
$en_a_b = substr($data_3D,0, $hand_len);
// echo "bas64=" . $en_a_b."<br>";
$en_c = substr($data_3D,$hand_len);
// echo "Hex =" . $en_c."<br>";
$de_c = CCCCC_den($en_c);
// echo "解密C=".$de_c."<br>";
$en_a_b_mm = base64_decode($en_a_b);
// echo "bas64_en=".$en_a_b_mm."<br>";
$en_ab_len = strlen($en_a_b_mm);
// echo "长度=".$en_ab_len;
// echo "en_ab_len=".$en_ab_len."<br>";
$en_a = substr($en_a_b_mm,0, $en_ab_len/2);
// echo "en_a=".$en_a." len=".strlen($en_a)."<br>";
$en_b = substr($en_a_b_mm, $en_ab_len/2);
// echo "en_a=".$en_b." len=".strlen($en_b)."<br>";
$de_b = BBBBB_en($en_b);
// echo "解密B=".$de_b."<br>";
$de_a = dddd_de($en_a);
// echo "解密a=".$de_a."<br>";
// dddd();
$ok = "".$de_a.$de_b.$de_c;
// echo $ok;
$wz = strrpos($ok,"}");
$appData = substr($ok,0,$wz+1);
// {
// "MLlOOJy7": "c2M=",
// "MLzVEbuv": "aa84706158544a60a7ef5cb7b38bf39c",
// "yzm": "cccccccccccc",
// "version": "1.0.0",
// "MLcebmHV": "aa84706158544a60a7ef5cb7b38bf39c",
// "MLQWgLSd": "kwNT"
// }
//echo $appData;
//{"MLlOOJy7":"c2M=","MLzVEbuv":"aa84706158544a60a7ef5cb7b38bf39c","yzm":"bbbbbbbbbbbb","version":"1.0.0","MLcebmHV":"aa84706158544a60a7ef5cb7b38bf39c","MLQWgLSd":"kwNT"}
//a=asF0mdMLtdW2URtsQZ/5G/XT5iamrTqhq3rUA1l1CY5uFS73w%2BYd3B/kYiT2eP9JT73rEXxXWg68FOHmc3yyL%2BYHwwxQYUHHfMaQuL04kPWRdOk3A4rVqRRFwoanDuIFyuMB9pLo5u4EoQF7472Ru7BKJeSnmainZTVBf1UFtRBT%2BTi6bPFQmGjQEzn23o9jieDxdpAYv%2B/Z0OsQStwSMY9Hsb%2BW7QET2n4m1IU3nLUIU%2BIzErE/TdiF8NAu7GBYGfN21IXggsQ9o2aqNlEUfqyK21Fq0eAIA/KQUcVT6d45n6ZWxZf7xTcS1dfdQuEYwRPeqh0KS6gDz4iPwohoVhThqL5/2GFJou%2BuG1kQVyNWeMEUeKjO5Asj5ASlb3wR/NJGmXXCtacYNtD6Hl55UWoToj/hrrSCjeDitmWLRMrtFMgDRFk0AU8P%2BxAfnPGrqs3SOPwK8H9jCJ0M5sLCm9WnSaNQWBElmzB7NmZEUMSQ35F9PPpafCWVB%2BGlOgIBWoK9WJqDndJEFwbx4IZaA1lpX%2BU2jCNiaaJ8YNUiVpSTAQc4I0jwNyuV%2B5YOo4iPBI9X/OeBXhyGH8iHcWECb1F9yve23TVRoNGngF7BPjrTSLhqa0be5waB6PHoq9iw3gojYuid69bGj6blowOWHBP2qUGSeEClenxAODyqpwd=
$j = json_decode($appData);
$yzm = $j->yzm;
$mac = $j->MLcebmHV;
//0存不存在,1 激活成功,2已使用,3停封
//aaaammSql.php
include "aaaammSql.php";
//alipayid mac
//signkey code
// echo $mac;
if ($yzm) {
$sn_rs = $db->select("alipayshouquan", "signkey='$yzm'");
if (!empty($sn_rs)) {
$alipayid = isset($sn_rs['alipayid']) ? $sn_rs['alipayid'] : "";
$key = isset($sn_rs['signkey']) ? $sn_rs['signkey'] : "";
$status = isset($sn_rs['status']) ? $sn_rs['status'] : "";
if($status == "3"){
RetCode(3);
}else if($alipayid == $mac){
RetCode(1);
}else if($alipayid != ""){
RetCode(2);
}else{
$_time = time();
$db->update("alipayshouquan", "alipayid='$mac',name='$_time',type='test'", "id='".$sn_rs["id"]."'");
RetCode(1);
}
}
}
if ($mac) {
$sn_rs = $db->select("alipayshouquan", "alipayid='$mac'");
if (!empty($sn_rs)) {
$alipayid = isset($sn_rs['alipayid']) ? $sn_rs['alipayid'] : "";
$key = isset($sn_rs['signkey']) ? $sn_rs['signkey'] : "";
$status = isset($sn_rs['status']) ? $sn_rs['status'] : "";
if($status == "3"){
RetCode(3);
}else if($alipayid == $mac){
RetCode(1);
}else{
}
}
}
RetCode(0);
exit();
if($yzm == "123"){
echo "vip8881wxid";
}else{
echo "vip8880wxid";
}
}else{
echo "解密数据" . "err";
}
exit();
}
function RetCode($code="0"){
echo "vip888".$code."wxid";
exit();
}
return;
echo ord("P") ;
// echo ord("P") + ord("O") + ord("S") + ord("T") ^ 0xa4046849;
$encryptData = "Q0dFMy3cGVEpp29WOvZZq/ZysKSxnkrZaKqQNXBsvGAtkDLbl0gltppLmrZHQQHL88d8OBrqJWnmx0GuJmwR/mN1wS9CTYrC730QPLuifhGnpBvMkSUWTFsxmiX2OcqQIShCsD2hjWLpXQRYSZupXB5MJ3ofgNvlPmx4Bj0tH+ybtLsrqJBECC6/98WXqZ6vaN459uubylNCPaj++rxpJQ5UCXp5AFp8B5WS4IkiPCuHpoJUc9F80aBXozAUEsneMIzK4GLtPe4XMUUl4FNueX4AncchZaXTJ8JS0zYGXX/jWrapb8OQPRl/9LF9ZOHPTIgaWDBBBNkgtr37kwgY8m4EPiOVqCorjqUNfguOu3KHE3sIx8PR03nqsjE9J/vzLpWdT5O62XVRoeX+q/YAfD/clR0znf2XFuGJF9zCCWugXUU3h5cgd2qgBnQOk6DJbjrY4odj/7ml7k0iby7ncJSxp50kbMj7zPTA/66748Gh7T5JLYT6fcOCX90QPH+sFIalftmHTinSbNJHtj5hQ4uoftQhbDvvKIAAwhomfkClzzAtX4lJwTiyx1hZptihCYSgcMG2DEMNmCYB9CF47UZlQwm76hC+nGTrztBJYWiaEFLNtQgtMelgCLcKi4eVaZl43n1Z9w6hXhjRC103guGpl+fZjpt9t3lN3Zvgd3Q=";
$encryptData = "AORaVnZma+Mu/YKA3aTrLGKKZku81X5Xo1DaC0vSrB7KQDDCnwftT3Iu2DOcPck9qrbHUrhJeQb4JECTrMs/0qHY6z5CMguPvEFeWyHq58WuTn0h1u9A4xQr2VbHi1FU95QEfIAibxCsisPw/Y96givUYfVRgNgp9UuG7q3KRQWgGCyTsmULauopHwv42s7X9wO+w9pSsc73ovok+glQG4mu5TrNgdYBVpdWx3ZEPmIv3JtuHFuvwqFvzpkCDrZO91UTb6rVLByON7e02NgCLtJzTFvNs8LxzexNmIH+6FA6MR5lsFF22I2LMQwLoZOjMoVUvioKaHUAOEa1l6BlXMHasXlffyIaEPMxsjiKuAsTUTDNhp19QY9/KasdAtKvv6lvDrnK4uyhX7/VwUTsimy/qI9sypOxbtwlKZWfLxOqjYUrgtMhEOgBMNcsiTeRlQMmTg6/MM1cHFpkMQKUhvH88HJ4IBGBCDWWtZhYuHuPGTRPMybLW9uKHH+/pfhkraivlewlC3cpuBnRByJ+uOe2UYZpc3y85U9tbYyE2m9ikvvAL8vB31CJSYJRKLBH9dGfeZ5zS+9BxQ2q11Y8hztEDzORJFuANfY2ypBYvseVMBvMjG7umClr0iOilsmTqI7yRZ2Z54XmWCQQ05IGOg9rsQMNY/GiUmz9NZ7Rs50=";
if(openssl_private_decrypt(base64_decode($encryptData), $decryptData, $privateKey)){
echo "解密数据" . $decryptData;
}else{
echo "解密数据" . "err";
}
echo "<br>";
// openssl_public_encrypt($encryptData,$decryptData,$privateKey)
//加密
$textStr = "0a4|9hHUMRtP6SXyuSLoiGNGpnoRwohTTE8rihNX2Yg6RLDCwUPcDDYmmnCpQ9BYNgawbitm1Nhi5jFmwSaZzKe6bYhtMYWNbbRts7Ozs7Ozs7Ozs7OzbYhtN/fXOQfLmm20bUGt+K34bYhtDNS69zqNCMxttG2BgVtnJ/g=4742464946454572474172487677467473487344497377444a74333d335e5d6268785d6475334b337c885f65338e7170856a7e67707d7c53885f507b6e76";
$textStr = "0a4|9hHUMRtP6SXyuSLoiGNGpnoRwohTTE8rihNX2Yg6RLDCwUPcDDYmmnCpQ9BYNgawbitm1Nhi5jFmwSaZzKe6bYhtMYWNbbRturq6urq6urq6urq6bYhtN/fXOQfLmm20bUGt+K34bYhtDNS69zqNCMxttG2BgVtnJ/g=4742464946454572474172487677467473487344497377444a74333d335e5d6268785d6475334b337c885f65338e6e83656a70865f877a698174725b5760";
// $textStr = "0a4|9hHUMRtP6SXyuSLoiGNGpnoRwohTTE8rihNX2Yg6RLDCwUPcDDYmmnCpQ9BYNgawbitm1Nhi5jFmwSaZzKe6bYhtMYWNbbRturq6urq6urq6urq6bYhtN/fXOQfLmm20bUGt+K34bYhtDNS69zqNCMxttG2BgVtnJ/g=4742464946454572474172487677467473487344497377444a74333d335e5d6268785d6475334b337c885f65338e6e83656a70865f877a698174725b5760..";
//原始的数组为:_origarr[6] = {3 ,2 ,5 ,0 ,4 ,1 };
//原始的数组为:_origarr[6] = {4 ,3 ,6 ,1 ,5 ,2 };
// 0a4|9h
// |4h09a
//encryed_buff_E
//加密后
//|4h09aRMPHtUyXS6uSGiGLNoRoopwnETrh8TXNYi2hLRCgD6cPDwDUnmpYCmYBgQN9ibmatwihj15NSwZFam6eYzbKYMNhWttR7bsb7szOOzzO7ss7YbtOhzXfQNO/mm0f2LtGKb+UYbt3h46SzD9NMCtqxNB2VtgG/J=tgn24644764544927744527844177674637874444974377474347343a33e35d26856dd5476833b745c7838356353f17087ea6e87507d67735878c05b57f67.6.e";
// 解密
$textStr = "|4h09aRMPHtUyXS6uSGiGLNoRoopwnETrh8TXNYi2hLRCgD6cPDwDUnmpYCmYBgQN9ibmatwihj15NSwZFam6eYzbKYMNhWttRrbubru6qq66qruurYbtqh6XfQNO/mm0f2LtGKb+UYbt3h46SzD9NMCtqxNB2VtgG/J=tgn24644764544927744527844177674637874444974377474347343a33e35d26856dd5476833b745c7838356353fe6388ea60675f5788696178a27b75406.5.7";
//encode_E($textStr);
echo 1 % 8;
echo "<br>";
echo 108 << 6;
echo "<br>";
echo 49 >> 4;//=2
echo "<br>";
echo 49 & 0xf;//=2
echo "<br>";
// echo 2 << 5;
echo "<br>";
echo "<br>".ord(33);
echo "<br>".chr(33);//!
$key="13426057";
$str = "{";
$en_a = dddd();
$en_b = BBB();
$en_c = CCCCC();
echo "<br><br><br><br>";
$en_bb = base64_encode($en_a.$en_b);
$en_bb_len = "0" . dechex(strlen($en_bb));
$en_3 = $en_bb_len ."|" . $en_bb . $en_c;
echo "$en_3<br><br><br><br>";
HHHH();
//字符对换解密
function HHHH_den($data){
$origarr = str_split($data);
$cun2 = count($origarr)/2;
$cun2 = count($origarr);
$sssstr1;
$sssstr2;
for($i=0; $i<$cun2; $i=$i+2){
$sssstr1.=$origarr[$i];
$sssstr2.=$origarr[$i+1];
}
// echo $sssstr1.$sssstr2;
// echo $sssstr2;
return $sssstr1.$sssstr2;
}
//字符对换加密
function HHHH(){
$str = "AORaVnZma+Mu/YKA3aTrLGKKZku81X5Xo1DaC0vSrB7KQDDCnwftT3Iu2DOcPck9qrbHUrhJeQb4JECTrMs/0qHY6z5CMguPvEFeWyHq58WuTn0h1u9A4xQr2VbHi1FU95QEfIAibxCsisPw/Y96givUYfVRgNgp9UuG7q3KRQWgGCyTsmULauopHwv42s7X9wO+w9pSsc73ovok+glQG4mu5TrNgdYBVpdWx3ZEPmIv3JtuHFuvwqFvzpkCDrZO91UTb6rVLByON7e02NgCLtJzTFvNs8LxzexNmIH+6FA6MR5lsFF22I2LMQwLoZOjMoVUvioKaHUAOEa1l6BlXMHasXlffyIaEPMxsjiKuAsTUTDNhp19QY9/KasdAtKvv6lvDrnK4uyhX7/VwUTsimy/qI9sypOxbtwlKZWfLxOqjYUrgtMhEOgBMNcsiTeRlQMmTg6/MM1cHFpkMQKUhvH88HJ4IBGBCDWWtZhYuHuPGTRPMybLW9uKHH+/pfhkraivlewlC3cpuBnRByJ+uOe2UYZpc3y85U9tbYyE2m9ikvvAL8vB31CJSYJRKLBH9dGfeZ5zS+9BxQ2q11Y8hztEDzORJFuANfY2ypBYvseVMBvMjG7umClr0iOilsmTqI7yRZ2Z54XmWCQQ05IGOg9rsQMNY/GiUmz9NZ7Rs50=";
$origarr = str_split($str);
$cun2 = count($origarr)/2;
$sssstr;
for($i=0; $i<$cun2; $i++){
$sssstr.=$origarr[$i];
$sssstr.=$origarr[$cun2+$i];
}
echo $sssstr;
}
function CCCCC(){
$arr_str = "123456789abcdef0"; //key
$origarr = str_split($arr_str);
$src = array(54,49,53,56,53,52,52,97,54,48,97,55,101,102,53,99,98,55,98,51,56,98,102,51,57,99,34,44,34,77,76,81,87,103,76,83,100,34,58,34,107,119,78,84,34,125,97,90,103,84,77,119,76,106,120,107,121,72,104,119,111,116);
$sssstr;
for($i=0; $i<count($src); $i++){
$sssstr.= $origarr[ $src[$i] >> 4 ]; //=3 =[4]
$sssstr.= $origarr[ $src[$i] & 0xf ];//[7]
}
//4742464946454572474172487677467473487344497377444a74333d335e5d6268785d6475334b337c885f65338e726b78655e885d7b897c8a5979887085
//47 42 46 49 46 45 45 72 47 41 72 48 76 77 46 74 73 48 73 44 49 73 77 44 4a 74 33 3d 33 5e 5d 62 68 78 5d 64 75 33 4b 33 7c 88 5f 65 33 8e 72 6b 78 65 5e 88 5d 7b 89 7c 8a 59 79 88 70 85
echo $sssstr."<br>";
CCCCC_den($sssstr);
return $sssstr;
}
function CCCCC_den($str_=""){
// echo "<br>";
//baos.write((hexString.indexOf(bytes.charAt(i))<<4 | hexString.indexOf(bytes.charAt(i+1))));
//return new String(baos.toByteArray());
$arr_str = "123456789abcdef0"; //key
$origarr = str_split($arr_str);
// $str_ = "4742464946454572474172487677467473487344497377444a74333d335e5d6268785d6475334b337c885f65338e726b78655e885d7b897c8a5979887085";
//$str_ = "3631353835343461363061376566356362376233386266333963222C224D4C5157674C5364223A226B774E54227D615A67544D774C6A786B794868776F74";
$str_ = strToUpper($str_);
$src = str_split($str_);
for($i=0; $i<count($src); $i++){
//$RetTerxt = str_replace(".","",$RetTerxt);
$tt = $src[$i];
if($tt != "0"){
$tt2 = dechex(hexdec($tt)-1);
$new_str_=$new_str_ . strToUpper($tt2);
}else{
$new_str_=$new_str_."F";
}
}
// echo "new_str_=".$new_str_;
// echo "<br>";
$src = str_split($new_str_);
for($i=0; $i<count($src); $i=$i+2){
// echo "<br>";
//echo $src[$i+1] . "," . $origarr[hexdec($src[$i+1])-1];
// echo $src[$i] ;//<< 4;
// echo "=";
// echo $origarr[$src[$i]];
// echo "<br>";
// echo "<br>";
$string .= chr(hexdec($src[$i].$src[$i+1]));
// echo $string;
// $sssstr.= $origarr[ $src[$i] << 4 ] ;
//echo "=".$origarr[ $src[$i] << 4 ] ;
//echo $src[$i+1];
//ord
//$sssstr.=( hexdec($origarr[hexdec($src[$i+1]) -2]) | 0xF0);
//$sssstr.=",";
}
// echo "<br>";
// echo 104 >> 4;
//echo 102 | 0xf;
// echo "<br>";
//echo 6 | 0x30 ;
// echo "<br>";
// echo $string."<br>";
return $string;
}
//向量偏移加密
function dddd(){
$src = array(123,34,77,76,108,79,79,74,121,55,34,58,34,99,50,77,61,34,44,34,77,76,122,86,69,98,117,118,34,58,34,97,97,56,52,55,48,54,49,53,56,53,52,52,97,54,48,97,55,101,102,53,99,98,55,98,51,56,98,102,51);
$origarr = array(1 ,3 ,4 ,2 ,6 ,0 ,5 ,7 );
$key = count($origarr);
$newarr;
$sssstr;
for($i=0; $i<count($src); $i++){
$kkk = $src[$i] << $origarr[$i % 8] | $src[$i] >> (8 - $origarr[$i % 8]);
$newarr[$i] = $kkk;
// echo $kkk; echo ",";
$sssstr.=chr($kkk);
}
// 246,273,1236,305,6939,79,2537,9509,242,441,546,232,2184,99,1606,9894,122,273,706,136,4947,76,3919,11051,138,787,1879,473,2184,58,1092,12464,194,449,835,220,3084,54,1574,6810,112,425,835,208,6232,54,1542,12464,110,811,1638,212,6360,98,1766,12593,102,449,1574,409,3276, 9hHUMRtP6SXyuSLoiGNGpnoRwoh
// echo $sssstr;
// echo base64_encode($sssstr);
return $sssstr;
// var_dump($newarr);
}
//向量偏移
function dddd_de($en_a){
$origarr = array(1 ,3 ,4 ,2 ,6 ,0 ,5 ,7 );
// $en_a = base64_decode("9hHUMRtP6SXyuSLoiGNGpnoRwoh"); //246,17,212,49,27,79,233,37,242,185,34,232,136,99,70,166,122,17,194,136
//123,2,13,12,0,79,7,0,121,23,2,58,2,99,2,1,61,2,12,34
// 246,17,212,49,27,79,233,37,242,185,34,232,136,99,70,166,122,17,194,136,83,76,79,43,138,19,87,217,136,58,68,176,194,193,67,220,12,54,38,154,112,169,67,208,88,54,6,176,110,43,102,212,216,98,230,49,102,193,38,153,204
for($i=0; $i<strlen($en_a); $i++){
$kkk = ord($en_a[$i]);
// echo $kkk;
$jjj = $kkk >> $origarr[$i % 8] | $kkk << ( 8- $origarr[$i % 8]) ;
// echo $jjj;
// echo ",";
// $kkk = $zd[];
$sssstr.=chr($jjj);
}
// echo $sssstr;
return $sssstr;
// var_dump($newarr);
}
//字典替换加密
function BBB(){
//
$zd = array(0,15,63,177,189,27,128,19,36,61,79,59,9,242,31,197,231,30,157,86,188,211,99,122,134,4,117,183,69,225,132,181,221,110,109,142,131,102,121,84,232,219,139,70,136,32,173,18,248,65,96,48,103,169,156,39,91,167,180,68,114,146,161,175,107,176,235,46,95,64,85,112,8,45,207,200,212,12,202,29,127,143,14,50,66,162,204,83,75,47,98,209,53,144,5,20,33,129,58,186,88,247,206,16,224,7,198,179,123,141,154,203,92,97,215,57,37,135,55,140,115,49,133,240,194,208,78,160,170,90,255,172,76,205,245,23,246,174,152,11,228,60,184,243,168,236,17,193,158,217,87,72,104,82,24,201,251,150,239,222,213,80,13,119,42,111,159,1,35,41,43,151,182,34,187,113,244,199,81,2,223,54,26,124,6,138,28,249,77,108,51,254,149,237,210,192,220,233,56,73,10,105,116,226,93,252,164,25,94,38,214,106,185,153,44,191,234,74,89,230,22,101,52,71,137,216,178,155,227,3,190,148,163,145,120,241,126,165,62,118,147,100,253,195,130,250,171,125,229,238,218,196,21,67,166,40);
//9c","yzm":"cccccccccccc","version":"1.0.0","MLcebmHV":"aa8470 ord()
$src = array(57,99,34,44,34,121,122,109,34,58,34,99,99,99,99,99,99,99,99,99,99,99,99,34,44,34,118,101,114,115,105,111,110,34,58,34,49,46,48,46,48,34,44,34,77,76,99,101,98,109,72,86,34,58,34,97,97,56,52,55,48);
$sssstr;
for($i=0; $i<count($src); $i++){
$kkk = $zd[$src[$i]];
$sssstr.=chr($kkk);
}
// echo base64_encode($sssstr);
return $sssstr;
}
function BBBBB_en($en_b){
//字典
$zd = array(0,15,63,177,189,27,128,19,36,61,79,59,9,242,31,197,231,30,157,86,188,211,99,122,134,4,117,183,69,225,132,181,221,110,109,142,131,102,121,84,232,219,139,70,136,32,173,18,248,65,96,48,103,169,156,39,91,167,180,68,114,146,161,175,107,176,235,46,95,64,85,112,8,45,207,200,212,12,202,29,127,143,14,50,66,162,204,83,75,47,98,209,53,144,5,20,33,129,58,186,88,247,206,16,224,7,198,179,123,141,154,203,92,97,215,57,37,135,55,140,115,49,133,240,194,208,78,160,170,90,255,172,76,205,245,23,246,174,152,11,228,60,184,243,168,236,17,193,158,217,87,72,104,82,24,201,251,150,239,222,213,80,13,119,42,111,159,1,35,41,43,151,182,34,187,113,244,199,81,2,223,54,26,124,6,138,28,249,77,108,51,254,149,237,210,192,220,233,56,73,10,105,116,226,93,252,164,25,94,38,214,106,185,153,44,191,234,74,89,230,22,101,52,71,137,216,178,155,227,3,190,148,163,145,120,241,126,165,62,118,147,100,253,195,130,250,171,125,229,238,218,196,21,67,166,40);
//chr(57) "9" 从指定 ASCII 值返回字符。
//echo ord("9");//57 返回字符串中第一个字符的 ASCII 值。
// echo "<br>";
for($i=0; $i<strlen($en_b); $i++){
// echo ord($en_b[$i]); //167,186,
$kkk = bbbbb_find( ord($en_b[$i]));
// echo ",";
// $kkk = $zd[];
$sssstr.=chr($kkk);
}
return $sssstr;
// echo ($sssstr);
}
function bbbbb_find($as){
$zd = array(0,15,63,177,189,27,128,19,36,61,79,59,9,242,31,197,231,30,157,86,188,211,99,122,134,4,117,183,69,225,132,181,221,110,109,142,131,102,121,84,232,219,139,70,136,32,173,18,248,65,96,48,103,169,156,39,91,167,180,68,114,146,161,175,107,176,235,46,95,64,85,112,8,45,207,200,212,12,202,29,127,143,14,50,66,162,204,83,75,47,98,209,53,144,5,20,33,129,58,186,88,247,206,16,224,7,198,179,123,141,154,203,92,97,215,57,37,135,55,140,115,49,133,240,194,208,78,160,170,90,255,172,76,205,245,23,246,174,152,11,228,60,184,243,168,236,17,193,158,217,87,72,104,82,24,201,251,150,239,222,213,80,13,119,42,111,159,1,35,41,43,151,182,34,187,113,244,199,81,2,223,54,26,124,6,138,28,249,77,108,51,254,149,237,210,192,220,233,56,73,10,105,116,226,93,252,164,25,94,38,214,106,185,153,44,191,234,74,89,230,22,101,52,71,137,216,178,155,227,3,190,148,163,145,120,241,126,165,62,118,147,100,253,195,130,250,171,125,229,238,218,196,21,67,166,40);
for($i=0; $i<count($zd); $i++){
$m = $zd[$i];
if($as."" == $m.""){
return $i;
}
}
return 0;
}
//echo xor_encrypt($str,$key);
/*
* php异或加解密
* @param string $str 需要加/解密的字符串
* @param string $key 加/解密key
* @return string
*/
function xor_encrypt($str,$key){
$encstr = '';
$keylen = strlen($key);
for($i=0;$i<strlen($str);$i++){
$k = $i%$keylen;
$encstr.= $str[$i] ^ $key[$k];
}
return $encstr;
}
//换位 加密 解密
function encode_E($str="",$isencode=false){
if($isencode){
$org_arr = array(3, 5 ,1 ,0 ,4 ,2);//= 6
}else{
$org_arr = array(3, 2 ,5 ,0 ,4 ,1);//= 6 //
}
$_strlen = strlen($str);//292
$strmod = $_strlen%6;//4
if($strmod > 0){
$new_str=$str . getDD(6-$strmod);
}else{
$new_str=$str;
}
$_strlen = strlen($new_str);//294
$_drc = "";
$arrStr = str_split($new_str);
$arrNew;
for($i=0; $i<$_strlen; $i=$i+6){
for($j=0 ;$j<6; $j++){
$arrNew[$i+$j] = $arrStr[$i+$org_arr[$j]];
}
}
if($isencode){
$RetTerxt = getarrToStr($arrNew);
$RetTerxt = str_replace(".","",$RetTerxt);
return $RetTerxt;
}
return getarrToStr($arrNew);
}
function getarrToStr($arr){
$str;
for($i=0; $i<count($arr); $i++){
$str .= $arr[$i];
}
return $str;
}
function getDD($len){
$str;
for($i=0; $i<$len; $i++){
$str .= ".";
}
return $str;
}
?>