Created
November 6, 2019 10:22
-
-
Save monadplus/980a52e32ccc024d2811911adcebc892 to your computer and use it in GitHub Desktop.
GPG: example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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