Jump to content

Gnupg

From MattWiki
(Redirected from Pgp)

GPG allows you to encrypt and sign your data and communication, features a versatile key management system as well as access modules for all kinds of public key directories. If interested, also read more about PGP Keyservers and the SKS Keyserver.

GPG Command Line Program[edit | edit source]

Encrypting a File[edit | edit source]

gpg -e -r <Key-ID> <File-Name>

Signing a File[edit | edit source]

gpg -s -r <Key-ID> <File-Name>

Encrypting & Signing a File[edit | edit source]

gpg -es -r <Key-ID> <File-Name>

Verifying a Signature[edit | edit source]

gpg --verify <File-Name>

Decrypting a File[edit | edit source]

gpg -d <File-Name>

Signing a Key Locally[edit | edit source]

gpg --lsign-key <Key-ID>

Refresh Public Keys from Key Servers[edit | edit source]

gpg --refresh-keys

Exporting a Public Key to a file[edit | edit source]

gpg --export <Key-ID> > <Key-ID>.pub.asc

Exporting a Public Key to a Key Server[edit | edit source]

gpg --keyserver keys.gnupg.net --send-keys <Key-ID>

Importing a Public Key from a File[edit | edit source]

gpg --import <Key-ID>

Importing a Public Key from a Key Server[edit | edit source]

gpg --search-keys [<Key-ID> OR <Email Address>]

Or you may add the key server url

gpg --keyserver hkp://keys.gnupg.net --search-keys [<Key-ID> OR <Email Address>]

Setting Trust Level on a Key[edit | edit source]

gpg --edit-key <Key-ID>

  Command> trust
     1 = I don't know or won't say
     2 = I do NOT trust
     3 = I trust marginally
     4 = I trust fully
     5 = I trust ultimately
     m = back to the main menu
  Your decision? 5 
  Do you really want to set this key to ultimate trust? (y/N) y
  Command> save

gpg --update-trustdb

Creating a new Private Key[edit | edit source]

gpg --gen-key