Difference between revisions of "Linux: gpg"
Jump to navigation
Jump to search
Rafahsolis (talk | contribs) (Created page with "== GnuPG == == Simetric Cipher == === Encryption === gpg -c file.txt we will be prompt for a password. === Decryption === gpg -d file.txt we will be prompt for a password....") |
Rafahsolis (talk | contribs) |
||
| Line 11: | Line 11: | ||
=== Generate keys === | === Generate keys === | ||
gpg --gen-key | gpg --gen-key | ||
| + | |||
=== Export public key === | === Export public key === | ||
| + | ==== To file ==== | ||
gpg --output <destination_file.gpg> --export <public_key_ID> | gpg --output <destination_file.gpg> --export <public_key_ID> | ||
| − | === | + | ==== To server ==== |
gpg --send-keys --keyserver pgp.mit.edu 18384645 | gpg --send-keys --keyserver pgp.mit.edu 18384645 | ||
| + | |||
| + | === Import public keys === | ||
| + | ==== From file ==== | ||
| + | gpg --import <publickeyfile.gpg> | ||
| + | ==== From server ==== | ||
| + | gpg --keyserver pgp.mit.edu --recv-keys 18384645 | ||
| + | |||
| + | === Encrypt with a public key === | ||
| + | gpg --encrypt --recipient <key ID> <file> | ||
| + | === Decrypt with private key === | ||
| + | comando gpg -d <encrypted_file> | ||
Revision as of 17:29, 17 May 2015
GnuPG
Simetric Cipher
Encryption
gpg -c file.txt
we will be prompt for a password.
Decryption
gpg -d file.txt
we will be prompt for a password.
Asimetric Cipher
Generate keys
gpg --gen-key
Export public key
To file
gpg --output <destination_file.gpg> --export <public_key_ID>
To server
gpg --send-keys --keyserver pgp.mit.edu 18384645
Import public keys
From file
gpg --import <publickeyfile.gpg>
From server
gpg --keyserver pgp.mit.edu --recv-keys 18384645
Encrypt with a public key
gpg --encrypt --recipient <key ID> <file>
Decrypt with private key
comando gpg -d <encrypted_file>