如何使用php创建具有256位加密的zip文件 [英] How to create zip file with 256 bits encryption using php
本文介绍了如何使用php创建具有256位加密的zip文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
使用PHP创建加密的zip存档
如何使用PHP创建具有256位加密的压缩文件
How to create zipped file with 256 bits encryption using PHP
如果有任何示例,那就太好了
If there is any example it'll be great
推荐答案
在Linux上,您可以使用7zip创建AES加密的zip文件:
On Linux you can use 7zip to create AES encrypted zip files:
exec("7z a -p$PASSWORD -mem=AES256 -tzip $ZIP $SOURCE");
Nfabio 的礼貌,来自 http://ubuntuforums.org/archive/index.php/t-1694923.html
请务必应用 escapeshellarg()
。
Be sure to apply escapeshellarg()
.
注意:虽然此方法可行,但最好不要调用
带有嵌入式密码的外壳。从php 7.2开始,不再需要
了,因为 php现在原生支持AES zip
加密。
这篇关于如何使用php创建具有256位加密的zip文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文