Skip to content

Symmetric Encryption & Decryption

Symmetric encryption locks data with a password. The same password unlocks it again. You do not need a key pair.

Normal OpenPGP encryption is different. It uses a public key to encrypt and a private key to decrypt. That is called asymmetric encryption. See Text Operations.

Symmetric encryption is:

  • Fast.
  • Good for large files, or for sharing something once.
  • Only safe when both people can share the password safely.
  1. You choose a strong password.
  2. GpgFrontend uses that password to encrypt the data.
  3. Anyone with the same password can decrypt it.

GpgFrontend can do this since v2.1.9. The action is called Sym. Encrypt.

The easiest way: open the Operations menu and choose Sym. Encrypt, or press Ctrl+Alt+E (Cmd+Option+E on macOS). You can only use it while no key is ticked in the Key ToolBox.

You can also put it on the toolbar:

  1. Open Settings and choose Appearance.
  2. Under Toolbar, in the Actions list, tick Sym. Encrypt.

Sym. Encrypt does not get a button of its own. It joins the Encrypt button. To use it, right-click the Encrypt button (or press and hold it), then choose Sym. Encrypt from the list. If no key is ticked, a plain click on Encrypt also opens this list. For more about such buttons, see Buttons With More Than One Action.

  • For text: type or paste the text into a Text Editor tab.
  • For a file: select the file in the File Panel.
  1. Make sure no key is ticked in the Key ToolBox.
  2. Choose Sym. Encrypt from the Operations menu, or from the Encrypt button’s list.
  3. When asked, type a strong password that you use nowhere else.
  4. GpgFrontend encrypts the text or file with that password.
  5. Save the result, or send it to the other person.

To decrypt text that was encrypted with a password:

  1. Paste the encrypted message into a Text Editor tab. It starts with -----BEGIN PGP MESSAGE----- and ends with -----END PGP MESSAGE-----.
  2. Click Decrypt.
  3. When asked, type the same password that was used to encrypt.
  4. If the password is right, the readable text appears in the tab.

To decrypt a file, select it in the File Panel and click Decrypt. See Decrypt a File.

This part is for readers who want the technical details. You do not need it to use Sym. Encrypt.

How a password becomes a key

Symmetric encryption makes an OpenPGP message that is protected by a passphrase (another word for password) instead of a public key. The passphrase goes through an OpenPGP String-to-Key (S2K) function, which turns it into the real encryption key. The data is then encrypted with a symmetric cipher.

How this is done depends on the engine in use. It also decides which tools can decrypt the result.

Aspect GnuPG engine rPGP engine
Implementation gpgme_op_encrypt_symmetric (GnuPG decides the details) rPGP, fixed cipher, adjustable Argon2 memory
Symmetric cipher GnuPG default, typically AES-256 (configurable) AES-256
Data packet GnuPG default (SEIPD; may use AEAD on newer GnuPG) SEIPD v2 (AES-256 with OCB)
Key derivation Iterated-and-salted S2K by default (configurable) Argon2id S2K (memory-hard), 2 GiB or 64 MiB
Interoperability Broad; readable by most OpenPGP tools Requires an RFC 9580 tool; GnuPG cannot read it

With the GnuPG engine, GpgFrontend asks GnuPG to do the symmetric encryption. So the cipher, the S2K function, and the packet format follow your GnuPG version and settings (for example, s2k-cipher-algo, s2k-digest-algo, and s2k-count in gpg.conf). Current GnuPG defaults to AES-256 with an iterated-and-salted S2K. Most other OpenPGP tools can read that. Newer GnuPG versions may use AEAD (OCB) when set up to do so.

With the rPGP engine, the message is an SEIPD v2 packet encrypted with AES-256 in OCB mode. SEIPD v2 is the newer message format from the current OpenPGP standard, and it checks the data for changes as it reads it. The passphrase is turned into the symmetric key with an Argon2id S2K. Argon2 needs a lot of memory on purpose. This makes guessing a weak passphrase much more costly than with the classic iterated-and-salted S2K.

Argon2 needs memory to turn your password into a key. The same amount is needed again to decrypt, on every computer that opens the message. You can choose the amount:

  1. Open Settings and choose rPGP (under Keys & Engines).
  2. Find the Passphrase Encryption box.
  3. In Argon2 Parameters:, pick one option:
    • High memory, 2 GiB: the default and the strongest choice.
    • Low memory, 64 MiB: pick this if your computer, or the computer of the person who will open the message, cannot spare 2 GiB of memory.

The choice applies only to messages you encrypt from now on.

When you encrypt symmetrically with rPGP, GpgFrontend always asks for the passphrase again. It does not use a remembered one. It also asks you to type the passphrase a second time, so you do not encrypt with a mistyped one.

Symmetric encryption is a good choice when:

  • You encrypt something for yourself, such as private notes or backup files.
  • You can give the password to the other person safely, for example in person.
  • You do not want to make and manage key pairs.

It is not a good choice when you cannot share the password safely. Then use normal encryption with keys instead.

  • Always use a strong password. Longer is better.
  • Never send a password over an unsafe channel, such as an email that is not encrypted.
  • You can combine both kinds of encryption. For example, encrypt a file with a password, then encrypt the password with the other person’s public key.