Howto gpg: Difference between revisions
Jump to navigation
Jump to search
Mandulete1 (talk | contribs) (Created page with "= Comandos de GPG = Para generar la llave: gpg --gen-key Para listar las llaves que tenemos: gpg --list-keys Para lista las llaves privadas: gpg --list-secret-keys Para exp...") |
Mandulete1 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
= Comandos de GPG = | = Comandos de GPG = | ||
create key: | |||
gpg --gen-key | gpg --gen-key | ||
list all keys: | |||
gpg --list-keys | gpg --list-keys | ||
list private keys: | |||
gpg --list-secret-keys | gpg --list-secret-keys | ||
export public key: | |||
gpg --export --armor -o llave.key key-id | gpg --export --armor -o llave.key key-id | ||
export private key to file: | |||
gpg --export-secret-keys -a 1234ABCD > secret.asc | gpg --export-secret-keys -a 1234ABCD > secret.asc | ||
import key: | |||
gpg --import llave.key | gpg --import llave.key | ||
delete public key: | |||
gpg --delete-key key-id | gpg --delete-key key-id | ||
delete private key: | |||
gpg --delete-secret-keys key-id | gpg --delete-secret-keys key-id | ||
encrypt file: | |||
gpg -r NAME --output OUTFILE.gpg --encrypt INFILE | gpg -r NAME --output OUTFILE.gpg --encrypt INFILE | ||
decrypt file: | |||
gpg -r NAME --output OUTFILE --decrypt INFILE.gpg | gpg -r NAME --output OUTFILE --decrypt INFILE.gpg | ||
Especificar llave para firmar llave publica: | Especificar llave para firmar llave publica: |
Revision as of 02:33, 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
Especificar llave para firmar llave publica:
gpg -u my-key-id --sign-key public-key-id
Buscar llave en servidor:
gpg --keyserver pgp.mit.edu --search-keys orders@offensive-security.com
Importar llave desde servidor:
gpg --keyserver pgp.mit.edu --recv-keys 38707F0CDF4D52D4
Exportar llame a servidor:
gpg --send-keys --keyserver pgp.mit.edu 38707F0CDF4D52D4
Encryptando con llave de otra persona
Para encryptar un archivo que otra persona pueda abrirlo necesitamos importar la llave de esa persona:
gpg --import other_persons_pub_key_file.asc
Firmamos la llave publica
gpg --sign-key "their User ID"
Para encryptar el archivo con la llave publica de la persona:
gpg --yes -eq -r "their User ID" -o archivo_encriptado.pgp nombre_archivo