In today's environment, it's critical to safeguard our data. We can use various methods of encryption; in our environment, we will use the GNU Privacy Guard (GnuPG, or GPG) for encrypting and decrypting our files and folders. We will use the gpg command when working with encryption and decryption.

First, we will encrypt a file using the most basic form, symmetric encryption; this uses a password. The following command shows how we can perform symmetric encryption using the gpg command, with either the -c or --symmetric option:

[philip@localhost ~]$ cd Documents/[philip@localhost Documents]$ lsdate_schedule  lsa_schedule  ls.txt  schedule  ssh  STDERR.txt  STDIN_STDOUT  STDIN_STDOUT.txt  TestFile1  The_Tee_command.txt[philip@localhost Documents]$ ...

Get CompTIA Linux+ Certification Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.