There are many use cases for creating encrypted file archives. One such use case is managing file backups. In this short blog post we look into how to use tar and gpg to achieve that. Creating the archive Generating an encrypted archive is fairly trivial: $ tar -cvzf - directory | gpg -c > directory.tar.gz.gpg In the above snippet, tar creates a compressed archive of the directory specified, using gzip, and pipes the data to gpg for encryption, before writing to the output file. The ‘-c’ ...