【问题标题】:Ghostscript with AES-256 password protection for PDF 2.0 documents为 PDF 2.0 文档提供 AES-256 密码保护的 Ghostscript
【发布时间】:2018-04-21 16:24:12
【问题描述】:

可以使用ghostscript生成受密码保护的pdf文件:

gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=protect.pdf -sOwnerPassword=pwd1 -sUserPassword=pwd2 -dCompatibilityLevel=2.0 test.pdf

输出文件有最新的 pdf 版本 2.0,它支持密码保护的 unicode。但根据 pdfinfo,使用了过时的 RC4 算法:

pdfinfo protect.pdf -upw pwd2
CreationDate: Sat Apr 21 09:10:14 2018 CEST
ModDate: Sat Apr 21 09:10:14 2018 CEST
Tagged: no
UserProperties: no
Suspects: no
Form: none
JavaScript: no
Pages: 26
Encrypted: yes (print:yes copy:yes change:yes addNotes:yes algorithm:RC4)
Page size: 612 x 792 pts (letter)
Page rot: 0
File size: 288060 bytes
Optimized: no
PDF version: 2.0

根据https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/,PDF 2.0 版本能够使用 AES-256 标准加密 PDF 文件。如何使用 ghostscript 做到这一点?

【问题讨论】:

标签: ghostscript


【解决方案1】:

除了用于加密 PDF 文件的原始 RC4 算法之外,Ghostscript pdfwrite 设备不支持任何东西。 PDF 解释器可以使用后来的算法解密文档。

正如 sneep 所说,你不能用 Ghostscript 和 pdfwrite 设备来做到这一点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-14
    • 2012-09-05
    • 1970-01-01
    相关资源
    最近更新 更多