/*
* 类中,功能部分功能没有提炼,还需进一步修改
*/
class Mymcrypt {
// 盐值 [字符串]
public $key = "mrdede.com";
function __construct($salt=''){
$this->salt = $salt; // [string] 盐值 可以为空
}
// 加密
public function do_mencrypt($input)
{
// $key = substr(md5($this->key), 0, 24);
// $td = mcrypt_module_open('des', '', 'ecb', '');
// $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_ECB, '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
//没有做key size设定
$key_size = mcrypt_enc_get_key_size($td); //返回所支持的最大的密钥长度(以字节计算)
// echo "==== $key_si