ASCII-armored GnuPG data usually has a Version header:

Version: GnuPG v2.0.22 (GNU/Linux)


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?


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.

| improve this answer | |

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.