19 December, 2025

How to use GPG - basic sample code

GPG: Show the stored password in the terminal

Send the content of the file to std out (-o):

# gpg -d -o - mySecrets.gpg


GPG: Encrypt a file

# gpg --encrypt --recipient recipient@example.com file.txt

The command will create the file file.gpg - and of course the file with the secret message must be deleted.


Also see the man page.


No comments: