File: D:/HostingSpaces/NVonken/mijneigenlied.com/wwwroot/Core/Core Parts/encryption.part.php
<?php
class Encryption
{
private static $_iv = "K0sdlco32fsaFmpP9dn7nqLn3dkSnv83";
private static $_key = "Dial93VlqgNdf3IflAladfnLie2o8iNC";
/**
* Encrypt a string
* @static
* @param string $text string to encrypt
* @return string encrypted string
*/
public static function Encrypt($text)
{
$cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, '');
if (mcrypt_generic_init($cipher, Encryption::$_key, Encryption::$_iv) !== false)
{
$encryptedText = mcrypt_generic($cipher, $text);
mcrypt_generic_deinit($cipher);
return bin2hex($encryptedText);
}
return "ERROR";
}
/**
* Decrypt a string
* @static
* @param string $text
* @return string Decrypted text
*/
public static function Decrypt($text)
{
$cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, '');
if (mcrypt_generic_init($cipher, Encryption::$_key, Encryption::$_iv) !== false)
{
$decryptedText = mdecrypt_generic($cipher, General::hex2bin($text));
mcrypt_generic_deinit($cipher);
return $decryptedText;
}
return "ERROR";
}
}
?>