You are here: >

Linux and Unix zipcloak command

zipcloak commandAbout zipcloak
zipcloak syntax
zipcloak examples
Related commands
Linux and Unix main page

About zipcloak

zipcloak encrypts files within an existing zip archive.

Encrypting Archives Using zipcloak

Archives created with the zip utility can be encrypted in two ways: by using zip's --encrypt option at archive time, or after the zipfile is created by using the zipcloak utility.

Let's say you have a zipfile archive.zip which contains two files, file1 and file2, and you'd like to encrypt its contents so that only users who know the password can extract its contents. You can do this with zipcloak using this command:

zipcloak archive.zip

zipcloak will prompt you for a password, and then ask you to confirm it:

Enter password: 
Verify password:

...if the passwords match, it will encrypt each file in the archive:

encrypting: file1
encrypting: file2

...and now, when you try to unzip the archive, it will prompt you for the password before allowing you to extract the files it contains:

unzip archive.zip
Archive:  archive.zip
[archive.zip] file1 password:

Although it asks for "file1 password", you only need to enter the password once to decrypt and extract all of the files in the archive.

Removing Encryption From The Archive

Later, if you wish to remove the encryption from the zipfile, you can use the -d option of zipcloak, like this:

zipcloak -d archive.zip

zipcloak will then ask you for the password that was used to encrypt the zipfile:

Enter password:

...and if you enter it correctly, zipcloak will remove the encryption from the files in the archive:

decrypting: file1
decrypting: file2

...and return you to the command prompt.

Outputting The Encrypted Archive To A New File

You also have the option of leaving the original archive unencrypted, and creating a new encrypted version of the archive instead. Let's say your original, unencrypted archive is named archive.zip, and you want to create an encrypted version of the archive called encrypted.zip, leaving the original file unchanged. You could use zipcloak's -O option to accomplish this. Run this command:

zipcloak archive.zip -O encrypted.zip

...and zipcloak will operate as usual, except that instead of encrypting the original archive, it will create a new, encrypted version of the archive named encrypted.zip.

Technical Description

zipcloak encrypts all unencrypted entries in the specified zipfile. This is the default action.

The -d option is used to decrypt encrypted entries in the zipfile.

Warning: zipcloak uses original zip encryption, which is considered weak in comparison to modern algorithms.

The encryption code of this program is not copyrighted and is in the public domain. It was originally written in Europe and can be freely distributed from any country including the United States. (Previously, if this program was imported into the U.S., it could not be re-exported from the U.S. to another country. See the file README.CR included in the source distribution for more information.) Otherwise, the Info-ZIP license applies.

Please note that archives larger than 2 gigabytes are not supported by zipcloak.

zipcloak syntax

zipcloak [-d] [-b path] [-h] [-v] [-L] zipfile

Options

-b path

--temp-path path
Use the directory given by path for the temporary zip file.
-d

--decrypt
Decrypt encrypted entries (copy if given wrong password).
-h

--help
Display a help message, and exit.
-L

--license
Display software licensing information, and exit.
-O newfile

--output-file newfile
Write output to new archive newfile, leaving original archive as is.
-q

--quiet
Operate quietly, suppressing some informational messages.
-v

--version
Display version information, and exit.

zipcloak examples

zipcloak myarchive.zip

Encrypt myarchive.zip. zipcloak will prompt you to enter a password, then ask you to confirm it; if they match, it will encrypt the file so that it cannot be decrypted without that password.

zipcloak myarchive.zip -O encrypted.zip

Encrypt the contents of archive myarchive.zip, but write the encrypted archive to a new file, encrypted.zip, and leave myarchive.zip unencrypted.

zipcloak -d myarchive.zip

Remove any encryption previously placed on myarchive.zip using zipcloak. You will be prompted for the password before it will remove the encryption.

unzip — List, test and extract compressed files in a zip archive.
zip — A compression and archiving utility.
zipnote — View, add, or modify a zip file's comments.
zipsplit — Split a single zip archive into a set of smaller zip files.