Howto gpg: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
 
Line 35: Line 35:
encrypt file with another person pgp public key:
encrypt file with another person pgp public key:
  gpg --yes -eq -r "User ID" -o encrypted-file.pgp filename.zip
  gpg --yes -eq -r "User ID" -o encrypted-file.pgp filename.zip
= decrypt file =
decrypt file:
gpg -r NAME --output OUTFILE --decrypt INFILE.gpg

Latest revision as of 02:47, 30 April 2021

Comandos de GPG

create key:

gpg --gen-key

list all keys:

gpg --list-keys

list private keys:

gpg --list-secret-keys

export public key:

gpg --export --armor -o llave.key key-id

export private key to file:

gpg --export-secret-keys -a 1234ABCD > secret.asc

import key:

gpg --import llave.key

delete public key:

gpg --delete-key key-id

delete private key:

gpg --delete-secret-keys key-id

encrypt file:

gpg -r NAME --output OUTFILE.gpg --encrypt INFILE

decrypt file:

gpg -r NAME --output OUTFILE --decrypt INFILE.gpg

sign key using specific key:

gpg -u my-key-id --sign-key public-key-id

search for public keys:

gpg --keyserver pgp.mit.edu --search-keys orders@offensive-security.com

import public key from keyserver pgp.mit.edu:

gpg --keyserver pgp.mit.edu --recv-keys 38707F0CDF4D52D4

make your public key available at keyserver pgp.mit.edu:

gpg --send-keys --keyserver pgp.mit.edu 38707F0CDF4D52D4

encrypt file

to encrypt a file using another person gpg public key do the following:

gpg --import other_person_pub_key_file.asc

sign public key:

gpg --sign-key "User ID"

encrypt file with another person pgp public key:

gpg --yes -eq -r "User ID" -o encrypted-file.pgp filename.zip

decrypt file

decrypt file:

gpg -r NAME --output OUTFILE --decrypt INFILE.gpg