noDRM / DeDRM_tools

DeDRM tools for ebooks
6.6k stars 288 forks source link

Adobe DRM issue - Incorrect AES key length #567

Closed xbb78 closed 13 hours ago

xbb78 commented 3 days ago

Question / bug report

Impossible to add books with adobe drm into my kindle

Which version of Calibre are you running?

7.8

Which version of the DeDRM plugin are you running?

v10.0.3 & v10.0.9

If applicable, which version of the Kindle software are you running?

v=5.16.9

Log output

ApplicationPaletteChange event ignored
Using calibre Qt style: True
calibre Journal de débogage
calibre 7.8  embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.11.5
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: fr
EXE path: C:\Program Files\Calibre2\calibre-debug.exe
Successfully initialized third party plugins: DeDRM (10, 0, 3)
calibre 7.8  embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.11.5
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: fr
EXE path: C:\Program Files\Calibre2\calibre-debug.exe
Successfully initialized third party plugins: DeDRM (10, 0, 3)
QPA platform: windows
devicePixelRatio: 1.25
logicalDpi: 96.0 x 96.0
physicalDpi: 98.8958174904943 x 98.85405405405406
[0.00] Starting up...
[0.00] Showing splash screen...
[0.14] splash screen shown
[0.14] Initializing db...
[0.19] db initialized
[0.19] Constructing main UI...
[0.44] GUI main window shown
[0.50] main UI initialized...
[0.50] Hiding splash screen
[3.28] splash screen hidden
[3.28] Started up in 3.28 seconds with 253 books
DeDRM v10.0.3: Trying to decrypt La Mythologie en BD - Dieux et Déesses de la mythologie grecque .epub
DeDRM v10.0.3: Verifying zip archive integrity
DeDRM v10.0.3: Trying to decrypt Devant Dieu et les hommes.epub
DeDRM v10.0.3: Verifying zip archive integrity
DeDRM v10.0.3: Devant Dieu et les hommes.epub is a secure Adobe Adept ePub for UUID 54907588-d973-44b0-8d0e-32c3e0607484
DeDRM v10.0.3: Trying Encryption key default_key
sp7qnrkd.epub is a secure Adobe Adept ePub.
Could not decrypt sp7qnrkd.epub because of an exception:
Traceback (most recent call last):
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptepub.py", line 327, in decryptBook
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptepub.py", line 150, in __init__
  File "Crypto\Cipher\AES.py", line 228, in new
  File "Crypto\Cipher\__init__.py", line 79, in _create_cipher
  File "Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher
  File "Crypto\Cipher\AES.py", line 90, in _create_base_cipher
ValueError: Incorrect AES key length (0 bytes)

DeDRM v10.0.3: Failed to decrypt with key default_key after 0.1 seconds
DeDRM v10.0.3: Looking for new default Adobe Digital Editions Keys after 0.1 seconds
DeDRM v10.0.3: La Mythologie en BD - Dieux et Déesses de la mythologie grecque .epub is a secure Adobe Adept ePub for UUID d19fe0d8-6738-4682-9042-ed583f881dc5
DeDRM v10.0.3: Trying Encryption key default_key
16hwwpl1.epub is a secure Adobe Adept ePub.
DeDRM v10.0.3: Exception when getting default Adobe Key after 0.1 seconds
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 591, in ePubDecrypt
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 347, in adeptkeys
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 327, in CryptUnprotectData
adobekey.ADEPTError: Failed to decrypt user key key (sic)
Could not decrypt 16hwwpl1.epub because of an exception:
Traceback (most recent call last):
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptepub.py", line 327, in decryptBook
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptepub.py", line 150, in __init__
  File "Crypto\Cipher\AES.py", line 228, in new
  File "Crypto\Cipher\__init__.py", line 79, in _create_cipher
  File "Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher
  File "Crypto\Cipher\AES.py", line 90, in _create_base_cipher
ValueError: Incorrect AES key length (0 bytes)

DeDRM v10.0.3: Failed to decrypt with key default_key after 0.2 seconds
DeDRM v10.0.3: Looking for new default Adobe Digital Editions Keys after 0.2 seconds
DeDRM v10.0.3: Exception when getting default Adobe Key after 0.2 seconds
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 591, in ePubDecrypt
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 347, in adeptkeys
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 327, in CryptUnprotectData
adobekey.ADEPTError: Failed to decrypt user key key (sic)   
DeDRM v10.0.3: Ultimately failed to decrypt after 0.2 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
  File "calibre\customize\ui.py", line 199, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1067, in run
  File "calibre_plugins.dedrm.__init__", line 665, in ePubDecrypt
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.3: Ultimately failed to decrypt after 0.2 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
DeDRM v10.0.3: Ultimately failed to decrypt after 0.3 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
  File "calibre\customize\ui.py", line 199, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1067, in run
  File "calibre_plugins.dedrm.__init__", line 665, in ePubDecrypt
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.3: Ultimately failed to decrypt after 0.3 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Added Devant Dieu et les hommes to db in: 1.1
xbb78 commented 3 days ago

Update : I tried to remove the adobe key from the plugin to let it get a new one. Below the new log :


DeDRM v10.0.9: Trying to decrypt Devant Dieu et les hommes.epub
DeDRM v10.0.9: Verifying zip archive integrity
DeDRM v10.0.9: Devant Dieu et les hommes.epub is a secure Adobe Adept ePub for UUID 54907588-d973-44b0-8d0e-32c3e0607484
DeDRM v10.0.9: Looking for new default Adobe Digital Editions Keys after 0.1 seconds
DeDRM v10.0.9: Exception when getting default Adobe Key after 0.1 seconds
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 565, in ePubDecrypt
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 293, in adeptkeys
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 273, in CryptUnprotectData
adobekey.ADEPTError: Failed to decrypt user key key (sic)```
ElleKayEm commented 3 days ago

ADE on the same computer and user as calibre/DeDRM was used to download the book?

xbb78 commented 3 days ago

Yes ADE on the same computer and ADE authorized my computer without ID (was working before). I also tried with a real Adobe ID, same initial issue about key length.

Le ven. 5 juil. 2024, 10:59, ElleKayEm @.***> a écrit :

ADE on the same computer and user as calibre/DeDRM was used to download the book?

— Reply to this email directly, view it on GitHub https://github.com/noDRM/DeDRM_tools/issues/567#issuecomment-2210484003, or unsubscribe https://github.com/notifications/unsubscribe-auth/BI4RTEU2AY5IGHWVQ2KFHXDZKZOARAVCNFSM6AAAAABKMXAPSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJQGQ4DIMBQGM . You are receiving this because you authored the thread.Message ID: @.***>

ElleKayEm commented 3 days ago

If there is a key saved in DeDRM's customization, delete it. Download a fresh copy of the book and add it to calibre letting DeDRM retrieve the key automatically.

xbb78 commented 3 days ago

Already tried : see my 1st reply with the new log

Le ven. 5 juil. 2024, 12:26, ElleKayEm @.***> a écrit :

If there is a key saved in DeDRM's customization, delete it. Download a fresh copy of the book and add it to calibre letting DeDRM retrieve the key automatically.

— Reply to this email directly, view it on GitHub https://github.com/noDRM/DeDRM_tools/issues/567#issuecomment-2210623303, or unsubscribe https://github.com/notifications/unsubscribe-auth/BI4RTEWSGWEQGUISJAEDF5TZKZYE5AVCNFSM6AAAAABKMXAPSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJQGYZDGMZQGM . You are receiving this because you authored the thread.Message ID: @.***>

ElleKayEm commented 2 days ago

So you tried with a fresh copy of the book downloaded with or without having ADE authorized with an Adobe ID? And is ADE currently authorized with that Adobe ID? If the book was downloaded when ADE wasn't authorized with an Adobe ID, then its DRM is tied to that installation of ADE. If the book was downloaded after ADE was authorized with an Adobe ID, then it will be tied to the Adobe ID.

xbb78 commented 2 days ago

I tried 2 books, 1 for each situation : with or without Adobe ID. I just tried again to add the book tied to my Adobe ID, with ADE reconfigured with this ID, I get the same error :

DeDRM v10.0.9: Trying to decrypt La Mythologie en BD - Dieux et Déesses de la mythologie grecque -1.epub
DeDRM v10.0.9: Verifying zip archive integrity
DeDRM v10.0.9: La Mythologie en BD - Dieux et Déesses de la mythologie grecque -1.epub is a secure Adobe Adept ePub for UUID d19fe0d8-6738-4682-9042-ed583f881dc5
DeDRM v10.0.9: Looking for new default Adobe Digital Editions Keys after 0.4 seconds
DeDRM v10.0.9: Exception when getting default Adobe Key after 0.4 seconds
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 565, in ePubDecrypt
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 293, in adeptkeys
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 273, in CryptUnprotectData
adobekey.ADEPTError: Failed to decrypt user key key (sic)
DeDRM v10.0.9: Ultimately failed to decrypt after 0.4 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
  File "calibre\customize\ui.py", line 199, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1041, in run
  File "calibre_plugins.dedrm.__init__", line 639, in ePubDecrypt
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.9: Ultimately failed to decrypt after 0.4 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
[2.06] splash screen hidden
[2.06] Started up in 2.06 seconds with 255 books
Added La Mythologie en BD - Dieux et Déesses de la mythologie grecque en BD to db in: 1.4
ElleKayEm commented 2 days ago

Try deauthorizing and reauthorizing ADE with your Adobe ID. Scroll down to TROUBLESHOOTING REAUTHORIZATION AND DEAUTHORIZATION ISSUES ON WINDOWS and follow those instructions (as it says, be careful with the registry).

xbb78 commented 1 day ago

You mean deauthorizing in ADE itself ? if yes, already done it but I tried again, same error

DeDRM v10.0.9: Trying to decrypt La Mythologie en BD - Dieux et Déesses de la mythologie grecque -2.epub
DeDRM v10.0.9: Verifying zip archive integrity
DeDRM v10.0.9: La Mythologie en BD - Dieux et Déesses de la mythologie grecque -2.epub is a secure Adobe Adept ePub for UUID d19fe0d8-6738-4682-9042-ed583f881dc5
DeDRM v10.0.9: Looking for new default Adobe Digital Editions Keys after 0.4 seconds
DeDRM v10.0.9: Exception when getting default Adobe Key after 0.4 seconds
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 565, in ePubDecrypt
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 293, in adeptkeys
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 273, in CryptUnprotectData
adobekey.ADEPTError: Failed to decrypt user key key (sic)
DeDRM v10.0.9: Ultimately failed to decrypt after 0.5 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
  File "calibre\customize\ui.py", line 199, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1041, in run
  File "calibre_plugins.dedrm.__init__", line 639, in ePubDecrypt
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.9: Ultimately failed to decrypt after 0.5 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
[6.14] splash screen hidden
[6.14] Started up in 6.14 seconds with 254 books
Added La Mythologie en BD - Dieux et Déesses de la mythologie grecque en BD to db in: 1.5
ElleKayEm commented 1 day ago

No, not in ADE. Sorry, didn't include the link I was refering to: https://helpx.adobe.com/digital-editions/kb/activation-errors-adobe-digital-editions.html

xbb78 commented 1 day ago

OK thanks. I tried it but same issue :

DeDRM v10.0.9: Exception when getting default Adobe Key after 0.2 seconds
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 565, in ePubDecrypt
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 293, in adeptkeys
  File "C:\Users\Windows\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 273, in CryptUnprotectData
adobekey.ADEPTError: Failed to decrypt user key key (sic)
DeDRM v10.0.9: Ultimately failed to decrypt after 0.3 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
  File "calibre\customize\ui.py", line 199, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1041, in run
  File "calibre_plugins.dedrm.__init__", line 639, in ePubDecrypt
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.9: Ultimately failed to decrypt after 0.3 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
[9.56] splash screen hidden
[9.56] Started up in 9.56 seconds with 254 books
Added La Mythologie en BD - Dieux et Déesses de la mythologie grecque en BD to db in: 1.2
ElleKayEm commented 1 day ago

I don't know what is going on with your setup then. You are able to read the freshly downloaded book in ADE before importing it into calibre?

xbb78 commented 1 day ago

Finally it's working. I desinstalled ADE, removed all ADE elements from the registry and installed the last version. I even tried with a new book, everything seems fine.

Thanks for your help.

Le sam. 6 juil. 2024, 22:45, ElleKayEm @.***> a écrit :

I don't know what is going on with your setup then. You are able to read the freshly downloaded book in ADE before importing it into calibre?

— Reply to this email directly, view it on GitHub https://github.com/noDRM/DeDRM_tools/issues/567#issuecomment-2211962851, or unsubscribe https://github.com/notifications/unsubscribe-auth/BI4RTEWTOUEK35RKOIQROFLZLBJPTAVCNFSM6AAAAABKMXAPSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJRHE3DEOBVGE . You are receiving this because you authored the thread.Message ID: @.***>

ElleKayEm commented 1 day ago

Glad to hear it. If you're all set, you can close the issue.