Contents
KGpg is an important component of the encryption infrastructure on your system. This program helps you to generate and manage all needed keys. Use its editor function for the quick creation and encryption of files or use the applet in your panel to encrypt or decrypt by dragging and dropping. Other programs, such as your mail program (Kontact or Evolution), access the key data to process signed or encrypted contents. This chapter covers the basic functions needed for daily work with encrypted files.
Signing means attaching electronic signatures to mails or even software to prove its correct derivation. To avoid that someone writes mails using your name and to protect both you and the people you send them to, you should sign your mails. Signatures help you to easily check the sender of the mails you receive and to distinguish good-natured mails from malicious.
Software developers sign their software so you are able to check its integrity. Even if you have the software from an unofficial server, you can verify the package with the signature.
You might have sensitive information you want to protect from other parties. Encrypting helps you to transform data and make it unreadable for others. This is especially important for companies who must protect internal information as well as the employees' privacy.
To be able to exchange encrypted messages with other users, first generate your own key pair. One part of it—the public key—is distributed to your communication partners, who can use it to encrypt the files or e-mail messages they send. The other part of the key pair—the private key—is used to decrypt the encrypted contents.
![]() | Private Key versus Public Key |
|---|---|
The public key is intended for the public and should be distributed to all your communication partners. However, only you should have access to the private key. Do not grant other users access to this data. | |
Start KGpg from the main menu or press Alt+F2 and enter kgpg. When you start the program for the first time, an assistant appears to guide you through the configuration. Follow the instructions up to the point where you are prompted to create a key. Enter a name, an e-mail address, and, optionally, a comment. If you do not like the default settings provided, also set the expiration time for the key, the key size, and the encryption algorithm used. See Figure 10.1, “KGpg: Creating a Key”.
When you start KGpg in later sessions, only a small icon with a padlock appears in the system tray. Click that icon to display the main KGpg window on your desktop.
Confirm your settings with . The next dialog prompts you to enter a password twice. The relative strength of your chosen password is measured and displayed by the . The program then generates the key pair and displays a summary. It is a good idea to save or print a revocation certificate right away. Such a certificate is needed if you forget the password for your private key so need to revoke it. After you confirm with , KGpg displays its main window. See Figure 10.2, “The Key Manager”.
After generating your key pair, make the public key available to other users. This enables them to use it to encrypt or sign the messages or files they send you. To make the public key available for others, select +. The dialog that opens offers four options:
Your public key is sent to a recipient of your choice by e-mail. If you activate this option and confirm with , the dialog for creating a new e-mail message with KMail appears. Enter the recipient and click . The recipient receives your key and can then send you encrypted contents.
You can place your public key here before continuing to process it.
To make your public key available to a wide audience, export it to one of the key servers on the Internet. For more information, refer to Section 10.5, “The Key Server Dialog”.
If you prefer to distribute your key as a file on a data medium instead of sending it by e-mail, click this option, confirm or change the file path and name, and click .
If you receive a key in a file (for example, as an e-mail attachment), integrate it in your key ring with and use it for encrypted communication with the sender. The procedure is similar to the procedure for exporting keys already described.
Keys can be signed like every other file to guarantee their authenticity and integrity. If you are absolutely sure an imported key belongs to the individual specified as the owner, express your trust in the authenticity of the key with your signature.
![]() | Establishing a Web of Trust |
|---|---|
Encrypted communication is only secure to the extent that you can positively associate public keys in circulation with the specified user. By cross-checking and signing these keys, you contribute to the establishment of a Web of Trust. For these reasons, make really sure you only sign keys you personally checked. | |
Select the key to sign in the key list. Select +. In the following dialog, designate the private key to use for the signature. An alert reminds you to check the authenticity of this key before signing it. If you have performed this check, click and enter the password for the selected private key in the next step. Other users can now check the signature by means of your public key.
Normally, you are asked by the corresponding program whether you trust the key, or rather, whether you assume it is really used by its authorized owner. This happens each time a message needs to be decrypted or a signature must be checked. To avoid this, edit the trust level of the newly imported key. By default, the newly imported key is listed with a white box, meaning that no concrete value has been assigned for the trust level. To trust a key, do the following:
Right-click the newly imported key to access a small context menu for the key management.
Select . KGpg opens a dialog that asks the user to recheck the fingerprint of the key.
Use to access the key signing dialog.
Select your trust level, for example, select . Finish this dialog.
Enter your passphrase to finish the key signing process. The imported key now appears green in the trust column.
The lower the trust level is, the less you trust the signer of the key to have checked the true identity of the keys signed. You may be entirely sure about the signer's identity, but he may not check other people's identities properly before signing their keys. Therefore, you could still trust him and his own key, but assign lower trust levels to the keys signed by him. Notice that the trust level does not trigger any automatic actions by KGpg.
Several Internet-based key servers offer the public keys of many users. To engage in encrypted communication with a large number of users, use these servers to distribute your public key. For this purpose, export your public key to one of these servers. Similarly, KGpg enables you to search one of these servers for the keys of certain people and import their public keys from the server. Open the key server dialog with +.
By means of the tab in the key server dialog, import public keys from one of the Internet-based key servers. Select one of the preconfigured key servers and enter a search string (e-mail address of the communication partner) or the ID of the key to find. When you click , your system connects to the Internet and searches the specified key server for a key that matches your specifications. Refer to Figure 10.3, “Search Screen for Importing a Key”.
If your search on the key server is successful, a list of all retrieved server entries is displayed in a new window. Select the key to include in your key ring and click . See Figure 10.4, “Hits and Import”. Confirm the following message with then exit the key server dialog with . The imported key then appears in the main overview of the key manager and is ready for use.
To export your key to one of the freely accessible key servers on the Internet, select the tab in the key server dialog. Designate the target server and the key to export by means of two drop-down menus. Then start the export with .
KGpg also offers the possibility to encrypt text or clipboard contents. Right-click the padlock icon and find the options and as well as the option for opening the integrated editor.
Files copied to the clipboard can easily be encrypted with a few clicks. Open the function overview by right-clicking the KGpg padlock icon. Select and designate the key to use. A status message about the encryption procedure is displayed on the desktop. The encrypted contents can now be processed from the clipboard as needed. The decryption of clipboard contents is just as easy. Simply open the menu on the panel, select , and enter the password associated with your private key. The decrypted version is now available for processing in the clipboard and in the KGpg editor.
To encrypt or decrypt files, click the icons on
the desktop or in the file manager, drag them to the padlock in
the panel, and
drop them there. If the file is not encrypted,
KGpg asks for the key to use. As soon as you
select a key, the file is encrypted without any further
messages. In the file manager, encrypted files are designated with the
suffix .asc and the padlock icon. These files can be
decrypted by clicking the file icon, dragging it to the
KGpg symbol in the panel, and dropping it there. If the original
filename already exists, a dialog opens that asks how to name the
file or if it should be overwritten.
Instead of creating contents for encryption in an external editor then encrypting the file with one of the methods described above, you can use the integrated editor of KGpg to create the file. Open the editor ( from the context menu), enter the desired text, and click . Then select the key to use and complete the encryption procedure. To decrypt files, use and enter the password associated with the key.
Generating and checking signatures on documents is just as easy as encrypting directly from the editor. Select a file in the file manager and copy it to the clipboard. Right-click the padlock icon in the panel and select . Then choose the private key to use and enter the associated password. KGpg informs about the successful generation of the signature. Files can also be signed from the editor by simply clicking . To check a signed file, go to +, load the file to check in the editor, and click .
For theoretical background information about the encryption method, refer to the brief and clear introduction on the GnuPG project pages at http://www.gnupg.org/documentation/howtos.html.en. This document also provides a list of further information sources.