zipcloak encrypts files within an existing zip archive.

This page covers the Linux version of zipcloak.

Description

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

  • Description
  • Removing encryption from the archive
  • Outputting the encrypted archive to a new file
  • Technical description
  • Syntax
  • Examples
  • Related commands
  • Linux commands help

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 the following command:

zipcloak archive.zip

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

Enter password: Verify password:

…if the passwords match, it encrypts each file in the archive:

encrypting: file1 encrypting: file2

…and now, when you try to unzip the archive, it prompts 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 want 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 removes 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 creates a new, encrypted version of the archive named encrypted.zip.

Technical description

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

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

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.

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

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

Syntax

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

Options

Examples

zipcloak myarchive.zip

Encrypt the myarchive.zip file. The zipcloak command prompts 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 removes 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.