apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.56k stars 1.52k forks source link

KFX decryption fails with both Calibre 4/DeDRM 6.8 and Calibre 5 with DeDRM 7.0 #1440

Open Invictaz opened 3 years ago

Invictaz commented 3 years ago

CheckList


DRM decryption fails on my ebook

My Environment: Windows 7 x64

Calibre: Both 4.91 and 5.72 tried

Kindle: 1.23

DeDRM: 6.80 and 7.0b4

Log

Gather KFX-ZIP (from KFX Input): Gathered 5 file(s) as C:\Users\Invictaz\AppData\Local\Temp\calibre_rit3nm9h\59_9yhbn.kfx-zip
[28.83] splash screen hidden
[28.83] Started up in 28.83 seconds with 1 books
DeDRM v7.0.0: Trying to decrypt 59_9yhbn.kfx-zip
Using Library AlfCrypto DLL/DYLIB/SO
Using Library AlfCrypto DLL/DYLIB/SO
Decrypting KFX-ZIP ebook: 59_9yhbn
Found 0 keys to try after 0.1 seconds
Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.a45d39b9-ff56-4c06-a4b3-d8f863421588.voucher
DeDRM v7.0.0: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
DeDRM v7.0.0: Looking for new default Kindle Key after 0.1 seconds
searching for kinfoFiles in C:\Users\Invictaz\AppData\Local
Found K4PC 1.9+ kinf2011 file: C:\Users\Invictaz\AppData\Local\Amazon\Kindle\storage\.kinf2011
Decrypted key file using IDString '3859648657' and UserName 'Invictaz'
DeDRM v7.0.0: Found 1 new key
Decrypting KFX-ZIP ebook: 59_9yhbn
Got DSN key from database default_key_1
Found 1 keys to try after 0.2 seconds
Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.a45d39b9-ff56-4c06-a4b3-d8f863421588.voucher
DeDRM v7.0.0: Ultimately failed to decrypt after 0.2 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
Package KFX (from KFX Input) 1.36.0: Packaging C:\Users\Invictaz\AppData\Local\Temp\calibre_rit3nm9h\59_9yhbn.kfx-zip
Processing container: B08P5JRJDT_EBOK.azw
KFX metadata reader (from KFX Input) activated for C:\Users\Invictaz\AppData\Local\Temp\calibre_rit3nm9h\9wqn1f8b_add_books\0\B08P5JRJDT_EBOK.kfx-zip
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 534, in KindleMobiDecrypt
  File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook
  File "calibre_plugins.dedrm.kfxdedrm", line 42, in processBook
  File "calibre_plugins.dedrm.kfxdedrm", line 82, in decrypt_voucher
Exception: Failed to decrypt KFX DRM voucher with any key

Invictaz commented 3 years ago

It also failed when I tried on Calibre 4 with DeDRM 6.8

The only solution was to disable the rendertest and download in .AZW in Kindle, then drop into Calibre which makes it an AZW3 and that would let me convert and strip DRM. BUT the images look a bit skewed?

Just dropping the KFX into a separate folder and then trying to convert doesn't work. You need all the files also .amz-res

The .azw3 files are much bigger.

ElleKayEm commented 3 years ago

DeDRM 7 doesn't appear to be working for KFX files yet. It should work with DeDRM 6.8 on calibre 4.23 or earlier as long as you also have the KFX Input plugin and your books are from Kindle for PC 1.26 or earlier. But AZW3 is generally better for conversion and backup anyway.

The recommended version of calibre for Windows 7 is 3.48. But if you've updated to 5, you could have issues with the calibre database going back to anything earlier then calibre 4.23 (the last version before 5). If you do, you'll need to ask for help on that over at the MobileRead calibre forums though.

I wouldn't be surprised if the images look skewed in the calibre ebook viewer. Do they look that way on whatever device/app you're actually going to read the book on? Or if you open the image files themselves?