Skip to content

Instantly share code, notes, and snippets.

@monadplus
Created November 6, 2019 10:22
Show Gist options
  • Save monadplus/980a52e32ccc024d2811911adcebc892 to your computer and use it in GitHub Desktop.
Save monadplus/980a52e32ccc024d2811911adcebc892 to your computer and use it in GitHub Desktop.
GPG: example
#!/bin/bash
# Let's encrypt a file with recipient's public key
gpg --recipient monadplus --encrypt gpg-example.sh # Binary file
gpg --recipient monadplus --armor --encrypt gpg-example.sh # ASCII file
# Let's decrypt
gpg --decrypt gpg-example.sh.gpg # This will prompt the passphrase of the private key
####################
# Generate a new key and add it to the system.
gpg --gen-key
gpg --list-keys # List pub keys
gpg --list-secret-keys # List private keys
# Import GPG
gpg --import FileName
# Export GPG
gpg --export monadplus > monadplus-pub.gpg
gpg --armor --export monadplus > monadplus-pub-asc.gpg # block format (old) - for ASCII files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment