Skip to content

Instantly share code, notes, and snippets.

@clayrisser
Last active March 4, 2019 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clayrisser/f785b1891f41ad936ec1dcce919e2e2b to your computer and use it in GitHub Desktop.
Save clayrisser/f785b1891f41ad936ec1dcce919e2e2b to your computer and use it in GitHub Desktop.
How to use gpg

Install

OSX

brew install gnupg

Ubuntu

sudo apt-get install gnupg
  1. Create a gpg key pair
gpg --gen-key
  1. List keys
gpg --list-keys
  1. Send public key to keyserver
gpg --send-keys --keyserver hkps://keys.siliconhills.co 49C3F21959FE60C43FB8B92C8D7A1978A4342247
  1. Verify the key was sent to https://keys.siliconhills.co

  2. Dowload everyones public keys from keyserver

gpg --receive-keys --keyserver hkps://keys.siliconhills.co
  1. Verify everyones public keys were recieved
gpg --list-keys
  1. Create group using gpg hashes
echo "group siliconhills = 49C3F21959FE60C43FB8B92C8D7A1978A4342247 9FCE71411C99BE71F0DF9030BFDFA353F398E06A" >> ~/.gnupg/gpg.conf
  1. Verify group was created
gpg --with-colons --list-config group
  1. Encrypt a file

individuals

gpg --encrypt --sign --armor -r jam@codejam.ninja -r email@example.com hello.txt

group

gpg --encrypt --sign --armor -r siliconhills
  1. Decrypt a file
gpg --decrypt hello.txt.asc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment