php文件加密原理(php 怎么用zend加密)

本文目录
php 怎么用zend加密
可以加密就可以解密。
解密ZEND加密后的PHP文件:
zend加密php文件解密工具Dezender可以做到。
1、下载Dezender.zip
2、解压到盘里面,最好不要有中文路径,比如解压到 I:\Dezender 里面,修改 I:\Dezender\PHP5\PHP5\php.ini文件,修改里面的文件路径。
3、打开cmd命令行
然后就可以看见文件目录下面会多出一个文件 文件名.de.php
4、进入I:\Dezender 目录下面的
5、写一个批处理文件,可以直接把一个目录下面的文件全部批量解密
这个php文件时用什么方式加密的,加密时用什么算法的
这个是使用ionCube加密的,
《?php
require_once( "init.php" );
sb_modules::loadClass( "SB_Modules_Transport_Server_Response" );
$Var_72-》SB_Modules_Transport_Server_Response( );
$response = $Var_72;
execute( );
sendResponse( );
?》
目前尚无完美发解决办法,明码后如上,$Var_72可根据init.php进行纠错
php aes加密~呢
AES加密算法
密码学中的高级加密标准(Advanced Encryption Standard,AES),又称Rijndael加密法,是美国联邦政府采用的一种区块加密标准。这个标准用来替代原先的DES,已经被多方分析且广为全世界所使用。
《?php
class CryptAES
{
protected $cipher = MCRYPT_RIJNDAEL_128;
protected $mode = MCRYPT_MODE_ECB;
protected $pad_method = NULL;
protected $secret_key = ’’;
protected $iv = ’’;
public function set_cipher($cipher)
{
$this-》cipher = $cipher;
}
public function set_mode($mode)
{
$this-》mode = $mode;
}
public function set_iv($iv)
{
$this-》iv = $iv;
}
public function set_key($key)
{
$this-》secret_key = $key;
}
public function require_pkcs5()
{
$this-》pad_method = ’pkcs5’;
}
protected function pad_or_unpad($str, $ext)
{
if ( is_null($this-》pad_method) )
{
return $str;
}
else
{
$func_name = __CLASS__ . ’::’ . $this-》pad_method . ’_’ . $ext . ’pad’;
if ( is_callable($func_name) )
{
$size = mcrypt_get_block_size($this-》cipher, $this-》mode);
return call_user_func($func_name, $str, $size);
}
}
return $str;
}
protected function pad($str)
{
return $this-》pad_or_unpad($str, ’’);
}
protected function unpad($str)
{
return $this-》pad_or_unpad($str, ’un’);
}
public function encrypt($str)
{
$str = $this-》pad($str);
$td = mcrypt_module_open($this-》cipher, ’’, $this-》mode, ’’);
if ( empty($this-》iv) )
{
$iv = @mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
}
else
{
$iv = $this-》iv;
}
mcrypt_generic_init($td, hex2bin($this-》secret_key), $iv);
$cyper_text = mcrypt_generic($td, $str);
$rt = strtoupper(bin2hex($cyper_text));
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
return $rt;
}
public function decrypt($str){
$td = mcrypt_module_open($this-》cipher, ’’, $this-》mode, ’’);
if ( empty($this-》iv) )
{
$iv = @mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
}
else
{
$iv = $this-》iv;
}
mcrypt_generic_init($td, $this-》secret_key, $iv);
//$decrypted_text = mdecrypt_generic($td, self::hex2bin($str));
$decrypted_text = mdecrypt_generic($td, base64_decode($str));
$rt = $decrypted_text;
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
return $this-》unpad($rt);
}
public static function hex2bin($hexdata) {
$bindata = ’’;
$length = strlen($hexdata);
for ($i=0; $i《 $length; $i += 2)
{
$bindata .= chr(hexdec(substr($hexdata, $i, 2)));
}
return $bindata;
}
public static function pkcs5_pad($text, $blocksize)
{
$pad = $blocksize - (strlen($text) % $blocksize);
return $text . str_repeat(chr($pad), $pad);
}
public static function pkcs5_unpad($text)
{
$pad = ord($text{strlen($text) - 1});
if ($pad 》 strlen($text)) return false;
if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) return false;
return substr($text, 0, -1 * $pad);
}
}
//密钥
$keyStr = ’6D6A39C7078F6783E561B0D1A9EB2E68’;
//加密的字符串
$plainText = ’test’;
$aes = new CryptAES();
$aes-》set_key($keyStr);
$aes-》require_pkcs5();
$encText = $aes-》encrypt($plainText);
echo $encText;
?》

更多文章:
unlikely(not likely和unlikely含义一样吗)
2025年10月23日 20:45
kindeditor 在dialog中居中(在Iframe中使用jquery ui dialog 怎么使弹出窗口居于浏览器中间)
2025年7月27日 23:15
ASP.NET MVC 4框架揭秘:Controller类型的缓存?RxCache缓存框架
2026年6月1日 06:00
java编程工具免费(请问java编写程序除了用eclipse,还可以用什么我主要是想做web前端的,有没有什么视图化的软件啊)
2025年8月4日 12:30
memcached性能(PHP中4个加速,缓存扩展的区别和选用建议)
2025年9月8日 08:45
2 3表示什么python(python语句:print(*[1,2,3]),是什么意思)
2026年8月14日 22:30
java下载了打不开(为什么下载了java也玩不了我的世界)
2026年5月17日 05:15
timeformat函数(GetTimeFormat怎么用,各个参数尤其是最后一个有点看不懂)
2025年11月13日 04:30
sqlite3规则(sqlite3数据库 运行一段时间后 命令行操作出现:Error:unsupported file format)
2025年10月25日 22:45
extensional mentality的意思(mentality是什么意思)
2026年1月6日 13:00











