How can I create an AES-256 encrypted ZIP file from WinZip from PHP to Linux?

I need to create a WinZip compatible ZIP file from a PHP application in a linux window, and it must use AES 256 encryption. I found several PHP solutions on Windows, but they do not help me! A PHP package would be great, but if I need to, I can always run my PHP exec () code or something to run the linux command line utility.

Any suggestions?

+6
linux php aes winzip
source share
2 answers

Not php-specific (this question is highly rated on google and without php): 7-Zip implements this function, in my documentation I found this command:

7za a -tzip -pPASSWORD -mem=AES256 target.zip filelist 
+1
source share
  • If the Zip application clone is not already installed on your host, just do a Google search to install one of hundreds of different email applications that can support both encryption and cross-platform compatibility.
  • Use `exec` or a similar PHP function to call any available external zip application that can encrypt and apply AES-256 encryption to your target file, you need to know any command line keys that your zip application needs for this to happen. The names of the target files in the string parameter `exec` can, of course, be disabled using variables.
  • Submit a new zip file

However, if encryption is not a concern, see the PHP Zip class for creating shared zip files: http://php.net/manual/en/book.zip.php

0
source share

All Articles