Skip to content

Instantly share code, notes, and snippets.

@SanCoder-Q
Last active December 19, 2018 03:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SanCoder-Q/13c8eccd9908cf11912cc9e98d3b9f0b to your computer and use it in GitHub Desktop.
Save SanCoder-Q/13c8eccd9908cf11912cc9e98d3b9f0b to your computer and use it in GitHub Desktop.
Using gpg to transfer file in a secure way
# install GnuPG
brew install gpg
# generate gpg key pair
gpg --gen-key
# list keys
gpg --list-keys
# export public key
gpg --armor --export <pubuid> > public.key
# import public key
gpg --import public.key
# encrypt file
gpg --output <file.enc> --encrypt --recipient <key recipient name / email> <file>
# decrypt file
gpg --decrypt --output <file> <file.enc>
# remove key
gpg --delete-key <key recipient name / email>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment