← Back to context

Comment by philsnow

1 month ago

It's so insane to have PDF programs doing their own encryption, not because "don't roll your own crypto" (although yes for that reason too), but because the people who write PDF programs (libraries, viewers, general-purpose tools like qpdf, etc etc) aren't (necessarily) going to be great at understanding or designing good encryption UX.

Also, I get that a lot of sensitive information is exchanged with PDFs these days, but why should PDFs have encryption built-in to the file format? Sensitive information is also exchanged in image files, word documents, zip files, html, etc etc etc etc. If you take all the work that goes into making the crypto UX decent for one kind of file and apply that to "all files", then each ecosystem doesn't have to invent their own.

This is just like "high-end" car manufacturers insisting on making their own software, and not integrating apple carplay. They're either going to make a truly shitty podcast app, or they're not even going to bother and instead tell people to use bluetooth to listen to podcasts like it's 2006.

> but why should PDFs have encryption built-in to the file format?

Because very few 'end user' people know how to use en/decryption. So it's much easier to send them a familiar file and say 'enter this password' than to have them searching the web to work out which arguments to pass to openssl. In a command line? What's that?

I received an AES-encrypted file recently but neither gnupg nor openssl could determine what mode and keysettings the sender had used, so it was just a useless lump of data. Very secure though...

  • This should simply be an option in the context menu of the file manager. (And is on my Linux machine)

  • > Because very few 'end user' people know how to use en/decryption

    That's the point, rather than PDF viewers implementing this, it should be an OS-wide UX, so that you could click any encrypted file and have a unified password prompt, regardless of whether it's a PDF, PNG, DOCX, etc.

    And the same goes the other way, rather than having your PDF viewer implement the encryption UX, you should just have an "Encrypt with password" entry in your file manager's context menu.

Usually the desire is for some of the metadata processing to be reusable between the encrypted and non encrypted formats ("like a regular file, just this data is encrypted"). This is also why eg. Zip files are encrypted per entry, not globally.

Since the kind of data people want available may differ for each file format, here we are.

> but why should PDFs have encryption built-in to the file format?

So you could open encrypted documents on iOS and Android.