Encrypt or Decrypt a File With GPG Command Line

Encrypt or decrypt a file with GPG command line, and require a passphrase be entered each time by your GPG agent.

#--- Tuesday, November 20, 2018
#--- GPG agent disabled cache so always prompted for password
#--- ~/.gnupg/gpg-agent.conf
default-cache-ttl 600 > 0
max-cache-ttl    7200 > 0

#--- Restart GPG agent after changing cache
echo RELOADAGENT | gpg-connect-agent

#--- Encrypt pass > pass.gpg
gpg -c pass

#--- Decrypt pass with provided passphrase
gpg -d pass.gpg 2>/dev/null | less -I

#--- Delete insecure original file
rm -rf pass