/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker:# */
class Crypto
{
public function encrypt($data)
{
$encrypted_data = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, base64_decode(ENCRYPT_B64_KEY), $data, ENCRYPT_MODE, ENCRYPT_IV);
$base64_encrypted_data = base64_encode($encrypted_data);
return $base64_encrypted_data;
}
public function decrypt($data)
{
$encrypted_data = base64_decode($data);
$decrypted_data = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, base64_decode(ENCRYPT_B64_KEY), $encrypted_data, ENCRYPT_MODE, ENCRYPT_IV);
return trim($decrypted_data);
}
}
?>
UNIO solutions s.r.o.