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) |
||
(3 intermediate revisions by the same user not shown) | |||
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 | ||
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 | ||
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 | ||
import public key from keyserver pgp.mit.edu: | |||
gpg --keyserver pgp.mit.edu --recv-keys 38707F0CDF4D52D4 | 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 | 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 | gpg --import other_person_pub_key_file.asc | ||
sign public key: | |||
gpg --sign-key " | gpg --sign-key "User ID" | ||
encrypt file with another person pgp public key: | |||
gpg --yes -eq -r " | 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