Website challenge!
Posted: Wed May 19, 2004 6:50 pm
I have recently been trying to make a small decryption challenge for my site where the user has to work out the encryption method used. To help people out I have developed a tool which takes a string and subtracts 2 away from each character (Ascii shift). The problem is that I cannot get it to work on the whole string but a single character shift is easy. Any help appreciated!
CODE
====
$string = $_POST['encrypt'];
for ($i=0; $i<strlen($string); $i++)
{
$enc = ord($string) - 2;
$enc1 = chr(substr($enc),$i);
echo $enc1;
}
Regards
Joe
CODE
====
$string = $_POST['encrypt'];
for ($i=0; $i<strlen($string); $i++)
{
$enc = ord($string) - 2;
$enc1 = chr(substr($enc),$i);
echo $enc1;
}
Regards
Joe