Space-padded lines in crypt-text

David Shaw dshaw at
Wed Mar 20 19:24:01 CET 2002

On Wed, Mar 20, 2002 at 12:47:43PM -0500, Dave Hill wrote:
> Hi all.  I've run into a problem running GnuPG on text copied out of an
> email in Eudora or Netscape.  With the right combination of circumstances,
> the GPG text ends up padded with a space at the end of each line (ie
> space-cr-lf or space-lf on every line).  The spaces in the crypt-text block
> itself don't cause GPG a problem, but the space at the end of the -----BEGIN
> PGP MESSAGE----- line causes GnuPG not to recognize the block as valid
> crypt-text.  I was wondering:
> 1)  Why does the space in the BEGIN line cause a problem, but not the spaces
> in the crypt-text block?

This is according to the spec.  Since you refer to coping the text out
of an email, I'll assume the text is either clearsigned text or an
ASCII armored message.  In clearsigned text, extra spaces at the end
of lines are ignored.  In ASCII armored text, spaces in general are

The reason a space in the BEGIN line causes a problem is also by the
spec - all of the armor BEGIN or END lines must be complete on their
own line and contain nothing else

> 2)  If it makes sense, could someone in the group implement a fix that
> wouldn't break other stuff in the process?

Why does text copied out of an email grow extra spaces?


   David Shaw  |  dshaw at  |  WWW
   "There are two major products that come out of Berkeley: LSD and UNIX.
      We don't believe this to be a coincidence." - Jeremy S. Anderson

More information about the Gnupg-devel mailing list