apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.49k stars 1.5k forks source link

Couldn't Decrypt an Adobe Digital Editions EPUB #2253

Open LinuxDragon57 opened 1 year ago

LinuxDragon57 commented 1 year ago

CheckList


Couldn't Decrypt an Adobe Digital Editions EPUB

My Environment

Calibre: 6.23

Kindle: N/A

DeDRM: 7.2.1

Log

After importing an Adobe Digital Editions EPUB into my Calibre Library, I was still unable to decrypt it. So I ran Calibre in Debug mode, and it seems that the plugin does not recognize the book as DRM protected. ```log PS C:\Users\linux> calibre-debug -g calibre 6.23 embedded-python: True Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19045') Python 3.10.1 Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1) QPA platform: windows devicePixelRatio: 1.5 logicalDpi: 96.0 x 96.0 physicalDpi: 105.21682847896439 x 105.10344827586206 ApplicationPaletteChange event ignored Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.17] splash screen shown [0.17] Initializing db... [0.17] db initialized [0.17] Constructing main UI... DEBUG: 0.0 obok::utilities.py - loading translations DEBUG: 0.0 obok::dialogs.py - loading translations DEBUG: 0.0 obok::config.py - loading translations DEBUG: 0.0 obok::action_err.py - loading translations [0.67] main UI initialized... [0.67] Hiding splash screen Starting QuickView [0.81] splash screen hidden [0.83] Started up in 0.83 seconds with 0 books stdout+stderr from file dialog helper: [b'', b''] stdout+stderr from file dialog helper: [b'', b''] piped data from file dialog helper: [b'\x0c\xac\x10\xc4\xd0\xfe\xf6\xbd\xdbd\xc1\xbd\xe87Z\x8f%k\xd5\x85`]R\xe39\\\x99\x16\xebM\x1b\x07', b'C:\\Users\\linux\\Documents\\My Digital Editions\\ITIL Foundation ITIL 4 Edition.epub'] DeDRM v7.2.1: Trying to decrypt ITIL Foundation ITIL 4 Edition.epub DeDRM v7.2.1: Verifying zip archive integrity DeDRM v7.2.1: “ITIL Foundation ITIL 4 Edition.epub” is neither an Adobe Adept nor a Barnes & Noble encrypted ePub Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "calibre\customize\ui.py", line 187, in _run_filetype_plugins File "calibre_plugins.dedrm.__init__", line 644, in run File "calibre_plugins.dedrm.__init__", line 420, in ePubDecrypt calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Couldn't decrypt after 0.1 seconds. DRM free perhaps? Added ITIL Foundation: ITIL 4 Edition to db in: 0.1 Added 1 books in 0.6 seconds ```
ElleKayEm commented 1 year ago

It doesn't recognize it as Adobe DRM. How did you download it?

Also, you need DeDRM 10.0.3 with calibre 6: https://github.com/noDRM/DeDRM_tools/releases/tag/v10.0.3

LinuxDragon57 commented 1 year ago

I obtained an ascm file from the textbook's website and then imported that into the Adobe Digital Editions Application on Windows. Adobe Digital Editions downloaded it as an EPUB. This is the same process I have done for two other textbooks of mine. I removed Adobe's DRM from those no problem. I will try DeDRM version 10.0.3 though.

ElleKayEm commented 1 year ago

“ITIL Foundation ITIL 4 Edition.epub” is neither an Adobe Adept nor a Barnes & Noble encrypted ePub

This suggests that part of the DRM is not located where DeDRM expects to find it within the epub. B&N has some books like this which give this error. The missing bit in that case is in a seperate database, not in the epub itself. Don't know but possibly something similar here.

LinuxDragon57 commented 1 year ago

So I had moved the EPUB to a flash drive since I spend 99% of my time in Linux (and I have never really fooled around with Wine except for Proton on Steam and Lutris). I tried with DeDRM 10.0.3, with Calibre on Linux and still didn't achieve any results. I hoped I would though since the changelog lists support for hardened Adobe DRM: https://github.com/noDRM/DeDRM_tools/pull/48. I am going to retry on the Windows host though.

ElleKayEm commented 1 year ago

Yes it does work with the hardened Adobe DRM, but this looks like it might be something else. Did you download with ADE? If so, is it authorized with an Adobe ID? Try with Windows calibre/DeDRM where ADE is installed. You can then import the key into your Linux setup. As long as the key is associated with the same Adobe ID you use to download books, it will be good.

LinuxDragon57 commented 1 year ago

It worked on the host with Windows installed once I updated the plugin to 10.0.3. I didn't know the repository had moved either. I imagine a lot of others might run into the issue. I follow the link at the top of Apprentice Alf's blog to the DeDRM tools. Also, where can I find the ADE key within the Windows filesystem to import it to Calibre in Linux?

LinuxDragon57 commented 1 year ago

Here was the new output by the way:

PowerShell 7.3.6
PS C:\Users\linux> calibre-debug -g
calibre 6.23  embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.10.1
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 3) && Obok DeDRM (10, 0, 3)
QPA platform: windows
devicePixelRatio: 1.5
logicalDpi: 96.0 x 96.0
physicalDpi: 105.21682847896439 x 105.10344827586206
ApplicationPaletteChange event ignored
Using calibre Qt style: True
[0.00] Starting up...
[0.00] Showing splash screen...
[0.17] splash screen shown
[0.17] Initializing db...
[0.17] db initialized
[0.17] Constructing main UI...
DEBUG:    0.0 obok::utilities.py - loading translations
DEBUG:    0.0 obok::dialogs.py - loading translations
DEBUG:    0.0 obok::config.py - loading translations
DEBUG:    0.0 obok::action_err.py - loading translations
[0.69] main UI initialized...
[0.69] Hiding splash screen
Starting QuickView
[0.84] splash screen hidden
[0.84] Started up in 0.84 seconds with 0 books
stdout+stderr from file dialog helper: [b'', b'']
piped data from file dialog helper: [b'Q\xc60U\n\xd5\xa1\x89#zC\xdf\x80:U:}\xaa\x03\x93\xab\xc6\x91\x0c\xcf\x04g\x9b\x18\xe9\x8b1', b'C:\\Users\\linux\\Documents\\My Digital Editions\\ITIL Foundation ITIL 4 Edition.epub']
DeDRM v10.0.3: Trying to decrypt ITIL Foundation ITIL 4 Edition.epub
DeDRM v10.0.3: Verifying zip archive integrity
DeDRM v10.0.3: ITIL Foundation ITIL 4 Edition.epub is a secure Adobe Adept ePub for UUID 2c98d561-8563-4eae-8b09-1957a8ec4ab0
DeDRM v10.0.3: Looking for new default Adobe Digital Editions Keys after 0.3 seconds
Found 1 keys
DeDRM v10.0.3: Trying a new default key
x7co9mim.epub is a secure Adobe Adept ePub with hardening.
DeDRM v10.0.3: Saving a new default key
DeDRM v10.0.3: Saved a new default key after 0.8 seconds
DeDRM v10.0.3: Decrypted with new default key after 0.8 seconds
DeDRM v10.0.3: Post-processing took 0.0 seconds
DeDRM v10.0.3: Finished after 0.9 seconds
Added ITIL Foundation: ITIL 4 Edition to db in: 0.2
Added 1 books in 1.4 seconds
Worker Launch took: 0.02 seconds
Worker Launch took: 0.02 seconds
PS C:\Users\linux>
ElleKayEm commented 1 year ago

Save it from DeDRM's customization.