Skip to content

Instantly share code, notes, and snippets.

@SansGuidon
Last active June 9, 2017 16:00
Show Gist options
  • Save SansGuidon/8c989cc6efdfc98eeaa43f1182942763 to your computer and use it in GitHub Desktop.
Save SansGuidon/8c989cc6efdfc98eeaa43f1182942763 to your computer and use it in GitHub Desktop.
Using GPG for file encryption
# file encryption using private and public key : the recipent public key is used in this case
alice$ gpg --output secret.bin --encrypt --recipient bob.public.key secret.txt
bob$ gpg --output secret.txt --decrypt secret.txt
# file encryption without using priv/pub key
gpg --output secret.bin --symmetric --cipher-algo AES256 secret.txt
gpg --output secret.txt --decrypt secret.bin