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

Kindle Key Decryption failed (Mac OS 11.7.1, Kindle 1.39.0 (65307), Plugin 10.0.3, Calibre 6.9) #214

Closed
Davidver1 opened this issue Nov 26, 2022 · 1 comment

Comments

@Davidver1
Copy link

Question / bug report

I am trying to convert this book to EPUB, but get an error message that the book is still protected by DRM (in spite of having DeDRM installed):
https://www.amazon.nl/Intimate-History-Humanity-English-ebook/dp/B00AC05GBQ

Which version of Calibre are you running?

6.9

Which version of the DeDRM plugin are you running?

v10.0.3

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

1.39.0 (65307)

Log output

Using calibre Qt style: True
calibre Foutopsporingslog
calibre 6.9  embedded-python: True
macOS-11.7.1-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '20.6.0', 'Darwin Kernel Version 20.6.0: Thu Sep 29 20:15:11 PDT 2022; root:xnu-7195.141.42~1/RELEASE_X86_64')
Python 3.10.1
OSX: ('11.7.1', ('', '', ''), 'x86_64')
Interface language: nl
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 50, 0) && DeDRM (10, 0, 3) && Package KFX (from KFX Input) (1, 50, 0) && KFX metadata reader (from KFX Input) (1, 50, 0) && KFX Input (1, 50, 0)
calibre 6.9  embedded-python: True
macOS-11.7.1-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '20.6.0', 'Darwin Kernel Version 20.6.0: Thu Sep 29 20:15:11 PDT 2022; root:xnu-7195.141.42~1/RELEASE_X86_64')
Python 3.10.1
OSX: ('11.7.1', ('', '', ''), 'x86_64')
Interface language: nl
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 50, 0) && DeDRM (10, 0, 3) && Package KFX (from KFX Input) (1, 50, 0) && KFX metadata reader (from KFX Input) (1, 50, 0) && KFX Input (1, 50, 0)
QPA platform: cocoa
devicePixelRatio: 1.0
logicalDpi: 72.0 x 72.0
physicalDpi: 136.0000020425151 x 135.0000020274966
[0.00] Starting up...
[0.08] Showing splash screen...
[0.31] splash screen shown
[0.31] Initializing db...
[0.33] db initialized
[0.33] Constructing main UI...
Screens currently in system:
{'depth': 24,
 'device_pixel_ratio': 1.0,
 'geometry_in_logical_pixels': {'height': 768, 'width': 1366, 'x': 0, 'y': 0},
 'index_in_screens_list': 0,
 'manufacturer': '',
 'model': '',
 'name': 'Color LCD',
 'serial': '',
 'size_in_logical_pixels': {'height': 768, 'width': 1366},
 'virtual_geometry': {'height': 768, 'width': 1366, 'x': 0, 'y': 0}}
Restoring geometry for: calibre_main_window_geometry
{'frame_geometry': {'height': 768, 'width': 1366, 'x': 0, 'y': 0},
 'full_screened': True,
 'geometry': {'height': 768, 'width': 1366, 'x': 0, 'y': 0},
 'maximized': False,
 'normal_geometry': {'height': 768, 'width': 1366, 'x': 0, 'y': 0},
 'screen': {'depth': 24,
            'device_pixel_ratio': 1.0,
            'geometry_in_logical_pixels': {'height': 768,
                                           'width': 1366,
                                           'x': 0,
                                           'y': 0},
            'index_in_screens_list': 0,
            'manufacturer': '',
            'model': '',
            'name': 'Color LCD',
            'serial': '',
            'size_in_logical_pixels': {'height': 768, 'width': 1366},
            'virtual_geometry': {'height': 768, 'width': 1366, 'x': 0, 'y': 0}}}
Matching screen: {'depth': 24,
 'device_pixel_ratio': 1.0,
 'geometry_in_logical_pixels': {'height': 768, 'width': 1366, 'x': 0, 'y': 0},
 'index_in_screens_list': 0,
 'manufacturer': '',
 'model': '',
 'name': 'Color LCD',
 'serial': '',
 'size_in_logical_pixels': {'height': 768, 'width': 1366},
 'virtual_geometry': {'height': 768, 'width': 1366, 'x': 0, 'y': 0}}
Setting widget geometry to: {'height': 768, 'width': 1366, 'x': 0, 'y': 0}
Restoring widget to full screen
Key 'B' for shortcut Doorblader annotaties is already used by Boeken bijschaven, ignoring
[1.58] main UI initialized...
[1.58] Hiding splash screen
[1.58] splash screen hidden
[1.58] Started up in 1.58 seconds with 0 books
Starting QuickView
Gather KFX-ZIP (from KFX Input) 1.50.0: Importing /Users/davidversteeg/Calibre Library/My Kindle Content/B00AC05GBQ_EBOK/B00AC05GBQ_EBOK.azw
Gather KFX-ZIP (from KFX Input): Gathered 4 file(s) as /var/folders/zv/lh36bnbj42d_yk6whcgm0cc40000gn/C/calibre_6.9.0_tmp_zlvn_rj1/2ho2m9ds.kfx-zip
DeDRM v10.0.3: Trying to decrypt 2ho2m9ds.kfx-zip
Using Library AlfCrypto Python
Decrypting KFX-ZIP ebook: 2ho2m9ds
Found 0 keys to try after 0.1 seconds
Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.07ae4f78-b1b3-4c15-98d0-5c3104372a69.voucher
Traceback (most recent call last):
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 105, in decrypt_voucher
    voucher.decryptvoucher()
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 886, in decryptvoucher
    b = pkcs7unpad(b, 16)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 762, in pkcs7unpad
    _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key")
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 102, in _assert
    raise Exception(msg)
Exception: Incorrect padding - Wrong key
DeDRM v10.0.3: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
DeDRM v10.0.3: Looking for new default Kindle Key after 0.1 seconds
Found k4Mac kinf2018 file: /Users/davidversteeg/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018
trying username  b'davidversteeg'  on file  /Users/davidversteeg/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018
trying IDString: b'395622d70957'
Decrypted key file using IDString '395622d70957' and UserName 'davidversteeg'
DeDRM v10.0.3: Found 1 new key
Decrypting KFX-ZIP ebook: 2ho2m9ds
Got DSN key from database key_0
Found 1 keys to try after 0.5 seconds
Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.07ae4f78-b1b3-4c15-98d0-5c3104372a69.voucher
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 261, in GetDecryptedBook
    mb.processBook(totalpids)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 67, in processBook
    self.decrypt_voucher(totalpids)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 111, 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 "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 105, in decrypt_voucher
    voucher.decryptvoucher()
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 886, in decryptvoucher
    b = pkcs7unpad(b, 16)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 762, in pkcs7unpad
    _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key")
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 102, in _assert
    raise Exception(msg)
Exception: Incorrect padding - Wrong key
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 261, in GetDecryptedBook
    mb.processBook(totalpids)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 67, in processBook
    self.decrypt_voucher(totalpids)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 111, 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 "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 105, in decrypt_voucher
    voucher.decryptvoucher()
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 886, in decryptvoucher
    b = pkcs7unpad(b, 16)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 762, in pkcs7unpad
    _assert(paddinglen > 0 and paddinglen <= blocklen, "Incorrect padding - Wrong key")
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 102, in _assert
    raise Exception(msg)
Exception: Incorrect padding - Wrong key
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 261, in GetDecryptedBook
    mb.processBook(totalpids)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 67, in processBook
    self.decrypt_voucher(totalpids)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 111, 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.__init__", line 991, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,newkeys.items(),[],[],[],self.starttime)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 261, in GetDecryptedBook
    mb.processBook(totalpids)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 67, in processBook
    self.decrypt_voucher(totalpids)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 111, in decrypt_voucher
    raise Exception("Failed to decrypt KFX DRM voucher with any key")
Exception: Failed to decrypt KFX DRM voucher with any key
DeDRM v10.0.3: 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_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 261, in GetDecryptedBook
    mb.processBook(totalpids)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 67, in processBook
    self.decrypt_voucher(totalpids)
  File "/Users/davidversteeg/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 111, 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 178, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1056, in run
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
  File "calibre_plugins.dedrm.__init__", line 1007, in KindleMobiDecrypt
    raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.3: 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
Package KFX (from KFX Input) 1.50.0: Packaging /var/folders/zv/lh36bnbj42d_yk6whcgm0cc40000gn/C/calibre_6.9.0_tmp_zlvn_rj1/2ho2m9ds.kfx-zip
Processing container: B00AC05GBQ_EBOK.azw
Running file type plugin Package KFX (from KFX Input) failed with traceback:
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 178, 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 83, in convert_to_single_kfx
    self.decode_book()
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 210, in decode_book
    container = self.get_container(datafile)
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 317, 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 B00AC05GBQ_EBOK.azw has DRM and cannot be converted
KFX metadata reader (from KFX Input) activated for /var/folders/zv/lh36bnbj42d_yk6whcgm0cc40000gn/C/calibre_6.9.0_tmp_zlvn_rj1/umvywt2v_add_books/0/B00AC05GBQ_EBOK.kfx-zip
@ElleKayEm
Copy link

You'll need an earlier version of Kindle for Mac. See this post: https://www.mobileread.com/forums/showthread.php?t=283371
And this Mac specific info: https://www.mobileread.com/forums/showpost.php?p=3819708&postcount=508

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

2 participants