All checks were successful
git-sync-with-mirror / git-sync (push) Successful in 45s
131 lines
1.6 KiB
Markdown
131 lines
1.6 KiB
Markdown
## Gnu Privacy Guard
|
|
|
|
### Generate
|
|
|
|
```console
|
|
gpg --full-gen-key
|
|
```
|
|
|
|
### Basic usage
|
|
|
|
Signature sig mode:
|
|
|
|
```console
|
|
gpg --detach-sign file.ext
|
|
```
|
|
|
|
Signature asc mode:
|
|
|
|
```console
|
|
gpg --armor --sign file.ext
|
|
```
|
|
|
|
Verify:
|
|
|
|
```console
|
|
gpg --verify file.sig
|
|
```
|
|
|
|
### My user-id
|
|
|
|
```console
|
|
gpg -K
|
|
```
|
|
|
|
### All users-ids
|
|
|
|
```console
|
|
gpg -k
|
|
```
|
|
|
|
### Copy Public Key
|
|
|
|
```console
|
|
gpg --export --armor $(gpg -K --with-colons | awk -F: '/^sec/ { getline; print $10; exit }')
|
|
```
|
|
|
|
### Copy Private key (Caution)
|
|
|
|
```console
|
|
gpg --export-secret-keys -a <user-id> | xclip -sel clip
|
|
```
|
|
|
|
### Change password gpg
|
|
|
|
```console
|
|
gpg --edit-key <user-id>
|
|
passwd
|
|
```
|
|
|
|
### Debug gpg
|
|
|
|
```console
|
|
dirmngr --debug-level guru
|
|
```
|
|
|
|
### Import key:
|
|
|
|
```console
|
|
gpg --recv-keys $esefingerprint
|
|
```
|
|
|
|
### Import key from server:
|
|
|
|
```console
|
|
gpg --recv-keys <user-id> --keyserver pgp.mit.edu
|
|
```
|
|
|
|
### Export key 0:
|
|
|
|
```console
|
|
gpg --export --armor <user-id> > public.key
|
|
```
|
|
|
|
### Export key 1:
|
|
|
|
```console
|
|
gpg --armor --output public.key --export <user-id>
|
|
```
|
|
|
|
### Export key to server
|
|
|
|
```console
|
|
gpg --keyserver pgp.mit.edu --send-keys <user-id>
|
|
```
|
|
|
|
## Cifrado
|
|
### Cifrado simétrico
|
|
#### Cifrar
|
|
|
|
```console
|
|
gpg --symmetric <miarchivo>
|
|
```
|
|
|
|
#### Descifrado
|
|
|
|
```console
|
|
gpg --output <archivo.ext> --decrypt <archivo.gpg>
|
|
```
|
|
|
|
### Cifrado Asimétrico
|
|
#### Encryt
|
|
|
|
```console
|
|
gpg --recipient <user-id> --encrypt archivo.ext
|
|
```
|
|
|
|
#### Decrypt
|
|
|
|
```console
|
|
gpg --output archivo.ext --decrypt archivo.ext.gpg
|
|
```
|
|
|
|
## Refresh keys
|
|
|
|
```console
|
|
gpg --refresh-keys
|
|
```
|
|
|
|
### wiki
|
|
https://www.gnupg.org/gph/es/manual/book1.html
|