Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can you put multiple files in a GPG/PGP encrypted file?

Just wondering.

share|improve this question
up vote 5 down vote accepted

On Linux, I'd tarball and compress the files first, then encrypt them. I do not believe GPG can encrypt multiple files in one go.

share|improve this answer
Spot-on. PGP/GPG does encryption. In order to encrypt multiple files, you'd need to archive them in something like tar, zip, rar, etc. The newfangled commercial Windows versions of PGP may be able to do such thing (see the PGP-Zip). I do know that GPG and "classic" command line PGP does not. – Geoff Fritz Nov 30 '09 at 17:13
GPG probably never will; the idea is that you can simply encrypt a tarball instead. tar is a lot better at concatenating files than gpg is; if something replaces tar you can still use gpg to encrypt the new program's output rather than having to fix gpg to support that new file format. Notably there are exceptions to this (tar will automatically handle gzip/bzip2 files) but it's been important to Unix, Linux, GNU et al. to swap out parts of the toolchain when needed. – Broam Nov 30 '09 at 18:22
GPG and PGP do compression (to increase security) - so encrypting a .tar is enough, no need to gzip it. – grawity Nov 30 '09 at 20:14
Nothing wrong with tarballing first, but actually you can encrypt and decrypt multiple files in one go with the --encrypt-files and --decrypt-files options. For example: gpg -a --encrypt-files -r 0xDEADBEEF *.txt # this will result in a .txt.asc file for each .txt file which is encrypted to 0xDEADBEEF – Ben Jun 19 '15 at 10:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .