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]$ ls
date_schedule lsa_schedule ls.txt schedule ssh STDERR.txt STDIN_STDOUT STDIN_STDOUT.txt TestFile1 The_Tee_command.txt
[philip@localhost Documents]$ gpg -c The_Tee_command.txt
Enter passphrase:
We have to enter a password/passphrase, then reenter it, as follows...