Code for encryption system, use amfrencrypt() to encrypt and amfrdecrypt() to decrypt
PHP Code:
CODE
function amfrencrypt($string, $password)
{
$password = md5($password);
$encnum = 0;
for($k = 0; $k < strlen($password); $k++)
{
if(is_string($password{$k}))
{
$encnum += ord($password{$k});
}
}
if($encnum == 0)
{
die('Invlaid password!');
}
for ($i = 0; $i < strlen($string); $i++)
{
$str[] = $string{$i};
}
$count = count($str);
for($j = 0; $j < $count; $j++)
{
$encstr[] = ord($str[$j]) * $encnum;
}
$return = implode(':', $encstr);
return $return;
}
function amfrdecrypt($string, $password)
{
$password = md5($password);
$str = explode(':', $string);
$encnum = 0;
for($k = 0; $k < strlen($password); $k++)
{
if(is_string($password{$k}))
{
$encnum += ord($password{$k});
}
}
if($encnum == 0)
{
die('Invlaid password!');
}
$count = count($str);
for($j = 0; $j < $count; $j++)
{
$encstr[] = chr($str[$j] / $encnum);
}
$return = implode('', $encstr);
return $return;
}
I am not planning to use this encryptions system, and if you do, please dont sue me if someone decrypts all your data!
kvarnerexpress

