| |
GNU Privacy Guard exercises
Install GPG:
In the example below, there is key and message echange between users
carol (Carol Wilson) and jack (Jack Black).
First, you need to
create two user accounts, carol and jack.
You can use the different user names. Note, in the exercise below, you
will need to remember gpg passphrases for each user you will generate.
You may store them in a file or, for simplicity, use the same passphrase
for all the users.
Run to initialize gpg
Follow the instructions to generate keys:
choose (1) DSA and ElGamal (default);
choose 1024 bit encription; set expiration time two months (2m);
remember the passfrase; keep typing something random while the keys are
being generated.
Make your public key available for exchange
File carol.pub contains the public key.
Recipient of your key, Jack Black, imports it:
Verifys it:
If the recipient accepts it, he should sign it:
Carol Wilson creates a new file and signs it.
For example, for a text file netapp.txt,
she creates a signature:
It creates a new file, netapp.txt.sig
The recepient, who already has imported and signed your public key,
verifies it:
If the signature is correct, in the output, there should be:
gpg: Good signature from "Carol Wilson "
Sending/Receiving signed encrypted messages.
Carol needs to import and sign Jack's public key the same way as
he did with her's. The sender use the recepient's public keys to
encrypt a message. The recepient decrypts the message with the private
key.
Sender, Carol Wilson, encrypts file netapp.txt with Jack's public key and
saves it in a new file, forjack.gpg:
Carol Wilson gives or sends file forjack.gpg to Jack Black.
Receiver, Jack Black, reads the file:
To save the output in a text file, say forjack.txt:
Verify signature for dowloaded software:
Download the following files:
DJM-GPG-KEY.asc
openssh-4.4p1.tar.gz
openssh-4.4p1.tar.gz.asc
Import the public key:
Check if the key has been added:
Signe the key:
Verify that the signute for the software is good:
Delete the key from the keyring:
Verify that the key has been deleted:
|
|