- substr: documentation ( source)
- chr: documentation ( source)
- base64_decode: documentation ( source)
- ord: documentation ( source)
<?php
$pwd = 'Hello World';
$key = "ª®µ4_ψ¶-(o)(o)-¼8ØaQφ";
$result = "";
$string = base64_decode($pwd);
for ($i = 0; $i < strlen($string); $i++)
{
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key)) - 1, 1);
$char = chr(ord($char) - ord($keychar));
$result.=$char;
}
echo $result;