This little reference guide has examples that allow encryption/decryption and signature generation/verification with GnuPG.
Encryption
- To encrypt a file:
and the encrypted content of
$ gpg --encrypt file.txt
file.txt
will be on output filefile.txt.gpg
. - ASCII armored encryption:
$ gpg --armor --encrypt file.txt
file.txt.asc
will contain the ASCII armored encryptedfile.txt
. - To specify a recipient:
$ gpg --recipient rec
- To specify the output file name:
Instead of the default
$ gpg --output fileout.gpg --encrypt file.txt
file.txt.asc
, output tofileout.gpg
. - To decrypt a file:
$ gpg --decrypt file.asc
Signatures
- To create a detached signature:
$ gpg --sign myfile.txt
file.txt.gpg
will be created with the binary signature. - To create a detached signature ASCII armored:
$ gpg --armor --sign myfile.txt
file.txt.gpg
will be created with the ASCII armored signature. - To create an attached signature:
$ gpg --clearsign myfile.txt
file.txt.gpg
will be created with both the message and the signature. - To verify a signature:
Verifies optional parameter
$ gpg --verify [sig.asc] myfile.txt
sig.asc
againstmyfile.txt
.
Revision History
Post built on: 2014-08-25 22:13:30
Last modified on: 2014-08-25 22:13:06
First published on: 2014-08-25
Revision | Date | Description |
---|---|---|
1.00 | 2014-08-25 | Initial Version. Published. |
No comments :
Post a Comment