# encrypt file
# (-armor will create an ASCII file)
gpg --encrypt --sign --armor -r <e-mail> <file>
# encrypt multiple files
for f in some/path/*.pdf; do g=${f##*/}; gpg --encrypt --recipient <e-mail> --armor --output $g.gpg $f; done
# decrypt
gpg --decryptd --output <file.dec> <file.enc>
# decrypt multiple files
for f in some/path/*.gpg; do g=${f##*/}; gpg --decrypt --output ${g%.*} ${f}; done
# export/backup keys
gpg --export-options backup --export-secret-keys -o <file> <e-mail>
# import/restore keys
gpg --import-options restore --import <file>
Last active
August 14, 2022 12:57
-
-
Save brabect1/ae239b62eb85c3d8d857665d44e0a46a to your computer and use it in GitHub Desktop.
gpg usage for file encrypting and decrypting #gpg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you! this is very useful!