Stay In Touch
Share with us your jokes, stories, links, articles, and anything you want!
function encrypt($sData, $sKey) { $sResult = ''; $checksum = crc32($sData); $sData .= "|checksum|".$checksum; for($i = 0; $i < strlen($sData); $i ++) { $sChar = substr($sData, $i, 1); $sKeyChar = substr($sKey, ($i % strlen($sKey)) - 1, 1); $sChar = chr(ord($sChar) + ord($sKeyChar)); $sResult .= $sChar; } return encode_base64($sResult); } //------------------------------------------------ function decrypt($sData, $sKey) { $sResult = ''; $sData = decode_base64($sData); for($i = 0; $i < strlen($sData); $i ++) { $sChar = substr($sData, $i, 1); $sKeyChar = substr($sKey, ($i % strlen($sKey)) - 1, 1); $sChar = chr(ord($sChar) - ord($sKeyChar)); $sResult .= $sChar; } return $sResult; } //------------------------------------------------ function encode_base64($sData) { $sBase64 = base64_encode($sData); return strtr($sBase64, '+/', '-_'); } //------------------------------------------------ function decode_base64($sData) { $sBase64 = strtr($sData, '-_', '+/'); return base64_decode($sBase64); } //------------------------------------------------ define("OUR_SALT", "The B45t4rd5 mu5t P4y"); ?>
MonkeySweat.com
Share with us your jokes, stories, links, articles, and anything you want!