43 lines
573 B
PHP
43 lines
573 B
PHP
|
<?php
|
||
|
$a[0]['id']=1;
|
||
|
$a[0]['user']='yurec';
|
||
|
|
||
|
|
||
|
$b = serialize($a);
|
||
|
|
||
|
echo $b;
|
||
|
|
||
|
|
||
|
|
||
|
function encode($String, $Password){
|
||
|
$Salt='BGuxLWQtKweKEMV4';
|
||
|
$StrLen = strlen($String);
|
||
|
$Seq = $Password;
|
||
|
$Gamma = '';
|
||
|
while (strlen($Gamma)<$StrLen){
|
||
|
$Seq = pack("H*",sha1($Gamma.$Seq.$Salt));
|
||
|
$Gamma.=substr($Seq,0,8);
|
||
|
}
|
||
|
return $String^$Gamma;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
$base64=base64_encode($b);
|
||
|
echo $base64 . "\r";
|
||
|
echo base64_encode( encode($base64, 'password') ). "\r";
|
||
|
|
||
|
//$c=unserialize($b);
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
//print_r($c);
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
?>
|