Gnu PGP my cheat sheet

How to import PGP public key?
gpg --import 99242560.key
gpg: key DB698D7199242560: public key "David M. Shaw <dshaw@jabberwocky.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: next trustdb check due at 2018-01-09

How to verify the file signature?
gpg --verify paperkey-1.4-win32.zip.sig
gpg: assuming signed data in 'paperkey-1.4-win32.zip'
gpg: Signature made 09/06/16 02:01:14 GMT Daylight Time
gpg:                using RSA key FEA78A7AA1BC4FA4
gpg: Good signature from "David M. Shaw <dshaw@jabberwocky.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7D92 FD31 3AB6 F373 4CC5  9CA1 DB69 8D71 9924 2560
     Subkey fingerprint: A154 3829 812C 9EA9 87F1  4526 FEA7 8A7A A1BC 4FA4

How to export private PGP key to other machine?
gpg --export-secret-keys | gpg --symmetric --cipher-algo AES256 --armor > key.asc

How to import private PGP key from other machine (note the "--output -" parameter, it is necessary to pipe output to import command)?
gpg --output - key.asc | gpg --import

After importing key, we need to edit it, to assign a trust to that key
gpg --edit-key key.email@gmail.com
Secret key is available.

gpg> trust
sec  rsa4096/07EAAD40AAD862C2
     created: 2017-05-24  expires: 2018-01-09  usage: SC
     trust: unknown       validity: unknown
ssb  rsa4096/49B31AC5FDCC14EF
     created: 2017-05-24  expires: 2018-01-09  usage: E
[ unknown] (1). Bart Prokop (2017) <prokop.bart@gmail.com>

Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)

  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

gpg> quit
.
.
.

Comments

Popular posts from this blog

Hardening OpenWRT - adding non-root user account

Dropbear SSH keys and autossh on OpenWRT

SSH Tunel with OpenWRT