How to pgp clearsign a message

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 4, 2026

Quick Answer: To PGP clearSign a message, you use a PGP software to sign your message and then wrap it in `-----BEGIN PGP SIGNED MESSAGE-----` and `-----END PGP SIGNED MESSAGE-----` headers. This process verifies the sender's identity and ensures the message hasn't been tampered with.

Key Facts

What is PGP ClearSigning?

PGP ClearSigning is a method of signing an email or message using Pretty Good Privacy (PGP) encryption standards, such that the resulting message remains human-readable in plain text. Unlike a typical PGP signature which might be attached as a separate file or encoded within an email, a Clear-Signed message includes the original message content along with the signature, enclosed within specific delimiters. This allows recipients to read the message directly while still being able to verify its authenticity and integrity using PGP software.

Why Use PGP ClearSigning?

The primary benefits of PGP ClearSigning are twofold: authenticity and integrity. Authenticity means that the recipient can be sure of the sender's identity. The signature is cryptographically linked to the sender's private key, and only they could have created it. Integrity means that the recipient can be sure the message has not been altered in transit. Any modification to the message, however small, would invalidate the signature.

ClearSigning is particularly useful in situations where direct readability is important, such as in mailing lists, forums, or when communicating with users who may not have sophisticated PGP tools but can still verify the signature. It bridges the gap between the need for cryptographic security and the convenience of plain text communication.

How Does PGP ClearSigning Work?

The process of ClearSigning involves several steps, typically handled by PGP software like GnuPG (GPG). When you choose to ClearSign a message:

  1. Hashing: The PGP software takes the plain text content of your message and generates a cryptographic hash (a unique fingerprint) of it.
  2. Signing: This hash is then encrypted using your private PGP key. This encrypted hash is your digital signature.
  3. Formatting: The original plain text message is then wrapped with specific ASCII headers and footers. The standard headers are `-----BEGIN PGP SIGNED MESSAGE-----` and `-----END PGP SIGNED MESSAGE-----`. The signature itself is also formatted in ASCII, typically appearing after the message content and preceded by `-----BEGIN PGP SIGNATURE-----` and `-----END PGP SIGNATURE-----`.
  4. Transmission: The complete, Clear-Signed message is then sent to the recipient.

The recipient, using their PGP software and your public key, can then perform the reverse process. They will extract the message content, recalculate its hash, and then decrypt your signature using your public key to retrieve the original hash. If the recalculated hash matches the decrypted hash, the message is verified as authentic and untampered.

Steps to PGP ClearSign a Message (using GnuPG as an example):

While the exact commands can vary slightly depending on your operating system and PGP implementation, here’s a general guide using GnuPG (GPG) on a command line:

  1. Ensure you have GnuPG installed: If not, download and install it from the official GnuPG website.
  2. Create a text file with your message: Save your message content into a plain text file (e.g., `message.txt`).
  3. ClearSign the message: Open your terminal or command prompt and run the following command:
    gpg --clearsign message.txt
  4. Output: GPG will prompt you for your passphrase to unlock your private key. Once authenticated, it will output the Clear-Signed message to your console. You can redirect this output to a new file if desired:
    gpg --clearsign message.txt > signed_message.asc
  5. Sending the message: You can now copy the content of `signed_message.asc` (or the console output) and paste it into your email or communication client.

To verify a Clear-Signed message:

If you receive a Clear-Signed message, you can save it to a file (e.g., `received_message.asc`) and then use GPG to verify it:

gpg --verify received_message.asc

GPG will attempt to verify the signature and tell you if it's good and if it's trusted (based on your trust model).

Important Considerations:

In summary, PGP ClearSigning is a powerful tool for ensuring the authenticity and integrity of your plain text communications, making it a valuable practice for secure messaging.

Sources

  1. GnuPG Manual - Invoking GPG Export, Import, Sign etc.fair-use
  2. Pretty Good Privacy - WikipediaCC-BY-SA-4.0
  3. OpenPGP - The Open Standard for Email Encryptionfair-use

Missing an answer?

Suggest a question and we'll generate an answer for it.