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");
?>
Office Fun
Office Fun
- The best way to predict the future is to invent it.
- I don't have a solution, but I do admire the problem.
- If we knew what we were doing it wouldn't be called research.
- A company is known by the people it keeps.
- Never underestimate your abilities. That is your boss's job.
- Everyone has a photographic memory. Some don't have film.
- Hard work never killed anyone, but why chance it?
- Speak the truth, but leave immediately after.
- A clean tie attracts the soup of the day.