http://www.gnupg.org/gph/en/manual.html
http://irtfweb.ifa.hawaii.edu/~lockhart/gpg/gpg-cs.html
First generate the key on your computer:
gpg --gen-key
Show the keys on your computer:
gpg --list-keys
Show one of the keys in preparation for exporting to a PGP server
gpg --export -a <ID>
where <ID> is one of the key IDs
[Same usage on Windows with GNU PGP (from http://www.gnupg.org/download/index.en.html) as on linux.
gpg is built in to ubuntu.]
[In general, I usually don't sign messages.]
gpg --list-keys
/home/user/.gnupg/pubring.gpg
----------------------------
pub 1024D/<ID> <DATE>
uid <NAME> <EMAIL>
sub 1024g/<ID2> <DATE>
pub 1024D/<ID> <DATE>
uid <NAME> <EMAIL>
sub 1024g/<ID2> <DATE>
Suppose you have a file which you want to encrypt:
ls
<text msg>
e for encrypt, a for ascii, r for recipient
gpg -e -a -r <ID> <text msg>
gpg: <ID>: There is no assurance this key belongs to the named user
pub 1024g/<ID> <DATE> <NAME> <EMAIL>
Primary key fingerprint: XX29 XAXX XX4X XX89 XXXX AXXX ...
Subkey fingerprint: XA43 XAXX X43X XX99 XXXX XXXX ...
It is NOT certain that the key belongs to the person named
in the user ID. If you *really* know what you are doing,
you may answer the next question with yes.
Use this key anyway? (y/N) y
see the files created
ls
<text msg> <text msg>.asc
import public key
gpg --import public.key
decrypt
gpg -d filename
Migration from one box to another:
You will need to export your secret keys.
gpg -K
Export the file
gpg --export -a <ID> >> secret_key.txt