Tuesday 2 August 2016

Basic GPG Commands

1. Generate key pairs:

gpg --gen-key

2. To encrypt data:

gpg -e -u "Sender User Name" -r "Receiver User Name" somefile

3. To decrypt data:

gpg -d mydata.tar.gpg

4.  Delete keys
NOTE!  You must delete your private key for this key pair from your private key ring first, before deleting the public key from your public key ring.

To delete an private key (a key on your private key ring):
gpg --delete-secret-key "User Name"

To delete a public key (from your public key ring):
gpg --delete-key "User Name"

5. List keys

To list the keys in your public key ring:
gpg --list-keys

To list the keys in your secret key ring:
gpg --list-secret-keys

6. Edit key:

gpg --edit-key Your-Key-ID-Here
gpg> passwd
gpg> save


Reference:

No comments:

Post a Comment