apprenticeharper / DeDRM_tools

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

DeDRM not working - kindle for mac calibre #1926

Open calathu opened 3 years ago

calathu commented 3 years ago

Hi, requesting help please and thank you in advance if you're able to help. DRM still present on the book I want to convert. I bought the book thatwas recently released on kindle. I use kindle for mac. it used to work a few months ago then updated, so i deleted it and looked for an older version. ive tried multiple versions and the problem is still the same (i think its the something to do with not being able to decrypt KFX DRM voucher with any key).

I downloaded Kindle for mac 1.12 from https://kindle-mac.en.uptodown.com/mac/versions as these were the only one I could find to be earlier than 1.17.

this is the code from the debug mode

calibre Debug log calibre 5.32 embedded-python: True is64bit: True macOS-10.14.6-x86_64-i386-64bit Darwin ('64bit', '') ('Darwin', '18.7.0', 'Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64') Python 3.8.5 OSX: ('10.14.6', ('', '', ''), 'x86_64') Interface language: en_GB Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 45, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 45, 0) && KFX metadata reader (from KFX Input) (1, 45, 0) && KFX Input (1, 45, 0) calibre 5.32 embedded-python: True is64bit: True macOS-10.14.6-x86_64-i386-64bit Darwin ('64bit', '') ('Darwin', '18.7.0', 'Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64') Python 3.8.5 OSX: ('10.14.6', ('', '', ''), 'x86_64') Interface language: en_GB Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 45, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 45, 0) && KFX metadata reader (from KFX Input) (1, 45, 0) && KFX Input (1, 45, 0) devicePixelRatio: 2.0 logicalDpi: 72.0 x 72.0 physicalDpi: 113.50000170459899 x 113.50000170459901 Using calibre Qt style: True [0.00] Starting up... [0.02] Showing splash screen... [0.44] splash screen shown [0.44] Initializing db... [0.45] db initialized [0.46] Constructing main UI... [1.24] main UI initialized... [1.24] Hiding splash screen Starting QuickView objc[70056]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff9a6113d8) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x113862f50). One of the two will be used. Which one is undefined. Gather KFX-ZIP (from KFX Input) 1.45.0: Importing /Users/Danielle/Desktop/kindle/My Kindle Content/B09CRMMXVL_EBOK/B09CRMMXVL_EBOK.azw Gather KFX-ZIP (from KFX Input): Gathered 4 file(s) as /var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/lg5mgzsg.kfx-zip DeDRM v7.2.1: Trying to decrypt lg5mgzsg.kfx-zip Using Library AlfCrypto Python Using Library AlfCrypto Python Decrypting KFX-ZIP ebook: lg5mgzsg Found 0 keys to try after 0.1 seconds Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.6c35a05a-1644-4f48-b5be-69b0395aa0f5.voucher Traceback (most recent call last): File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher voucher.decryptvoucher() File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 879, in decryptvoucher b = pkcs7unpad(b, 16) File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 758, in pkcs7unpad _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key") File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 98, in _assert raise Exception(msg) Exception: Incorrect padding - Wrong key DeDRM v7.2.1: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds Found k4Mac kinf2018 file: /Users/Danielle/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018 Found k4Mac kinf2018 file: /Users/Danielle/Library/Application Support/Kindle/storage/.kinf2018 trying username b'Danielle' on file /Users/Danielle/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018 trying IDString: b'51f92cbf1bd8' [3.60] splash screen hidden [3.60] Started up in 3.60 seconds with 6 books Decrypted key file using IDString '51f92cbf1bd8' and UserName 'Danielle' trying username b'Danielle' on file /Users/Danielle/Library/Application Support/Kindle/storage/.kinf2018 trying IDString: b'51f92cbf1bd8' Decrypted key file using IDString '51f92cbf1bd8' and UserName 'Danielle' DeDRM v7.2.1: Found 2 new keys Decrypting KFX-ZIP ebook: lg5mgzsg Got SerialNumber from database default_key_1 Got UsernameHash from database default_key_1 Got SerialNumber from database default_key_2 Got UsernameHash from database default_key_2 Found 2 keys to try after 1.2 seconds Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.6c35a05a-1644-4f48-b5be-69b0395aa0f5.voucher Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 540, in KindleMobiDecrypt book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime) File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook mb.processBook(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 45, in processBook self.decrypt_voucher(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 89, in decrypt_voucher raise Exception("Failed to decrypt KFX DRM voucher with any key") Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher voucher.decryptvoucher() File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 879, in decryptvoucher b = pkcs7unpad(b, 16) File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 758, in pkcs7unpad _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key") File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 98, in _assert raise Exception(msg) Exception: Incorrect padding - Wrong key Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 540, in KindleMobiDecrypt book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime) File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook mb.processBook(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 45, in processBook self.decrypt_voucher(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 89, in decrypt_voucher raise Exception("Failed to decrypt KFX DRM voucher with any key") Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher voucher.decryptvoucher() File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 879, in decryptvoucher b = pkcs7unpad(b, 16) File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 758, in pkcs7unpad _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key") File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 98, in _assert raise Exception(msg) Exception: Incorrect padding - Wrong key Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 540, in KindleMobiDecrypt book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime) File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook mb.processBook(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 45, in processBook self.decrypt_voucher(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 89, in decrypt_voucher raise Exception("Failed to decrypt KFX DRM voucher with any key") Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher voucher.decryptvoucher() File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 879, in decryptvoucher b = pkcs7unpad(b, 16) File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 758, in pkcs7unpad _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key") File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m5xna2y9plugin_unzip/ion.py", line 98, in _assert raise Exception(msg) Exception: Incorrect padding - Wrong key DeDRM v7.2.1: Ultimately failed to decrypt after 1.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.45.0: Packaging /var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/lg5mgzsg.kfx-zip Processing container: B09CRMMXVL_EBOK.azw KFX metadata reader (from KFX Input) activated for /var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_4_ozh7aj/m91k3pdp_add_books/0/B09CRMMXVL_EBOK.kfx-zip Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 540, in KindleMobiDecrypt book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime) File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook mb.processBook(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 45, in processBook self.decrypt_voucher(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 89, in decrypt_voucher raise Exception("Failed to decrypt KFX DRM voucher with any key") Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "calibre/customize/ui.py", line 175, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 633, in run decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook) File "calibre_plugins.dedrm.init", line 583, in KindleMobiDecrypt raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime)) calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 1.2 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Running file type plugin Package KFX (from KFX Input) failed with traceback: Traceback (most recent call last): File "calibre/customize/ui.py", line 175, in _run_filetype_plugins File "calibre_plugins.kfx_input.package_filetype", line 21, in run return self.run_kfx(path_to_ebook) File "calibre_plugins.kfx_input.package_filetype", line 32, in run_kfx kfx_data = YJ_Book(path_to_ebook).convert_to_single_kfx() File "calibre_plugins.kfx_input.kfxlib.yj_book", line 84, in convert_to_single_kfx self.decode_book() File "calibre_plugins.kfx_input.kfxlib.yj_book", line 211, in decode_book container = self.get_container(datafile) File "calibre_plugins.kfx_input.kfxlib.yj_book", line 318, in get_container raise KFXDRMError("Book container %s has DRM and cannot be converted" % datafile.name) calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container B09CRMMXVL_EBOK.azw has DRM and cannot be converted

ElleKayEm commented 3 years ago

This definitely wasn't downloaded with Kindle for Mac 1.12 since it is in KFX format. I didn't even think anything older then 1.17 still worked. The book needs to be downloaded with the currently installed Kindle for Mac on the same machine and user as calibre with DeDRM.

calathu commented 3 years ago

This definitely wasn't downloaded with Kindle for Mac 1.12 since it is in KFX format. I didn't even think anything older then 1.17 still worked. The book needs to be downloaded with the currently installed Kindle for Mac on the same machine and user as calibre with DeDRM.

yep you're right, the link wasn't what it said it was, i see now it is 1.31 :(

ElleKayEm commented 3 years ago

See this post for getting books you can decrypt from 1.31: https://www.mobileread.com/forums/showpost.php?p=3819708&postcount=508

Also see this post on preventing updates: https://www.mobileread.com/forums/showthread.php?p=4123506#post4123506

calathu commented 3 years ago

I managed to download the Kindlle for mac version 1.28 and the book still remains in KFX-ZIP format sadly

calathu commented 3 years ago

I have downloaded k4M 1.28, I have used the chmod -x command, when I pressed enter nothing happened so I presume it worked (no error or anything like that came up).

this is from debug:

calibre Debug log calibre 5.32 embedded-python: True is64bit: True macOS-10.14.6-x86_64-i386-64bit Darwin ('64bit', '') ('Darwin', '18.7.0', 'Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64') Python 3.8.5 OSX: ('10.14.6', ('', '', ''), 'x86_64') Interface language: en_GB Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 45, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 45, 0) && KFX metadata reader (from KFX Input) (1, 45, 0) && KFX Input (1, 45, 0) calibre 5.32 embedded-python: True is64bit: True macOS-10.14.6-x86_64-i386-64bit Darwin ('64bit', '') ('Darwin', '18.7.0', 'Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64') Python 3.8.5 OSX: ('10.14.6', ('', '', ''), 'x86_64') Interface language: en_GB Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 45, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 45, 0) && KFX metadata reader (from KFX Input) (1, 45, 0) && KFX Input (1, 45, 0) devicePixelRatio: 2.0 logicalDpi: 72.0 x 72.0 physicalDpi: 113.50000170459899 x 113.50000170459901 Using calibre Qt style: True [0.00] Starting up... [0.03] Showing splash screen... [0.45] splash screen shown [0.45] Initializing db... [0.46] db initialized [0.46] Constructing main UI... [1.33] main UI initialized... [1.33] Hiding splash screen Starting QuickView objc[38118]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff9a6113d8) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x1192cdf50). One of the two will be used. Which one is undefined. Gather KFX-ZIP (from KFX Input) 1.45.0: Importing /Users/Danielle/Desktop/My Kindle Content/B09CRMMXVL_EBOK/B09CRMMXVL_EBOK.azw Gather KFX-ZIP (from KFX Input): Gathered 4 file(s) as /var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/65fyi1w9.kfx-zip DeDRM v7.2.1: Trying to decrypt 65fyi1w9.kfx-zip Using Library AlfCrypto Python Using Library AlfCrypto Python Decrypting KFX-ZIP ebook: 65fyi1w9 Found 0 keys to try after 0.1 seconds Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.6c35a05a-1644-4f48-b5be-69b0395aa0f5.voucher Traceback (most recent call last): File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher voucher.decryptvoucher() File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 879, in decryptvoucher b = pkcs7unpad(b, 16) File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 758, in pkcs7unpad _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key") File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 98, in _assert raise Exception(msg) Exception: Incorrect padding - Wrong key DeDRM v7.2.1: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds Found k4Mac kinf2018 file: /Users/Danielle/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018 Found k4Mac kinf2018 file: /Users/Danielle/Library/Application Support/Kindle/storage/.kinf2018 trying username b'Danielle' on file /Users/Danielle/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018 trying IDString: b'51f92cbf1bd8' Decrypted key file using IDString '51f92cbf1bd8' and UserName 'Danielle' trying username b'Danielle' on file /Users/Danielle/Library/Application Support/Kindle/storage/.kinf2018 trying IDString: b'51f92cbf1bd8' Decrypted key file using IDString '51f92cbf1bd8' and UserName 'Danielle' DeDRM v7.2.1: Found 2 new keys Decrypting KFX-ZIP ebook: 65fyi1w9 Got SerialNumber from database default_key_1 Got UsernameHash from database default_key_1 Got SerialNumber from database default_key_2 Got UsernameHash from database default_key_2 Found 2 keys to try after 1.2 seconds Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.6c35a05a-1644-4f48-b5be-69b0395aa0f5.voucher Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 540, in KindleMobiDecrypt book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime) File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook mb.processBook(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 45, in processBook self.decrypt_voucher(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 89, in decrypt_voucher raise Exception("Failed to decrypt KFX DRM voucher with any key") Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher voucher.decryptvoucher() File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 879, in decryptvoucher b = pkcs7unpad(b, 16) File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 758, in pkcs7unpad _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key") File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 98, in _assert raise Exception(msg) Exception: Incorrect padding - Wrong key Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 540, in KindleMobiDecrypt book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime) File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook mb.processBook(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 45, in processBook self.decrypt_voucher(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 89, in decrypt_voucher raise Exception("Failed to decrypt KFX DRM voucher with any key") Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher voucher.decryptvoucher() File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 879, in decryptvoucher b = pkcs7unpad(b, 16) File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 758, in pkcs7unpad _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key") File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 98, in _assert raise Exception(msg) Exception: Incorrect padding - Wrong key Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 540, in KindleMobiDecrypt book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime) File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook mb.processBook(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 45, in processBook self.decrypt_voucher(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 89, in decrypt_voucher raise Exception("Failed to decrypt KFX DRM voucher with any key") Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher voucher.decryptvoucher() File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 879, in decryptvoucher b = pkcs7unpad(b, 16) File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 758, in pkcs7unpad _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key") File "/var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/bml7cqzbplugin_unzip/ion.py", line 98, in _assert raise Exception(msg) Exception: Incorrect padding - Wrong key DeDRM v7.2.1: Ultimately failed to decrypt after 1.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.45.0: Packaging /var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/65fyi1w9.kfx-zip Processing container: B09CRMMXVL_EBOK.azw KFX metadata reader (from KFX Input) activated for /var/folders/zt/wl4mnfyn6_dbyff5t_r_cbcr0000gn/C/calibre_5.32.0_tmp_6x5fwn4u/kfq4aprb_add_books/0/B09CRMMXVL_EBOK.kfx-zip Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 540, in KindleMobiDecrypt book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime) File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook mb.processBook(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 45, in processBook self.decrypt_voucher(totalpids) File "calibre_plugins.dedrm.kfxdedrm", line 89, in decrypt_voucher raise Exception("Failed to decrypt KFX DRM voucher with any key") Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "calibre/customize/ui.py", line 175, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 633, in run decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook) File "calibre_plugins.dedrm.init", line 583, in KindleMobiDecrypt raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime)) calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 1.2 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Running file type plugin Package KFX (from KFX Input) failed with traceback: Traceback (most recent call last): File "calibre/customize/ui.py", line 175, in _run_filetype_plugins File "calibre_plugins.kfx_input.package_filetype", line 21, in run return self.run_kfx(path_to_ebook) File "calibre_plugins.kfx_input.package_filetype", line 32, in run_kfx kfx_data = YJ_Book(path_to_ebook).convert_to_single_kfx() File "calibre_plugins.kfx_input.kfxlib.yj_book", line 84, in convert_to_single_kfx self.decode_book() File "calibre_plugins.kfx_input.kfxlib.yj_book", line 211, in decode_book container = self.get_container(datafile) File "calibre_plugins.kfx_input.kfxlib.yj_book", line 318, in get_container raise KFXDRMError("Book container %s has DRM and cannot be converted" % datafile.name) calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container B09CRMMXVL_EBOK.azw has DRM and cannot be converted [6.91] splash screen hidden [6.91] Started up in 6.91 seconds with 6 books Added Our Cosmic Origin: Knowledge in preparation for the ascension of planet Earth. to db in: 0.0 Added 1 books in 2.2 seconds

ElleKayEm commented 3 years ago

Still getting KFX format here which cannot be decrypted from Kindle for Mac later then 1.26.

calathu commented 3 years ago

OK so thats the problem. I thought I saw posts on mobileread from people who have been able to decrypt on 1.28

Thanks for a quick reply also :)

ElleKayEm commented 3 years ago

You can if you get KFX downloads disabled.

calathu commented 3 years ago

How does one do that, do you have any ideas please? I don't get what I'm doing wrong atm.

ElleKayEm commented 3 years ago

Method 2 at this post: https://www.mobileread.com/forums/showthread.php?t=283371

And see this post: https://www.mobileread.com/forums/showpost.php?p=3819708&postcount=508