1
$\begingroup$

GPG and age both offer a --armor option but what is the use case when it comes to file encryption? Surely most channels allow for transmitting binary data nowadays? It seems unnecessary and sounds like it satisfies a rare use case.

I can understand it for sharing key pairs, maybe signatures, but not for file encryption. Even for key pairs and signatures, it feels like there are better ways of doing things like short Base64 keys and sharing signature files like in Minisign.

Sorry if this isn't cryptography related enough. I'm asking here since these are cryptographic tools and there must be some reason why this is a feature.

$\endgroup$
1
  • $\begingroup$ openssl enc -a also does base64 only (no readable header&trailer) -- although it is NOT recommended on cryptographic grounds, covered in other Qs. It was designed in the 1990s. $\endgroup$ Jul 11 at 1:46
3
$\begingroup$

"Surely most channels allow for transmitting binary data nowadays?" Sure, but PGP is ancient. A lot of things including email and Usenet are text based. And even though FTP can of course transmit binary, you might forget to turn that option on in the text based FTP clients of that day.

Note that we still have many places that require text, such as XML, JSON. HTTP may be capable of sending binary (although many developers seem to forget that), HTTP headers and URL's are usually text.

Note that e.g. gpg is also used in shell scripts and such. It would be extremely inefficient to first create the file and then use ASCII armor to convert it into printable ASCII.

It also makes sense to have one, universally accepted armor. Otherwise the decryption / signature verification may fail, or you may have to go into negotiations which exact format to use.

And finally, if you require it for signatures etc. anyway, why not give the same option for all possible output? It's just a few lines of code, generally.

$\endgroup$
1
  • 1
    $\begingroup$ HTTP can send binary as a separate request/response, but not safely in a multipart, and not at all within HTML -- I see Stack Qs about every week where someone has cut&pasted their binary data and thus destroyed it (although most of the Qs are offtopic anyway, so no loss). JOSE (JWS, JWE, JWT) does base64 (with a slightly different alphabet) always; there's not even a choice. $\endgroup$ Jul 11 at 1:46

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.