英文:
Why the PDF encrypted by only Owner Password can be decrypted easily?
问题
我有一个只设置了所有者密码(包含字母数字和符号的16个字符)的PDF。我能够打开PDF,但某些功能,如编辑和打印,受到限制。(如下所示)
我们可以通过输入正确的所有者密码进行“更改设置”。
但是,似乎一些软件可以轻松解密此PDF。例如,使用Coherent PDF JavaScript API 如下所示,即使密码不正确,也可以解密PDF:
cpdf.decryptPdf(pdf, '');
此外,诸如 https://smallpdf.com/unlock-pdf 之类的在线工具也可以在不知道密码的情况下解锁所有者密码。然而,似乎对于用户密码无法做到这一点。为什么会这样?删除密码的机制是什么?
英文:
I have a PDF that has only an Owner password (16 characters containing alphanumeric and symbols) set. I am able to open the PDF, but certain functions such as editing and printing are restricted.(like below)
We can do Change Settings
by entering correct Owner password.
However, it seems that this PDF can be easily decrypted by some software. For example, using the Coherent PDF JavaScript API as shown below, the PDF can be decrypted even if the password is incorrect:
cpdf.decryptPdf(pdf, '');
In addition, online tools such as https://smallpdf.com/unlock-pdf can also unlock the Owner password without knowing the password. However, it seems that this cannot be done for the User password. Why is this so? What is the mechanism behind removing the password?
答案1
得分: 0
如果您使用空密码运行cpdf.decryptPdfOwner
,您将看到它失败。相反,如果您使用所有者密码运行cpdf.decryptPdf
,它也会失败。
使用用户密码和所有者密码解密PDF的算法不同,但它们都提供了允许PDF程序解密文件中的所有对象的信息。
一个非常常见的模式是PDF具有空的用户密码和非空的所有者密码。因此,它可以在没有密码的情况下打开。然而,打印等功能的限制完全由PDF阅读器或处理程序执行。如果具有空密码,没有什么可以阻止Adobe Reader打印标记为“禁止打印”的文件 - 这只是一种策略。
英文:
If you run cpdf.decryptPdfOwner
with the blank password, you will see that it fails. Conversely, if you run cpdf.decryptPdf
with the owner password, it will fail.
The algorithms for decrypting a PDF with the user and owner password are different, but they both yield information allowing a PDF program to decrypt all the objects in a file.
A very common pattern is for a PDF to have a blank user password and a non-blank owner password. Thus, it opens without a password. However, the restrictions on printing etc. are entirely enforced by the PDF reader or processing program. There is nothing stopping Adobe Reader from printing a file marked as "no printing" if it has a blank password - it's just policy.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论