Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] EPUB font encoding in combination with Adobe DRM #1828

Open
3 tasks done
Leseratte10 opened this issue Aug 29, 2021 · 0 comments
Open
3 tasks done

[QUESTION] EPUB font encoding in combination with Adobe DRM #1828

Leseratte10 opened this issue Aug 29, 2021 · 0 comments

Comments

@Leseratte10
Copy link

CheckList

  • The Title and The Log Title are setted correctly.
  • Clarified about my environment.
  • Code block is used for the log.

EPUBs with font file encoding in combination with Adobe DRM

I have deleted the "my version" and "logfile" sections from the issue report as I'm reporting a hypothetical issue / code question, and not an actual issue with one of my EPUB files - I hope that that's okay.

There are EPUB files like this where particular font files are obfuscated with a XOR-like encryption using the unique book UID as the key. This obfuscation is specified here.

Apparently this feature is sometimes used so that the font files are "linked" to that particular eBook and you can't easily take the font files out of the EPUB and use them elsewhere. The fact that this obfuscation occurs is noted in the encryption.xml file, where the Adobe DRM information is also stored.

Looking at the DRM removal code in ineptepub.py, I don't see any code to handle this. The code parses the XML to find the Adobe-related entries, and then it removes the entire file from the resulting EPUB. This means that if you had an EPUB file which A) has Adobe DRM and B) has its font files obfuscated using the algorithm linked above, running them through the DRM removal scripts will break all the fonts as the necessary encryption information for these is lost.

The question would be, is this combination even possible in the wild? I don't think the EPUB standard forbids using multiple different encryption methods inside the encryption.xml file, so the question would be, are there any EPUBs that use this? There certainly are some that use this font encoding (see the example file above), I just don't know if this can even be combined with Adobe DRM.

If it can, then it might be worth it to fix that in the DRM removal script. For example by only removing the Adobe-related encryption.xml entries, keeping all others intact (only deleting the encryption.xml file if no other encryption entries were found).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant