Skip to content

Instantly share code, notes, and snippets.

@schneefisch
Last active September 27, 2020 17:35
Show Gist options
  • Save schneefisch/c4269c299d5b650bdb2722d6439f742d to your computer and use it in GitHub Desktop.
Save schneefisch/c4269c299d5b650bdb2722d6439f742d to your computer and use it in GitHub Desktop.
Basic GPG usage
#!/usr/bin/env bash
# encrypt file for specific key
gpg --output doc.gpg --encrypt --recipient blake@cyb.org doc
# encrypt with multiple recipients
gpg --output doc.gpg --encrypt --recipient blake@cyb.org --recipient bob@example.com doc
# decrypt file
gpg --output doc --decrypt doc.gpg
# list keys
gpg --list-keys
# Export keys
gpg --output <your.key>.gpg --armor --export 255F00609FFFCBA4AB14DC141701DEF2B7C7C6B6
gpg --output <your.key>.gpg --armor --export-secret-key 255F00609FFFCBA4AB14DC141701DEF2B7C7C6B6
# Import keys
gpg --import ~/mygpgkey_pub.gpg
gpg --allow-secret-key-import --import ~/mygpgkey_sec.gpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment