GPG Encryption

Using GPG to encrypt a text file, in this case a password file

Use gpg to encrypt the file named secretpasswords.txt. Running this will generate an encrypted version of secretpasswords.txt called secretpasswords.txt.gpg using your gpg key. You will need to enter your gpg password.

gpg -c secretpasswords.txt

Now we have an encrypted file, in this case secretpasswords.txt.gpg and we need to decrypt it to view the contents. Typing this will display the decrypted contents of secretpasswords to the console after entering your password.

gpg -d secretpasswords.txt.gpg