Using 7-Zip to create AES-256 encrypted zip files from the command line

Sunday, March 11, 2018


The default encryption method used by 7-Zip for Zip files, and the only method supported by InfoZip, is ZipCrypto, which is generally pretty terrible. To create AES-256 encrypted archives using 7-Zip, use:

$ 7z a -tzip -mem=AES256 -p super-secret.zip super-secret.txt

To verify that it worked, use:

$ 7za l -slt super-secret.zip

Notice that all the filenames within the archive are visible; I don't think 7-Zip supports Zip header encryption. You can do it the ghetto way by simply putting a Zip inside an encrypted Zip to hide the filenames in the inner one.

Tags: | Posted at 20:50 | Comments (4)


Comments

Konrad Gaworek on Tuesday, January 28, 2020 at 04:57

Hi,
7z supports header encription:
(from manual)
-mhe=on|off
7z format only : enables or disables archive header
encryption (Default : off)

David Zhang on Tuesday, January 28, 2020 at 17:51

-mhe=on only works with 7-Zip (*.7z) archives, not Zip archives, as noted in the manual snippet you've pasted.

As far as I can tell, you can't pass -mhe=on (or anything equivalent) to 7-Zip when creating Zip archives.

gWxXThtIJMVN on Sunday, May 24, 2020 at 11:29

QVoTuNFr

HUwvrOfzcShL on Sunday, May 24, 2020 at 11:29

DIRlhvgmzE

Add a comment

Name:
Email: (optional, not displayed to public)
URL:

Comment: