14 srand((
double)microtime() * 1000000);
15 $encrypt_key = md5(rand(0, 32000));
22 for(
$i = 0;
$i < strlen($txt);
$i++) {
24 $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;
27 $tmp .= $encrypt_key[$ctr].($txt[
$i] ^ $encrypt_key[$ctr++]);
31 return base64_encode(
game_key($tmp, $key));
48 $txt =
game_key(base64_decode($txt), $key);
54 for (
$i = 0;
$i < strlen($txt);
$i++) {
57 $tmp .= $txt[
$i] ^ $txt[++
$i];
76 $encrypt_key = md5($encrypt_key);
83 for(
$i = 0;
$i < strlen($txt);
$i++) {
85 $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;
88 $tmp .= $txt[
$i] ^ $encrypt_key[$ctr++];
109 foreach($array as $key => $val) {
111 $arrayenc[] = $key.
'='.urlencode($val);
116 return implode(
'&', $arrayenc);
game_key($txt, $encrypt_key)