gpt4 book ai didi

epub - 如何检查 ePub 文件是否受 DRM 保护?

转载 作者:行者123 更新时间:2023-12-04 15:01:10 25 4
gpt4 key购买 nike

是否有任何编程方法可以安全地检查 epub 文件是否受 DRM 保护(加密)?

我发现 META-INF 目录中可能有一个 rights.xml 和一个 encryption.xml。
这些文件中的任何一个或两个的存在是否意味着内容已加密,如果没有,还有其他方法可以检查吗?
(明确地说,我根本不想阅读带有 DRM 的 ePub,我只想检查它们是否加密。)

最佳答案

FWIW 维基百科 epub 文章指出

When present, DRMed EPUB files must contain a file called rights.xml within the META-INF directory at the root level of the ZIP container.



从 v1.0 开始,epubcheck 被报告通过encryption.xml 的存在检测DRM 保护并报告错误。 epub3 spec

An optional encryption.xml file within the META-INF directory at the root level of the container file system holds all encryption information on the contents of the container. This file is an XML document whose root element is encryption. The encryption element contains child elements of type EncryptedKey and EncryptedData as defined by [XML ENC Core]. Each EncryptedData element describes how one or more files within the container are encrypted. Consequently, if any resource within the container is encrypted, encryption.xml must be present to indicate that the resource is encrypted and provide information on how it is encrypted.



EPUB3 在 rights.xml、它的含义以及它是否是 DRM 文件的强制性内容上含糊不清,因此最好不要依赖它。

关于epub - 如何检查 ePub 文件是否受 DRM 保护?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14442968/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com