encrypt snippets

How to encrypt/decrypt a file with GPG

Tagged decrypt, encrypt, gpg, password  Languages bash

First, install GPG:

brew install gpg

To encrypt a file with GPG, run:

gpg -c secrets.txt

To decrypt the encrypted and password-protected GPG file, run:

gpg secrets.txt.gpg