Score:1

Why use ASCII armor for file encryption?

nz flag

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.

dave_thompson_085 avatar
cn flag
`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.
Score:3
in flag

"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.

dave_thompson_085 avatar
cn flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.