Thread: new challenge!!
View Single Post
Old 01-27-2008, 03:44 AM   #7 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
php Code:
function wildhoney_encrypt($szString)
{
    $szEncrypted = '';
    $aParts = str_split($szString, 1);
   
    foreach($aParts as $szLetter)
    {
        $szEncrypted .= chr(ord($szLetter) + 5);
    }
   
    return $szEncrypted;
}

function wildhoney_decrypt($szString)
{
    $szDecrypted = '';
    $aParts = str_split($szString, 1);
   
    foreach($aParts as $szLetter)
    {
        $szDecrypted .= chr(ord($szLetter) - 5);
    }
   
    return $szDecrypted;
}

$szString = 'Bleh';
$szEncrypted = wildhoney_encrypt($szString);
$szDecrypted = wildhoney_decrypt($szEncrypted);

echo 'Encrypted: ' . $szEncrypted . '<br />';
echo 'Decrypted: ' . $szDecrypted;

Lol Night night everybody.
I laughed at this post.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote