您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php提供的对称加密算法|Mcrypt.class.php

2025/1/19 6:41:50发布15次查看
key 是之前定义的常量
mcrypt::encrypt();
mcrypt::decrypt();
defined('root') or exit('access denied'); class mcrypt{ public static function encrypt($code){ return base64_encode(mcrypt_encrypt(mcrypt_rijndael_256, md5(key), $code, mcrypt_mode_ecb, mcrypt_create_iv(mcrypt_get_iv_size(mcrypt_rijndael_256, mcrypt_mode_ecb), mcrypt_rand))); } public static function decrypt($code){ return mcrypt_decrypt(mcrypt_rijndael_256, md5(key), base64_decode($code), mcrypt_mode_ecb, mcrypt_create_iv(mcrypt_get_iv_size(mcrypt_rijndael_256, mcrypt_mode_ecb), mcrypt_rand)); } }
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product