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 foobar.zip 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

Decrypt an encrypted PDF file using QPDF

PDF files from certain sources might be secured or DRM protected or encrypted. This might prevent you from adding annotations, editing, printing or even viewing the file. Essentially the file is read-only for you, locking you out of making changes to it.

A PDF file which is encrypted can be decrypted using QPDF:

$ qpdf --decrypt in.pdf out.pdf

Tried with: QPDF 3.0.2

PDFTK: Owner password required error

Problem

You try to manipulate some PDF files using PDFTK and it gives the following error:

Error: Failed to open PDF file:
   101.pdf
   OWNER PASSWORD REQUIRED, but not given (or incorrect)

Solution

The PDF files for which PDFTK prints this error might be password protected or encrypted. If you can open and view the PDF file using any PDF viewer then it might mean that the PDF files are protected or encrypted with an empty password.

To be able to apply PDFTK on these files, you will need to remove the protection or decrypt the files. One way to do this is using the QPDF tool.

Tried with: PDFTK 1.44