---
name: "pgp-decrypt"
section: "1"
platform: "linux"
package: "auto-pgp"
version: "1.04-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/pgp-decrypt"
---

# pgp-decrypt(1)

decrypt and/or check signature or a PGP message

## NAME

pgp-decrypt - decrypt and/or check signature or a PGP message

## SYNOPSYS

**pgp-decrypt** \[**debug**\] \<*input-file* \>*output-file*

## DESCRIPTION

**pgp-decrypt** is a filter which interprets an armoured PGP message and does something appropriate with it (by invoking **pgp**) as follows:

If the message is encrypted the plaintext is sent to standard output preceded by a list of the recipients (or their key IDs if their keys are not available to be looked up).

If the message is both signed and encrypted a clearsig version is sent to standard output, again preceded by the list of recipients.

If the message is a signed or clearsig message the signature is checked.

Informative progress messages from **pgp** which are not particularly important are preceded by a space on each line. Messages whose meaning was not understood by the scripts are preceded by **???** - this often indicates some kind of failure.

Informational and progress messages are always written to standard error. Any message text is always written to standard output, preceded by the message

**Enclosed message text** **(***n* **bytes):**

This will be the last message written to standard error. This scheme is designed to make it easer for Emacs to parse the output of **pgp-decrypt**.

If the message is not of one of the structures above an error is signaled.

Errors are introduced by the string

**Error:**

If a clearsig message contained trailing spaces and the signature did not match the file contents (using the default action of PGP in this situation, which is to ignore trailing whitespace), **pgp-decrypt** will try checking the signature again but this time taking account of trailing whitespace.

**pgp-decrypt** calls **pgp** and **pgp-auto** to do the various processing steps.

## BUGS

PGP versions 2.0 and 2.1 always counted trailing spaces in all messages; 2.2 ignores them when generating or checking a clearsig message. This behaviour makes it impossible to produce a clearsig file which will be accepted by version 2.2 from an encrypted, fully-armoured or detached signature file which has any trailing spaces in the text.

**pgp-decrypt** resolves this problem by checking for trailing spaces when checking signatures. If there were any it runs PGP again after doing part of the dearmouring itself, so that trailing spaces are counted. Hopefully PGP 2.3 will always ignore trailing whitespace when signing text files and will take the responsibility for compatibility for previous versions on itself.

You must not try to run two copies of **pgp-decrypt** (with the same **PGPPATH**) simultaneously, as version of PGP up to at least 2.6 do not correctly generate unique temporary file names.

## FILES

- **$PGPPATH/.wrapper/\***

  Temporary files.

## SEE ALSO

**pgp**(1), [**pgp-auto**(1)](/pgp-auto/1.md), [**pgp-pixie**(1)](/pgp-pixie/1.md), [**pgp-decrypt**(1)](/pgp-decrypt/1.md), **auto-pgp.el**

## AUTHOR

The Emacs Auto-PGP package was written by Ian Jackson. Copyright 1993-1994; for copying conditions see the GNU General Public Licence. This software is distributed as-is with no warranty.
