encrypt linux backup folder using gpg

Wiktor Kwapisiewicz wiktor at metacode.biz
Tue Nov 6 12:22:24 CET 2018

On 06.11.2018 10:42, Francesco Ariis wrote:
> Hello Kaushal,
> On Tue, Nov 06, 2018 at 11:25:47AM +0530, Kaushal Shriyan wrote:
>> I am using CentOS 7.5 Linux OS in my setup. I have compressed a folder
>> using tar utility tar czvf backupfolder.tar.gz backupfolder. Is there a way
>> to encrypt backupfolder.tar.gz using gpg? Are there any best practices to
>> use gpg application to encrypt the data. Any help will be highly
>> appreciated and i look forward to hearing from you.
> in Debian is there a small utility (`gpg-zip`, found in the `devscripts`
> package) which does just that. Maybe it's packaged in CentOS too!
> -F

Maybe that's too simple but what about just:

  gpg --encrypt --recipient $YOU backupfolder.tar.gz

Of course after generating the key (gpg --gen-key).

Best practices:
  - use most recent GnuPG,
  - you can generate keys on another computer (offline?) and export just
public parts to the one that does encryption,
  - you can move decryption keys to a hardware token.

Kind regards,


More information about the Gnupg-users mailing list