PDF只使用所有者密码加密时为什么可以轻松解密?

huangapple go评论76阅读模式
英文:

Why the PDF encrypted by only Owner Password can be decrypted easily?

问题

我有一个只设置了所有者密码(包含字母数字和符号的16个字符)的PDF。我能够打开PDF,但某些功能,如编辑和打印,受到限制。(如下所示)
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)
PDF只使用所有者密码加密时为什么可以轻松解密?
PDF只使用所有者密码加密时为什么可以轻松解密?

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.

huangapple
  • 本文由 发表于 2023年3月12日 14:04:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/75711337.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定