Файл: Main Website Files/application/libraries/Cipher.php
Строк: 19
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Cipher {
private $securekey, $iv;
function __construct($textkey = null) {
$this->securekey = hash('sha256',$textkey[0],TRUE);
$this->iv = mcrypt_create_iv(32);
}
function encrypt($input) {
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->securekey, $input, MCRYPT_MODE_ECB, $this->iv));
}
function decrypt($input) {
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->securekey, base64_decode($input), MCRYPT_MODE_ECB, $this->iv));
}
}
?>