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

Calibre 5.6.0 epub with not working with DeDRM_plugin_7.0.0b3 in Windows 10 #1395

Closed
DanRinkevich opened this issue Dec 2, 2020 · 13 comments

Comments

@DanRinkevich
Copy link

Title
Calibre 5.6.0 epub with not working with DeDRM_plugin_7.0.0b3 in Windows 10

My Environment

Calibre: 5.6.0

Kindle: n/a

DeDRM: 7.0.0b3

ADE: '4.5.11.187303'

Log

Here is the calibre debug file:
C:\WINDOWS\system32>calibre-debug -g
calibre 5.6 [64bit] embedded-python: True is64bit: True
Windows-10-10.0.18362 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.18362')
Python 3.8.5
Windows: ('10', '10.0.18362', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (7, 0, 0)
Turning on automatic hidpi scaling
devicePixelRatio: 2.0
logicalDpi: 96.0 x 96.0
physicalDpi: 112.36866359447005 x 112.88888888888889
Using calibre Qt style: True
[0.00] Starting up...
[0.03] Showing splash screen...
[0.70] splash screen shown
[0.70] Initializing db...
[0.73] db initialized
[0.73] Constructing main UI...
[2.92] main UI initialized...
[2.92] Hiding splash screen
Starting QuickView
[3.55] splash screen hidden
[3.55] Started up in 3.55 seconds with 9 books
stdout+stderr from file dialog helper: [b'', b'']
piped data from file dialog helper: [b'\xcf\xd8\x1dt\xd0R\xd3I\x8f[\xb3\x8d[M\xd1\n\x8d9\xbf\xca\\xae^4\x8bs\xd2\x12A\xc9\x06:', b'C:\Users\n\Documents\My Digital Editions\Camino Winds.epub']
DeDRM v7.0.0: Trying to decrypt Camino Winds.epub
DeDRM v7.0.0: Verifying zip archive integrity
DeDRM v7.0.0: Camino Winds.epub is a secure Adobe Adept ePub
DeDRM v7.0.0: Trying Encryption key default_key
Could not decrypt il1mhod8.epub because of an exception:
Traceback (most recent call last):
File "calibre_plugins.dedrm.ineptepub", line 414, in decryptBook
TypeError: object of type 'int' has no len()

DeDRM v7.0.0: Failed to decrypt with key default_key after 0.7 seconds
DeDRM v7.0.0: Looking for new default Adobe Digital Editions Keys after 0.7 seconds
DeDRM v7.0.0: Exception when getting default Adobe Key after 0.7 seconds
Traceback (most recent call last):
File "calibre_plugins.dedrm.init", line 352, in ePubDecrypt
File "calibre_plugins.dedrm.adobekey", line 360, in adeptkeys
File "calibre_plugins.dedrm.adobekey", line 340, in CryptUnprotectData
calibre_plugins.dedrm.adobekey.ADEPTError: Failed to decrypt user key key (sic)
DeDRM v7.0.0: Ultimately failed to decrypt after 0.7 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
Added Camino Winds to db in: 0.2
Added 1 books in 2.4 seconds

@ElleKayEm
Copy link

I would guess this is because retrieval of Adobe keys still needs work in DeDRM 7. Was this downloaded with ADE authorized with your Adobe ID on the same machine and user as calibre with DeDRM? Another thing to check is if it can be opened with ADE 2.0.1 authorized to the same Adobe ID. If so, then you should be able to decrypt it with DeDRM 6.8.x and calibre 4.23.

@DanRinkevich
Copy link
Author

Yes, ADE was installed on the same machine and authorized, then the book was downloaded. I will install ADE 2.0.1 and try.

@DanRinkevich
Copy link
Author

DanRinkevich commented Dec 2, 2020

ADE 2.0.1 would not open it. I got an error check activation message. I tried a to download and open fresh downloaded book with ADE 2.0.1 and it failed. ADE 2.0.1 is showing that it is using the same computer authorization.

@ElleKayEm
Copy link

Well, that could be a problem with Adobe authorization or it could be hardened Adobe DRM that DeDRM can't remove. I'd give DeDRM 6.8.x installed in calibre 4.23 a try anyway.

@ableeker
Copy link
Contributor

ableeker commented Dec 2, 2020

That error is a bit odd, something seems to be not quite right with the book key. An epub is actually a zip archive. If you open it, there should be a file /META-INF/rights.xml. Is it there? And, if it does exist, it should contain a tag encryptedKey. This is the base64 encoded book key. Does this key exist, and if so, what is it?

@DanRinkevich
Copy link
Author

DanRinkevich commented Dec 2, 2020 via email

@DanRinkevich
Copy link
Author

DanRinkevich commented Dec 2, 2020

Ableeker,
I think I destroyed the evidence on the epub. It wouldn't open in ADE so I freshened it up, and deleted the old one. The new file opens in ADE 2.0.6.

The /META-INF/rights.xml tag encryptedKey tag in the new epub file is:
dZq/0OcoCBHEiRr1t27Q3y9FLfw40Z/SUU9jD66k9TMI+Svf4TUAYPEFPn16iY6VJfZVFHsVTBxXLDvMZqghYDdjwXMFJAuhw9cnaBD9u1ohgrswN7MAecCIVef7PaYwQW3i065NyrbPh13qq4UjIXW16tRdm+/NH350aQ9H6V0=

Unfortunately I have no idea what it was in the previous file at this point.

@ableeker
Copy link
Contributor

ableeker commented Dec 2, 2020

That new key looks fine, it's base 64 encoded, it's the right length, and it's recognised by DeDRM. But DeDRM 4.8.0 is unable to decrypt the user key that should be available on the computer. The error in adobekey.py points to code that deals with ADE activation. In fact that very line 359 should have raised the error "Adobe Digital Editions not activated", because it's unable to read the Registry key HKEY_CURRENT_USER\SOFTWARE\Adobe\Adept\Device\key. That's the user key.

It looks to me something went wrong activating the computer. When it's activated properly, DeDRM 6.8.0 should decrypt the book just fine. There's even a good chance that 7.0.0 would work as well.

@DanRinkevich
Copy link
Author

DanRinkevich commented Dec 2, 2020

ableeker,
Thank you. I fixed it.
I uninstalled ADE 2.0.6. I deleted the Digital Editions folder in Documents. I deleted all of the registry entries under:
\HKEY_CURRENT_USER\Software\Adobe\Adept
\HKEY_CURRENT_USER\Software\Adobe\Digital Editions
I reinstalled ADE 2.0.6. I authorized the computer again. And I moved the epub file to Calibre and it worked! Yay!
Thank you for your help. Now I think I'll upgrade Calibre and DeDRM to the latest and see if it still works.

@ableeker
Copy link
Contributor

ableeker commented Dec 2, 2020

Hm, so that key exists... It looks fine as well. Actually, my key is 264 bytes long, but it starts exactly the same way:

01 00 00 00 d0 8c 9d df 01 15 d1 11 8c 7a 00 c0 ...

Odd...

Hehe, I just found on the Adobe forum some topic with the advice to do exactly what you've just done.

@ElleKayEm
Copy link

Ah, I was just coming to give you the link to this page with instructions on de-authorizing, deleting the registry key, and re-authorizing. Glad you got it sorted. If you're all set, you can close the issue.

@DanRinkevich
Copy link
Author

Thanks for your help. I upgraded back up to:
Calibre: 5.6.0
DeDRM: 7.0.0b3
ADE: '4.5.11.187303'
And it's working great!

@ElleKayEm
Copy link

Just be aware that it's possible to get Adobe DRM that can't be removed when using ADE 3 and up. Glad to hear DeDRM 7 is working for Adobe epubs.

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

3 participants