[[!meta title="OpenPGP public-key cryptography"]]

With <span class="application">OpenPGP Applet</span> you can
**encrypt or sign text using the public key encryption of OpenPGP**.

[[!inline pages="doc/encryption_and_privacy/gpgapplet.warning" raw="yes"]]

<div class="note">

<strong>This technique requires you to use public-key
cryptography.</strong> If you never used OpenPGP keys before, you might
rather want to encrypt your text using a passphrase with OpenPGP
passphrase encryption. [[See the corresponding
documentation.|gpgapplet/passphrase_encryption]]

</div>

1. Write your text in a text editor. **Do not write it in the web browser!**

   Click on <span class="application">OpenPGP Applet</span> and
   choose <span class="guimenuitem">Open Text Editor</span> to open
   <span class="application">gedit</span>.

2. Select with the mouse the text that you want to encrypt or sign. To
copy it into the [[!wikipedia Clipboard_(computing) desc="clipboard"]],
right-click on the selected text and choose <span
class="guimenuitem">Copy</span> from the menu.

   <span class="application">OpenPGP Applet</span> now shows
   lines of text, meaning that the clipboard contains non-encrypted
   text:
   [[!img gpgapplet_with_text.png link="no" class="symbolic-22" alt=""]]

3. Click on <span class="application">OpenPGP Applet</span> and
   select <span class="guimenuitem">Sign/Encrypt Clipboard with Public
   Keys</span> from the menu.

   If you receive the error message “<span class="guilabel">The clipboard does
   not contain valid input data</span>”, try to copy your text again, starting
   from step 2.

4. If you want to encrypt the text, select one or more public keys for the
recipients of the encrypted text in the <span class="guilabel">Choose
keys</span> dialog box. To select a public key, double-click on the
corresponding line in the <span class="guilabel">Select recipients</span> list
box.

5. If you want to sign the text, select the secret key with which you want to
sign the text in the <span class="guilabel">Sign message as</span> drop-down
list.

6. If you want to hide the recipients of the encrypted text, select the <span
class="guilabel">Hide recipients</span> check box. Otherwise anyone who sees the
encrypted text can know who the recipients are.

7. Click on the <span class="guilabel">OK</span> button.

   If you receive the warning message <span class="guilabel">Do you trust these
   keys</span>, answer it accordingly.

8. If you selected one or several public keys to encrypt the text,
<span class="application">OpenPGP Applet</span> now shows a
padlock, meaning that the clipboard contains encrypted text:
[[!img gpgapplet_with_padlock.png link="no" class="symbolic-22" alt=""]]

   If you only selected a secret key to sign the text, <span
   class="application">OpenPGP Applet</span> now shows a seal, meaning that the
   clipboard contains signed text:
   [[!img gpgapplet_with_seal.png link="no" class="symbolic-22" alt=""]]

9. To paste the encrypted or signed text into another application,
   right-click in the application where you want to paste it and
   choose <span class="guimenuitem">Paste</span> from the menu.

   For example, you can paste it into the web browser to send it by email.

   [[!img browser_paste.png link="no" alt="Encrypted text starting with
   -----BEGIN PGP MESSAGE-----"]]
<div class="tip">

To store your GnuPG keys and configuration across separate working sessions,
you can activate the [[<span class="guilabel">GnuPG</span> persistence
feature|doc/first_steps/persistence/configure/#gnupg]].

</div>

<div class="next">

You can also [[decrypt or verify a text that is encrypted or signed using
public-key cryptography|decrypt_verify]] using <span class="application">
OpenPGP Applet</span>.

</div>
