Difference between revisions of "Linux: gpg"
Jump to navigation
Jump to search
Rafahsolis (talk | contribs) |
Rafahsolis (talk | contribs) m (Protected "Linux: gpg" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
Revision as of 21:01, 17 May 2015
GnuPG
Simetric Cipher
Encryption
gpg -c file.txt
we will be prompt for a password.
Or:
gpg -ca file.txt
If we want an ascii output
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>
Signing
Sign
gpg -u <private_Key_ID> --output <output_signed_file> --sign <file_to_sign>
Verify signature
gpg -d <signed_file>
or
gpg --verify <signed_file>