How to protect a PDF with a username and password?

后端 未结 1 1143
甜味超标
甜味超标 2020-12-12 00:47

I think this is a bit complicated and probably impossible, but it would be helpful to know if there is any way to do it...

Let\'s say I have a private teaching forum

1条回答
  •  执念已碎
    2020-12-12 01:38

    You can't achieve what you want with PDF.

    There are two ways to encrypt a PDF document:

    1. Using passwords. You can define two passwords: a user password and an owner password. A document that is encrypted with an owner password can be opened by every one who receives the document. The owner password is there to define permissions (for instance: the document can be viewed, but not printed). Removing the restrictions without knowing the owner password is fairly easy. It used to be illegal when Adobe still owned the copyright on the PDF reference, but since PDF is now an ISO standard, it's not entirely clear if applying the spec to remove the owner password is allowed. If a document is encrypted using a user password, everybody who knows the user password can open the file. There is no username, only a user password.
    2. Using certificates. You could ask your users to create a public/private key pair. You could then ask them to keep their private key private and ask them to give you their public key. When you encrypt your PDF using their public certificate, you can then encrypt the document with their public key. From that moment on, only the owner of the corresponding private key can read the document. However: the owner of the corresponding private key can also decrypt the document so that it can be shared.

    Neither of both cases serve your purpose (read ISO-32000-1 for the full details). The only alternative is to buy an expensive DRM solution.

    0 讨论(0)
提交回复
热议问题