[The Golden Key Campaign]Home
UpCommon Problems in PGP/GPG Clear-Signing


One popular use of public-key cryptosystems like PGP/GPG is to digitally sign an email message, providing
Assurance that the message really came from the keyholder
Assurance that the sender can not later disavow the text
Assurance that the text has not been altered in transit
Unfortunately, this last assurance is something of a problem area.  Email systems (both the programs used to prepare and display the email, and also those that transfer it through the network) have evolved in a world where much less stringent requirements apply, and they routinely change messages in various ways.  Some of these, of course, are bugs in the various systems.  But many of them are not bugs at all, they're designed features necessary for translating between different mail systems, or to accommodate the classic 7-bit character systems developed in the early days of Americo-centric computing.  This web page is about such problems: how you can recognize them, how you can prevent them, and (in a few cases, at any rate) how you can repair them, after the fact, to recover the original message (including a working signature).

Ideally, you'd like to avoid the problem.  But if you can't avoid it, you may have to deal with it.



Avoiding the problem.  There are a couple of ways to avoid the problem entirely:

MIME:  The best way to avoid these problems is to use a well-integrated, PGP/MIME-capable mailer/crypto suite.  The MIME standards were developed in large part to avoid problems such as these (which afflict many other areas besides cryptography, such as multimedia, non-Amerenglish languages, and sometimes even simple text passing between dissimilar email networks).  Likewise, MIME-encapsulation standards for cryptography deal with sequencing and control issues within the mailer, preventing some kinds of damage that happen before the message is actually sent, or after it's received.  Note, however, that even mailer/crypto combinations that are capable of this often also allow non-MIME signing, in order to cooperate with non-MIME mailers.  Even these MIME-savvy mailers will be exposed to all the problems discussed here, when they're not operating in MIME mode.  For best protection against these sorts of problems, PGP users should be sure to enable PGP/MIME.

Proper PGP - Mailer Integration:  Many of these problems arise because additional mailer processing happens after the PGP processing.  The worst examples are when there is no integration at all, and you have to PGP-process the message in a separate file or on the clipboard, then paste it into the message.  But even so-called integrated systems may have problems because PGP processing is invoked at the wrong time.  At least one of these problems happens, in at least one configuration, because though PGP handles the message at the right time, it can not make needed adjustments to the mail headers.  If you're having clear-signature problems, explore your mailer and PGP configuration and use models to see if there are modes that put PGP later into the process; check for an update to your mailer and/or PGP plug-in that does so.

Encryption:  As it happens, if you encrypt your message as well as signing it, you'll be protected from most of these problems (the one exception is Bogus quoted-printable substitution).  This is not directly because the message is encrypted, however; rather, it's because encrypted messages, being binary objects, need even more protection in the mails than mere text does.  Crypto programs provide this through some sort of encoding that guarantees the message makes it through all known forms of damage.  Unfortunately, this sort of protection changes the actual text of the message, rendering it unreadable to humans.  This is not a problem for encrypted text - it wasn't readable in the first place - but is quite contrary to the purpose of clear-signing a message.



Dealing with it.  If you can't eliminate the problem in one of these ways, they you may have to deal with it.  Here, as succinctly as I can manage, are descriptions of each problem I know of, including how to recognize it, how to prevent it, and in some cases how to repair it.

Be warned: you may receive a letter that has received more than one of these kinds of damage.  You may have to experiment a little, repairing different combinations of suspected damage.  It's up to you, of course, how hard you're willing to work at this; it might be more practical just to ask the sender to do all the "prevention" steps that seem relevant, and resend the text.

The forms of damage covered in this page are:

Line folding
Tab substitution
No callback
Styled-text lossage
Spell-checking
Space, blank line eating
8-bit character loss
Quoted-printable substitution
Bogus quoted-printable substitution

Know how to deal with a problem not listed here? Drop me a line: jack "at" netgate.net .


Line folding: Sometimes, the lines of a message get folded down into shorter lines after the signature was computed.
Detection:  There are at least two appearances that are strong hints:
This is a very long line, containing many many
words
and then a few more
John said:
>Stuff and stuff and stuff
and stuff.
>Then more stuff
Prevention: Sender side: Set PGP's line wrapping limit to less than your mailer's. Upgrade your mailer and PGP plugin to a combination that computes the signature after the mailer has folded the lines.
Repair: Receiver side: Edit up all the "shorties" and unquoted lines onto the lines above them.
This is a very long line, containing many many words
and then a few more
John said:
>Stuff and stuff and stuff and stuff.
>Then more stuff


















Return to index
Jack Repenning