> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing GnuPG keys in cPanel

> Learn to manage email encryption with GNU Privacy Guard keys in cPanel: create, import, view, and delete keys.

This article describes how to manage email encryption with GNU Privacy Guard keys in cPanel.

## About GnuPG

The GNU Privacy Guard, also known as GnuPG or GPG, is an open-source implementation for public-key cryptography. Public-key cryptography systems use public and private keys (keypairs) to encrypt and decrypt e-mail messages, files, and so on. Senders use recipients' public keys to encrypt items, and recipients use their own private keys to decrypt the items.

You can easily create, import, view, and delete keys by using cPanel.

## Creating a new key

To use GnuPG encryption, you must first create a new keypair.

To create a new GnuPG keypair, follow these steps:

1. Log in to cPanel.
   > 📘 Note
   >
   > If you do not know how to log in to your cPanel account, please see [this article](/docs/accessing-cpanel).

2. On the **Tools** page, in the **Email** section, click **Encryption**:\
   ![](https://static.hosting.com/kb/kb-cpanel-jupiter-email-encryption-icon.png)

3. Under **Create a New Key**, type your name in the **Your Name** text box.

4. In the **Your Email** text box, type your e-mail address.

5. In the **Comment or Nickname** text box, type a comment or nickname for the key.

   > 📘 Note
   >
   > Typically, this field is used to differentiate between different keys. You can also leave this field empty if you prefer.

6. In the **Key Password** text box, type the password that you want.

7. In the **Password (Again)** text box, retype the password.

   > 👍 Tip
   >
   > You can click **Password Generator** and cPanel generates a random, strong password for you.

8. In the **Expiration Date** text box, type an expiration period for the key. The default expiration date is one year. Alternatively, click **Do not expire** if you do not want an expiration date for the key.

9. In the **Key Size** list box, select a key size.

   > 📘 Note
   >
   > Larger key sizes are more secure. However, encryption and decryption with larger key sizes is slower. In practice, key sizes of 1024 bits or 2048 bits are adequate.

10. Click **Generate Key**. cPanel creates the key.

    > 📘 Note
    >
    > It may take several minutes to generate the keypair. When the process is complete, the message **The Key has been successfully created** appears.

## Importing a key

If you already have a keypair, you can import your public key.

<Warning>
  **️ Warning**

  Make sure that you import your **public** key! Do not try to import your **private** key.
</Warning>

To import a public key, follow these steps:

1. Log in to cPanel.
   > 📘 Note
   >
   > If you do not know how to log in to your cPanel account, please see [this article](/docs/accessing-cpanel).

2. On the **Tools** page, in the **Email** section, click **Encryption**:\
   ![](https://static.hosting.com/kb/kb-cpanel-jupiter-email-encryption-icon.png)

3. Under **Import Key**, click **Import Public GPG Key**.

4. Copy and paste the key text into the text box.

   > 🚧 Important
   >
   > When you copy and paste the key text, make sure that you include the beginning and ending lines of the key:

   ```
   -----BEGIN PGP PUBLIC KEY BLOCK-----
   Key data
   -----END PGP PUBLIC KEY BLOCK-----
   ```

5. Click **Import**. cPanel imports the key.

You can view or delete keys that you have created or imported.

To view or delete a key, follow these steps:

1. Log in to cPanel.
   > 📘 Note
   >
   > If you do not know how to log in to your cPanel account, please see [this article](/docs/accessing-cpanel).

2. On the **Tools** page, in the **Email** section, click **Encryption**:\
   ![](https://static.hosting.com/kb/kb-cpanel-jupiter-email-encryption-icon.png)

3. Locate the key that you want to view or delete. For each email address there will be a private key and a public key.

   * To view the key, click **View**.

   * To delete the key, locate the private key and click **Delete GnuPG Key**, then click **Yes** to confirm the deletion. The private key and the public key will both be deleted.

## More information

* For more information about GnuPG, please visit [http://www.gnupg.org/documentation/index.en.html](http://www.gnupg.org/documentation/index.en.html).

* For more information about public-key cryptography, please visit [http://en.wikipedia.org/wiki/Public-key\_cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography).

## Related articles

* [Directory privacy](/docs/directory-privacy)

* [IP Blocker](/docs/ip-blocker)

* [Hotlink Protection](/docs/hotlink-protection)

* [Leech Protection](/docs/leech-protection)

* [Accessing cPanel](/docs/accessing-cpanel)
