Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just tried to encrypt a folder with 7zip by command line choosing a password but when double-clicking on the zip file, it shows me the files list without asking any password.

Any other alternative freeware which allow to truly encrypt a folder by command line ?

share|improve this question
add comment

7 Answers

up vote 10 down vote accepted

The ZIP format doesn't allow for encrypting file lists. This means that file lists are viewable by anyone.

Only the contents of the files is encrypted, which means that no-one can read the file without your password.

Due to this, 7-zip only asks for your password before unzipping.

If you need a format that encrypts the file list, use 7Z and make sure you check "Encrypt File Names".

For the more technical minded, the ZIP spec doesn't allow for encryption of the Central Directory.

share|improve this answer
add comment

You can use GNU Tar to turn the directory into a single file, which you can then compress as a regular file with 7z. Anyone viewing the archive will just see the tar file.

share|improve this answer
    
Hi Good suggestion –  asksuperuser Nov 14 '09 at 23:52
add comment

Double clicking will show you the files. Now try to extract one... as I recall, that is when you'll get the password prompt.

share|improve this answer
add comment

You will be prompted for a password when you try to extract the files. To simply view the contents of the archive does not require a password.

If you would like to obfuscate the contents of the archive, compress the directory into an archive, and then compress that archive with a password. Thus, you will have to extract the archive with a password, to pull out the archived (and obfuscated) contents.

share|improve this answer
    
Don't waste your CPU cycles on compression the second time round, if you can avoid it, though. –  Phoshi Nov 13 '09 at 22:58
    
True enough. It's certainly easy enough to select Store for the compression mechanism on the second iteration. I have Fastest set as my default, and 7-Zip is ridiculously fast anyway. :) –  JMD Nov 13 '09 at 23:26
add comment

in case, you're using Total Commander with the 7-Zip Plugin, press ALT + F5 (or Files > Pack...) to compress files or folders, click Configure and check the box Encrypt File Headers and Names.

other than that, Andrew Moore's answer is correct.

share|improve this answer
    
Thanks for the tips –  asksuperuser Nov 14 '09 at 23:50
add comment

I found your answer here: Do encrypted compression containers like ZIP and 7-Zip compress or encrypt first?

The command line switch to encrypt the headers (i.e. the file names) in 7zip is: -mhe=on

share|improve this answer
add comment

Generalized solution that works for all zip programs (WINzip, 7zip, MacZip,...) is to simply zip it twice making sure the second time (or both) have password protected encryption.

See: http://kb.winzip.com/kb/entry/147

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.