3

ASCII-armored GnuPG data usually has a Version header:

-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.22 (GNU/Linux)

hQIMAxfkjOs8YMF+AQ//e9yWfwKBddUX/1YfghKfF/xJhuirYmAdxhsLaO5Fj0QJ
yYZUQ6mtBH6L9J0hxfvsfLvH0+28jw//HTd4iAvczW99Qo0jH/BYfZLeMeh3B42J
Ws7iS5WUdhgXrT/EkBO2OkEPjuRbolU7p8XnX6tD/bazeI5FViwyfLb1EBffKYXG
...
-----END PGP MESSAGE-----

If you remove the version line, the data still decrypts just fine, but starts off with this error message:

gpg: invalid armor header: hQIMAxfkjOs8YMF+AQ/8CZO9fuB8CImJN7Kl7O0n18Uvk+B9wgCBiS0E2ZIr4sjJ\n

Why is the Version string included? Is this extra line of information beneficial to anyone, or even required anywhere?

3

The Version header is purely informative; my guess is that it's included to make compatibility bugs easier to discover (e.g. if a client is unable to decrypt 10 messages, and all 10 were made by the same version).

The error message you're seeing, however, is not caused by lack of Version, but by the lack of empty line separating headers and body. According to the syntax for OpenPGP armored messages, even if you have zero headers, you still need the separator so that parsers would know that hQIMAxfkjOs8... is in fact the body and not just a weird header.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.