如何使用用户名和密码保护PDF? [英] How to protect a PDF with a username and password?

查看:182
本文介绍了如何使用用户名和密码保护PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这有点复杂并且可能是不可能的,但是了解是否有任何方法可以这样做...

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

假设我有一个私人教学论坛,每个用户(付费帐户)都有一个用户名和一个加密密码,还有一个DOWNLOAD部分,其中pdf文件只能由用户下载.

Let's say I have a private teaching forum, where each user (paid account) has a username and an encrypted password, and there's a DOWNLOAD section where pdf files can be downloaded by users only.

这是问题: 下载文件后,该文件将仅受与用户本人的用户名和密码匹配的用户名和密码/密码保护...换句话说,该密码是从用户帐户中获取的,并添加到pdf文件中,然后会为该文件生成一个下载链接.

Here's the question: When the file is downloaded, it will be protected by username and password/ password only that match with the username and password of the user himself... in other words, the password is taken from the user's account and added to the pdf file, then a download link is generated for that file.

通过这种方式,将pdf文件复制到其他人将迫使复印机"提供他的用户名和密码...

This way, copying the pdf file to others would force the "copier" to give out his username and password...

编辑:密码用于打开文件而不是编辑或打印文件,我希望用户能够突出显示文本并添加自己的注释

EDIT: the password is for OPENING the file not editing or printing it, I want users to be able to highlight the text and add their own notes

推荐答案

使用PDF无法实现所需的功能.

You can't achieve what you want with PDF.

有两种方法来加密PDF文档:

There are two ways to encrypt a PDF document:

  1. 使用密码.您可以定义两个密码:一个用户密码和一个所有者密码.每个收到文档的人都可以打开用所有者密码加密的文档.所有者密码用于定义权限(例如:可以查看文档,但不能打印文档).在不知道所有者密码的情况下删除限制相当容易.当Adobe仍拥有PDF参考文献上的版权时,它曾经是非法的,但是由于PDF现在是ISO标准,因此尚不清楚是否允许应用该规范删除所有者密码.如果使用用户密码对文档进行加密,则知道用户密码的所有人都可以打开该文件.没有用户名,仅 用户密码.
  2. 使用证书.您可以要求您的用户创建一个公钥/私钥对.然后,您可以要求他们将私钥保持私密,并要求他们将您的公钥提供给您.当使用他们的公共证书加密PDF时,您可以使用他们的公共密钥加密文档.从那时起,只有相应私钥的所有者才能阅读文档.但是:相应私钥的所有者也可以解密文档,以便可以共享它.
  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.

这两种情况都不符合您的目的(有关详细信息,请阅读ISO-32000-1).唯一的选择是购买昂贵的DRM解决方案.

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.

这篇关于如何使用用户名和密码保护PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆