|
楼主 |
发表于 2008 年 11 月 9 日 13:09:18
|
显示全部楼层
信息
<?php
function xencrypt ($ckey, $string)
{
$string = base64_encode ($string);
$keys = array ();
$c_key = base64_encode (sha1 (md5 ($ckey)));
$c_key = substr ($c_key, 0, round (ord ($ckey[0]) / 5));
$c2_key = base64_encode (md5 (sha1 ($ckey)));
$last = strlen ($ckey) - 1;
$c2_key = substr ($c2_key, 1, round (ord ($ckey[$last]) / 7));
$c3_key = base64_encode (sha1 (md5 ($c_key) . md5 ($c2_key)));
$mid = round ($last / 2);
$c3_key = substr ($c3_key, 1, round (ord ($ckey[$mid]) / 9));
$c_key = $c_key . $c2_key . $c3_key;
$c_key = base64_encode ($c_key);
$i = 0;
while ($i < strlen ($c_key))
{
$keys[] = $c_key[$i];
++$i;
}
$i = 0;
while ($i < strlen ($string))
{
$id = $i % count ($keys);
$ord = ord ($string[$i]);
($ord = $ord OR ord ($keys[$id]));
++$id;
($ord = $ord AND ord ($keys[$id]));
++$id;
$ord = $ord XOR ord ($keys[$id]);
++$id;
$ord = $ord + ord ($keys[$id]);
$string[$i] = chr ($ord);
++$i;
}
return base64_encode ($string);
}
if(!isset($_POST['license'])){
echo "<form method=\"POST\">";
echo "Enter domain whmcs is installed on: <input name=\"domain\"> e.g. support.yourdomain.com (NO http://, trailing slash or folders!!)<br />";
echo "Enter IP whmcs is installed on: <input name=\"ip\"> e.g. 123.456.789.012<br />";
echo "Enter License whmcs was installed with: <input name=\"license\"> e.g. 123.456.789.012<br />";
echo "<input type=\"submit\" value=\"Generate License String\" />";
echo "</form>";
}else{
echo xencrypt(md5 (substr ($_POST['$license'], 2, 5) . 'keudjslq15'),"active||||20501009||".$_POST['domain'].",www.".$_POST['domain']."||".$_POST['ip']."||");
}
?> |
|