Howto gpg: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 20: Line 20:
decrypt file:
decrypt file:
  gpg -r NAME --output OUTFILE --decrypt INFILE.gpg
  gpg -r NAME --output OUTFILE --decrypt INFILE.gpg
Especificar llave para firmar llave publica:
sign key using specific key:
  gpg -u my-key-id --sign-key public-key-id
  gpg -u my-key-id --sign-key public-key-id
Buscar llave en servidor:
search for public keys:
  gpg --keyserver pgp.mit.edu --search-keys orders@offensive-security.com
  gpg --keyserver pgp.mit.edu --search-keys orders@offensive-security.com
Importar llave desde servidor:
import public key from keyserver pgp.mit.edu:
  gpg --keyserver pgp.mit.edu --recv-keys 38707F0CDF4D52D4
  gpg --keyserver pgp.mit.edu --recv-keys 38707F0CDF4D52D4
Exportar llame a servidor:
make your public key available at keyserver pgp.mit.edu:
  gpg --send-keys --keyserver pgp.mit.edu 38707F0CDF4D52D4
  gpg --send-keys --keyserver pgp.mit.edu 38707F0CDF4D52D4
= Encryptando con llave de otra persona =
= encrypt file =
Para encryptar un archivo que otra persona pueda abrirlo necesitamos importar la llave de esa persona:
to encrypt a file using another person gpg public key do the following:
  gpg --import other_persons_pub_key_file.asc
  gpg --import other_person_pub_key_file.asc
Firmamos la llave publica
sign public key:
  gpg --sign-key "their User ID"
  gpg --sign-key "User ID"
Para encryptar el archivo con la llave publica de la persona:
encrypt file with another person pgp public key:
  gpg --yes -eq -r "their User ID" -o archivo_encriptado.pgp nombre_archivo
  gpg --yes -eq -r "their User ID" -o archivo_encriptado.pgp nombre_archivo

Revision as of 02:39, 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 "their User ID" -o archivo_encriptado.pgp nombre_archivo