跳到正文

加密 PDF

用密码加密 PDF,并设定读者可以做什么。

在你的设备上处理

这款工具完全在你的浏览器中运行。文件从不上传,你可以在浏览器的网络标签中亲自验证这一点。 亲自验证:打开浏览器的网络标签观察。你会看到一个查询你是否还有剩余任务的小请求,只包含工具名称和一段哈希,绝不会包含文件。

这款工具的作用

Two different things are called protection, and a PDF offers both. A user password encrypts the file: without it the document cannot be opened by anyone, and that is real cryptography rather than a preference. The permission flags are not encryption at all - they record a request, such as do not print, that a well-behaved reader honours and any other reader may ignore.

Use the password before a document travels somewhere you do not control: a payslip going to a personal address, a contract sent to a counterparty, tax papers going to an adviser. Reach for the permission flags in the softer case, where a request is all you need and all you will get.

工作原理

  1. Drop the PDF onto this page. A document that is already encrypted is refused rather than encrypted twice, because a doubly encrypted file is one no reader can open.
  2. Type the password people will need in order to open it. This is the field that actually encrypts; everything below it is weaker.
  3. Set a separate permissions password if opening the file and controlling it should be different privileges. Leave it empty and the open password is used for both.
  4. Choose the encryption strength, then set the toggles for printing, copying, editing, annotating and form filling.
  5. Press Protect PDF. The password is the only way back in, so keep it somewhere you will still have it next year.

The encryption is done by qpdf compiled to WebAssembly, running in a worker inside your browser. The password you type is used there to derive the file's key and is never transmitted - open the network tab, protect a document, and the one request you will find asks whether you have tasks left, carrying a tool name and a hash.

The two passwords do different jobs. The open password decrypts the file; the permissions password is what lets somebody lift the restrictions afterwards. qpdf needs a permissions password to set any restriction at all, so when only one box is filled in that password is used for both - one password that opens and fully controls the file.

Take the permission flags for what they are. Acrobat and most commercial readers honour them; plenty of free readers do not, and stripping them takes one pass through Unlock PDF and no password whatsoever. If a document genuinely must not be printed, the answer is not to send it.

AES 256-bit is the default because it is the strongest thing the format offers and every reader since roughly Acrobat 9 understands it. The 128-bit settings are compatibility choices for older software and are meaningfully weaker, RC4 especially. Whichever you pick, the length of your password matters more than the cipher, because the password is what gets guessed.

这款工具做不到的事

  • The permission flags are advisory. The encryption is real, but do not print and do not copy are requests, and any reader is free to ignore them.
  • A lost open password cannot be recovered, here or anywhere else. Nothing in the file remembers it.
  • An already-encrypted PDF is refused rather than encrypted a second time. Remove the existing protection with Unlock PDF first.
  • The 128-bit options exist for readers too old to understand AES and are not a serious defence. AES 256-bit is the only setting worth relying on.

常见问题

打开密码和权限密码有什么区别?
打开密码会加密文档:没有它什么都读不了。权限密码不加密任何东西——它决定谁以后能解除这些限制。只填打开密码,它就同时用于两者;当能读文件的人不该是能解除限制的人时,就把两个都填上。
就算我关掉了打印或复制,别人还能做吗?
只要他们想,就能。这些限制是文件里的标志,是否遵守只是一种约定。Acrobat 和多数付费阅读器会遵守;有好几款免费阅读器不遵守,而任何能去掉所有者密码的工具都能在一秒内剥掉它们。
我该选哪种加密强度?
选 AES 256 位,除非你确知某个特定的旧阅读器必须打开这个文件。大约从 Acrobat 9 起都能处理它。128 位的选项是给更旧的软件用的,而 RC4 有已知的弱点。无论哪种,一个短密码都会让它们全部形同虚设。
我忘了密码,你们能找回吗?
不能,而且这是有意为之。这个格式里没有后门,CekPDF 也不猜密码——在一个隐私工具里内置破解器会改变这个网站的用途。如果文档不用密码就能打开、只是拒绝打印,那用「解除 PDF 保护」就能解决。
我的密码会被发到什么地方吗?
不会。加密在你浏览器的 Web Worker 里运行,密码在那里被使用,并随任务一起丢弃。按下按钮前打开网络面板就能确认。页面加载过一次后,工具在断网状态下也能用。
屏幕阅读器权限是做什么的?
它决定辅助软件是否可以取出文字以便朗读,所以关掉它会让依赖屏幕阅读器的人无法使用这份文档。它默认保持开启。在 AES 256 位下这个标志根本不会被携带,所以该设置只在 128 位强度下才起作用。

相关工具