Skip to content

Instantly share code, notes, and snippets.

@BobGu
Created May 25, 2017 02:07
Show Gist options
  • Save BobGu/af9b3df39dfbe822da86a2c6e7872133 to your computer and use it in GitHub Desktop.
Save BobGu/af9b3df39dfbe822da86a2c6e7872133 to your computer and use it in GitHub Desktop.
  • Generate a public/private key pair! gpg --generate-key

  • Export a public key gpg --output name_of_file.gpg --export email_of_user

  • Import a public key gpg --import name_of_file.gpg

  • Encrypt a file gpg --recipient address@example.com --output encrypted_file.gpg --encrypt name_of_file.txt

  • Decrypt a file gpg --output name_of_file.txt --decrypt encypted_file.gpg

  • Sign and encrypt a file gpg --recipient address@example.com --encrypt --sign name_of_file.txt

The output flag is use the specify the name of the newly created file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment