Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a WinZip compatible AES-256 encrypted zip file from PHP on Linux?

I have to create a WinZip compatible zip file from a PHP application on a linux box, and it must use AES 256 encryption. I have found a few solutions for PHP on Windows, but they don't help me! A PHP package would be great, but if I need to, I can always have my PHP code run exec() or something to run a linux command line utility.

Any suggestions?

like image 311
Jason Avatar asked Oct 21 '10 14:10

Jason


People also ask

Do you need WinZip to open an encrypted Zip file?

Encrypted Email message msg file inside the Zip file, then that can be opened in Outlook. The receiver doesn't need WinZip Courier, but if they have this latest version or newer, a button is provided to open the message after you have type in the password, making it much more convenient.

Does WinZip support AES 256?

WinZip supports AES encryption in two strengths, 128-bit AES and 256-bit AES. The different numbers refer to the size of the encryption key that protects your files. A larger number has greater security, but in reality – if someone could crack a 128-bit AES encryption, they could also crack 256-bit AES.


1 Answers

Not php-specific (this question is highly ranked in google also without php): 7-Zip implements this feature, in my documentation I found this command:

7za a -tzip -pPASSWORD -mem=AES256 target.zip filelist
like image 177
MoreIT Avatar answered Oct 14 '22 02:10

MoreIT