add password to existing zip file with 7zip

30

5

Is it possible to add a password to an existing zipfile with 7zip without going to all the trouble of unpacking it and re-packing it again?

matt wilkie

Posted 2010-11-25T00:01:52.517

Reputation: 4 147

What platform (Linux, Windows, ...) are you using? – whitequark – 2010-11-25T02:14:26.293

@Dennis: well, if you are writing this seriously, it's sad, and if not, it's not funny anyway. (And what if I'd say that regular 7zip executable won't run on Windows 3.11?) – whitequark – 2010-11-25T03:07:29.133

I run windows 7 and ubuntu linux 10.10, depending on what needs doing. 7zip is cross platform though so what difference does that make? – matt wilkie – 2010-11-25T16:33:11.957

Answers

23

By nature if you want the file to be encrypted, it needs to be unpacked and repacked, since the whole archive needs to be encrypted with the password.

neurolabs

Posted 2010-11-25T00:01:52.517

Reputation: 246

2That's the correct answer ;) - Even if a program gives you an option to add a password to a ZIP file in one single step it will internally repack all files. – BlaM – 2010-11-27T15:27:14.507

1@BlaM thanks for the clarification. Though thinking about it more carefully, the "going to all the trouble" bit is really about avoiding my trouble, not the computer's. ;-) So I'd be okay with that option, which doesn't seem to available anyway. – matt wilkie – 2010-11-29T00:20:24.557

13

Would it work for you to zip the zip file? Use no/low compression and encrypt the original zip file. Its a lot quicker than repacking the original files.

HaavardMeling

Posted 2010-11-25T00:01:52.517

Reputation: 231

0

You can password-protect an existing ZIP file with zipcloak.

EDIT: T. Furukawa crafted a patch for zipcloak that adds a password option, so batch processing is much easier: C:\>for %f in (*.zip) do zipcloak -p password %f.

If you prefer a GUI, both WinRAR and PeaZip can batch encrypt existing archives.

  • In WinRAR: Select ZIP files > Tools > Convert archives > Compression... > Set password...

  • In PeaZip: Select ZIP files > Convert > Enter password / keyfile (optionally set algorithm to ZipCrypto under the Advanced tab for compatibility with Windows' built-in ZIP handling)

Miles Wolbe

Posted 2010-11-25T00:01:52.517

Reputation: 508

6zipcloak isn't 7zip as OP asked for :/ – nmz787 – 2016-11-19T02:18:52.617