- substr: documentation ( source)
- chr: documentation ( source)
- base64_decode: documentation ( source)
- preg_match: documentation ( source)
<?php
function decrypt ($str)
{
if(preg_match('%^[a-zA-Z0-9/+]*={0,2}$%',$str))
{
$str = base64_decode($str);
if ($str != "" && $str != null && $str != false)
{
$decStr = "";
for ($i=0; $i < strlen($str); $i+=3)
{
$array[$i/3] = substr($str,$i,3);
}
foreach($array as $s)
{
// echo "s: " .$s. "\r\n";
$a = $s^192;
// echo "a: " .$a . "\r\n";
$decStr .= chr($a);
// echo "chr: " .$decStr . "\r\n\r\n";
}
return $decStr."\r\n\r\n";
}
return false;
}
return false;
}
echo decrypt("Admin");
?>