Encrypting messages truncates trailing whitespace

Atom 'Smasher' atom-gpg at suspicious.org
Wed Jan 21 03:31:01 CET 2004

try this on a *nix command line.....

$ echo 'test    ' | gpg -ear <your-key-ID> | gpg | tr ' ' 'x'

it'll prompt you for your password to decrypt the encrypted message, and
then after decrypting, it will convert spaces into "x"s.

i'm using gpg 1.2.4 and encryption/decryption on my system *does* preserve
trailing spaces. if you get the same results, then gpg isn't the culprit.

i'm not sure, but i think one of the SMTP RFCs specifies that trailing
spaces can (should? must?) be disposed of, so your MUA might be doing

the parts of the OpenPGP RFC (2440) that mention trailing spaces don't
seem to apply here. on my reading of it, it seems that trailing spaces are
ignored by signature applications, but it doesn't say anything about
disposing of those trailing spaces. indeed, they seem to be preserved even
when signing (at least on my machine).

On Wed, 21 Jan 2004, debianuser wrote:

> I'm not sure whether or not this is a problem with my MUA (Mutt) or with
> GnuPG (I'm using 1.2.4 from Debian Sid), but I figured I'd start by
> explaining the situation here first, and will gladly request assistance
> on another list as appropriate.
> I have found that messages encrypted (but not signed) to my key are
> losing the space character found in my signature delimiter, making it
> "--" instead of "-- ".  I know the problem is not with the mail system
> through which the messages are travelling, because by signing and
> encrypting a message, the space is left intact.  I am more than happy to
> send private messages demonstrating the problem to anybody interested;
> just give the word.
> Thanks in advance for any assistance you can render!


 PGP key - http://smasher.suspicious.org/pgp.txt
 3EBE 2810 30AE 601D 54B2 4A90 9C28 0BBF 3D7D 41E3

 	"Don't suspect your friends - turn them in!"
                -- Brazil

More information about the Gnupg-users mailing list