How to encrypt zip file

Some workplaces have tight restrictions on email attachments containing binaries. So, people in such environments request me to send the attachment by zipping up the suspicious files and encrypting it. Zip has had support for password protection for a long time so most receivers will be able to unzip the contents if you can provide the password you used for encrypting.

To create the zip files:

$ zip --password mypassword files to zip go here

Note that zip uses weak encryption. Use it only to get around the email servers, not for actually hiding data.

Tried with: Ubuntu 14.04

How to zip or unzip any file using atool

Files available on the internet are in a myriad archive or compressed formats. And when you want to zip some files, you might find yourself choosing different compression formats depending on the intended use, receiver or file size.

It would be easy to have a single commandline tool that can deal with all these compression formats. Thankfully, both Ubuntu and Cygwin ship withΒ the awesome atool.

It can be installed using the package named atool. On Cygwin, it is available with the package name atool.

To unzip a file compressed in any format, use the aunpack command. For example:

$ aunpack foobar-zipped.7z

To compress files into a zip file of any format, use the apack command. For example:

$ apack foobar-zipped.bz2 foobar/*

Tried with: atool 0.38.0 and Ubuntu 12.04.1 LTS, atool 0.39.0 and Cygwin 1.7.22