Advertisment

Mail Certification 

author-image
PCQ Bureau
New Update

In the article titled Encrypt your Mail (page 56) in our November 2004 issue, we talked about installing and configuring GnuPG and using it to encrypt and decrypt e-mail. In this article we will show you how to use the same tool to create PGP keys and sign your messages. Signing is important to prove your identity to the recipient. For that, first write the message in a text editor and save it as message.txt. Now, open a terminal window and issue the command below to sign it digitally. 

Advertisment

# gpg --local-user "YOUR NAME" --clearsign

"message.txt"

You will now be asked to enter the pass-phrase you created while generating your GnuPG key. Your file will be now be signed and a new file called message.txt.asc will be generated. If you open this file you will see message content as shown in the accompanying box. Now, copy the content of this file into your e-mail compose box and send it to the recipient. You also need to send your public key to this recipient, either by publishing it on a Web page or sending it over e-mail. But you must export the keys to a text file for this by issuing the following command from a terminal window.

Direct Hit!
Applies to:

Linux desktop users
USP:

Secure your mail messages using PGP keys 
Links:

http://webber.dewinter.com/gnupg_howto/,

https://www.pcquest.com/content/linux/2004/104102903.asp 
Advertisment

# gpg -a -o /public_key.txt

This will export all your keys to a file called public_key.txt. The recipient will have to import and install this file, in order to read your signed e-mail. This is done by issuing 

# gpg -import "public_key.txt"

Advertisment

The above command will output a message as: 

gpg: key ED91A810: public key "john doe (en)

johndoe@email.com
>"

imported



gpg: Total number processed: 1


gpg: imported: 1

Advertisment

GPG looks for the information 'BEGIN PGP PUBLIC KEY BLOCK' line in this text and ignores everything outside that block. So after importing the key pairs, the recipient has to set a trust level on it by issuing

# gpg -edit-key "Public key Name" 

Content of message.txt.asc



-----BEGIN PGP SIGNED MESSAGE-----


Hash: SHA1





Hi this is a test secret message that i am sending


to test the digital signature using Gnupg.


-----BEGIN PGP SIGNATURE-----


Version: GnuPG v1.2.6 (GNU/Linux)





iD8DBQFBwn3AUIRaOu2RqBARAlqyAJ9gDs


DRf5KIEKHoJM+iDN6KEWpX6gCcCd4Z7IT+8nPPsU4LS09X9tOdxOo=


=iXYc


-----END PGP SIGNATURE-----










Note: 'Public Key Name' will be replaced by the name of the pubic key you have received. This command will take the recipient into the interactive editing mode, where he needs to enter the command 'trust' and select level 5 from the list. Then he needs to type 'quit' and save the settings. With this, his system will be ready to receive signed mail from you, the sender. 

Sanjay Majumder

Advertisment