1.加密解密类
1 class Mcrypt 2 { 3 /** 4 * 解密 5 * 6 * @param string $encryptedText 已加密字符串 7 * @param string $key 密钥 8 * @return string 9 */ 10 public static function _decrypt($encryptedText,$key = null) 11 { 12 $key = $key === null ? Config::get('secret_key') : $key; 13 $cryptText = base64_decode($encryptedText); 14 $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); 15 $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND); 16 $decryptText = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key,

本文介绍了一个PHP类库,用于实现数据的加密和解密,并提供了对Cookie的加密管理功能,包括设置、获取及删除操作。
最低0.47元/天 解锁文章
446

被折叠的 条评论
为什么被折叠?



