«

»

Oct 22

gpg command line

First create a key:

gpg --gen-key

For generation I use the default of RSA and RSA, and I use 4096 bits, and i usually let the keys live for 1y.

Create a Revocation Certificate so you can Revoke you key on a keyserver

gpg --gen-revoke --armor --output=GPGRevocationCertificate.asc your@email.address

Create your ASCII public key so other people can encrypt to you.

gpg --armor --output pubkey.txt --export 'Your Name'
Post it to a key server
gpg --send-keys 'Your Name' --keyserver http://pgp..mit.edu

To encrypt you need to add your self as a recipiant.

gpg --encrypt --recipient 'Your Name' secret.txt

To decrypt a file.

gpg --output secret.txt --decrypt secret.txt.gpg

If you want to add a user to your keyring.

gpg --import key.asc

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Close Bitnami banner
Bitnami