DRM Removal Tools for eBooks

Version 7.2.1 released on 11 April, 2021

Welcome to Apprentice Alf’s blog

This blog is intended to help anyone looking for free and simple software for removing DRM from their Kindle ebooks, stripping DRM from their Adobe Digital Editions ebooks, getting rid of DRM from their Barnes and Noble ebooks, freeing their Kobo ebooks of DRM, or decrypting their Fictionwise eReader ebooks.

If you want to find out more about ebooks, DRM and why you will probably want to remove the DRM from your ebooks, see this post:  Ebook Formats, DRM and You — A Guide for the Perplexed.

If you already know that you want to strip the DRM from your ebooks, you’ve found the right place.

The Tools

To get started on removing DRM from your ebooks, just download the tools archive from the link below. Unzip the archive, and start reading.

The latest release can be found at the top of this page:
https://github.com/apprenticeharper/DeDRM_tools/releases

Getting Help with the Tools

If you have any questions about the tools, ebooks, and DRM, check the FAQs at the GitHub repository:
https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md

If you have any problems with the current tools, please ask for help in a comment on this post or in the Discussions area of Apprentice Harper’s GitHub repository.  If you would like to report a bug, please open a new issue at the GitHub repository. If you are having a problem with an older version of the tools, please first update to the current version, and see if that solves your problem.

Before commenting here, please check the ReadMe file and the FAQs (see link above).

In any bug report or help request, please include:

  • which tool was used
  • which OS you are using
  • where the ebook file came from (device or application)
  • any error messages
  • a log of the DRM-removal attempt (see the FAQs on how to get a log).

Anti-Piracy Notice

Please only use these tools for gaining full access to your own ebooks for archiving/conversion/convenience. De-drmed ebooks should not be uploaded to open servers, torrents, or other methods of mass distribution. No help will be given to people doing such things. Authors, retailers and publishers all need to make a living, so that they can continue to produce books for us to read. Don’t be a parasite.

Origin of the Tools

The tools for removing DRM from ePubs were originally posted at i♥cabbages’ blog. The tools for Kindle/Mobipocket were originally posted at The Dark Reverser’s blog.

They have since been improved by many people, but mostly some_updates, DiapDealer, Apprentice Alf, and Apprentice Harper. While there are many sites that redistribute these tools, the most up-to-date versions of the tools are currently released here.

Other Sources

Anyone trying to sell you ebook DRM removal tools for Adobe Adept ePub and PDFs, Barnes & Noble ePubs, Kindle ebooks, Kobo ebooks, or eReader ebooks has probably just repackaged (an earlier) version of the tools available here.

7,287 thoughts on “DRM Removal Tools for eBooks

  1. So I set up latest version of calibre (5.11), the 7.0.3 plugin, and the latest of Kindle for PC, (1.30) and then realized I needed to revert to 1.17. However, when I do so it refuses to “connect to network”. Any pointers on getting around this? I am moving from one computer to another, but on the older (where all my dedrm stuff was set up and working sob, that version of kindle is now also claiming “can’t find network” and I am beginning to suspect amazon is trying to really really really really jack everyone off to the latest kindle for pc version. I have found links to discussions on how to find 1.17 etc but not on how to get it to register and connect back with Amazon. Anyone else with issues on getting older versions of Kindle for PC running all of a sudden? Any pointers for resolving this one? I realize this isn’t quite in Calibre’s wheelhouse, but I’m assuming others will be running into this problem as well.

    I have used Calibre for years and managed through about three OS updates on Ubuntu to keep the DeDRM plug working but am not sure what to try when the Kindle for PC won’t work. (The 1.30 version creates a folder per book and those files can’t be converted, I presume due to the kfx issue?)

    • I have seen people solve this by logging into the latest and then installing an older version over the new without uninstalling the newer one first. If you can get back to 1.26, those KFX files can be decrypted. If you can get back to 1.24, you can disable KFX downloads. Of course, if you can get back to 1.17, no KFX. See this post for details on avoiding or dealing with KFX, getting older versions, and preventing updates: https://www.mobileread.com/forums/showthread.php?t=283371

      There is a way to disable KFX downloads on even the current Kindle for PC, but it involves a registry edit. Not sure how that would work with Kindle for PC under Wine (or however you’re running it).

      • I got the e-mail announcing DeDRM Tools 7.1.0 Released, downloaded it, then upgraded my Calibre to 5.11.0, and told it to install the plug-in. I got the following error:

        calibre, version 5.11.0
        ERROR: Unhandled exception: InvalidPlugin:The plugin in ‘/Users/HBrazee/Downloads/DeDRM_tools_7.1.0.zip’ is invalid. It does not contain a top-level init.py file

        calibre 5.11 embedded-python: True is64bit: True
        macOS-10.15.7-x86_64-i386-64bit Darwin (’64bit’, ”)
        (‘Darwin’, ‘19.6.0’, ‘Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64’)
        Python 3.8.5
        OSX: (‘10.15.7’, (”, ”, ”), ‘x86_64’)
        Interface language: None
        Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 36, 0) && Package KFX (from KFX Input) (1, 36, 0) && Barnes & Noble (1, 2, 16) && KFX metadata reader (from KFX Input) (1, 36, 0) && KFX Input (1, 36, 0) && Set KFX metadata (from KFX Output) (1, 46, 0) && KFX Output (1, 46, 0) && Kobo Books (1, 8, 0) && Kobo Utilities (2, 11, 8) && KoboTouchExtended (3, 4, 1) && Obok DeDRM (6, 5, 4)
        Traceback (most recent call last):
        File “calibre/gui2/preferences/plugins.py”, line 316, in add_plugin
        File “calibre/customize/ui.py”, line 472, in add_plugin
        File “calibre/customize/ui.py”, line 61, in load_plugin
        File “calibre/customize/zipplugin.py”, line 284, in load
        File “calibre/customize/zipplugin.py”, line 379, in _locate_code
        calibre.customize.InvalidPlugin: The plugin in ‘/Users/HBrazee/Downloads/DeDRM_tools_7.1.0.zip’ is invalid. It does not contain a top-level init.py file

    • I’ve resurrected my old Kobo reader N647 (2011 version which is now no longer supported by Kobo (thanks Kobo!)). So there are about a 100 classics on them that are free (I got them with the OS on my reader) . I ran the 7.1.0 and on another computer I ran the 6.8 version with 4.23 Calibre and both failed to decrypt the files. I’ve run the debug for 3 of the books only but the results is the same for all of them using older version of Calibre..

      The debug log is as follows:

      calibre Debug log
      calibre 4.23 embedded-python: True is64bit: False
      Windows-10-10.0.19041-SP0 Windows (’32bit’, ‘WindowsPE’)
      (‘Windows’, ’10’, ‘10.0.19041’)
      Python 2.7.16+
      Windows: (’10’, ‘10.0.19041’, ‘SP0′, u’Multiprocessor Free’)
      Interface language: None
      Successfully initialized third party plugins: DeDRM (6, 8, 0) && Obok DeDRM (6, 7, 0)
      calibre 4.23 embedded-python: True is64bit: False
      Windows-10-10.0.19041-SP0 Windows (’32bit’, ‘WindowsPE’)
      (‘Windows’, ’10’, ‘10.0.19041’)
      Python 2.7.16+
      Windows: (’10’, ‘10.0.19041’, ‘SP0′, u’Multiprocessor Free’)
      Interface language: None
      Successfully initialized third party plugins: DeDRM (6, 8, 0) && Obok DeDRM (6, 7, 0)
      Turning on automatic hidpi scaling
      devicePixelRatio: 1.0
      logicalDpi: 96.0 x 96.0
      physicalDpi: 81.5518394649 x 81.6428571429
      Using calibre Qt style: True
      [0.00] Starting up…
      [0.00] Showing splash screen…
      [0.84] splash screen shown
      [0.84] Initializing db…
      [0.86] db initialized
      [0.86] Constructing main UI…
      DEBUG: 0.0 obok::utilities.py – loading translations
      DEBUG: 0.0 obok::dialogs.py – loading translations
      DEBUG: 0.0 obok::config.py – loading translations
      DEBUG: 0.0 obok::action_err.py – loading translations
      [2.84] main UI initialized…
      [2.84] Hiding splash screen
      Storage number map:
      {(7L, 0L): [(2L, ‘F’), (3L, ‘H’)],
      (7L, 1L): [(2L, ‘E’)],
      (7L, 2L): [(1L, ‘G’)],
      (7L, 3L): [(2L, ‘C’)],
      (7L, 4L): [(1L, ‘J’)],
      (7L, 5L): [(1L, ‘K’)]}
      Storage number for USBSTOR\DISK&VEN_KOBO&PROD_EREADER-1.9.12&REV_0110\00:24:23:31:C0:29&0: StorageDeviceNumber(type=7L, number=4L, partition_number=0L)
      Drive letters for USBDevice(vendor_id=0x2237 product_id=0x4162 bcd=0x110 devid=usb\vid_2237&pid_4162&rev_0110 devinst=14)
      {u’drive_letters’: [‘J’],
      u’pnp_id_map’: {‘J’: u’\\?\usbstor#disk&ven_kobo&prod_ereader-1.9.12&rev_0110#00:24:23:31:c0:29&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}’},
      u’readonly_drives’: set([]),
      u’sort_map’: {‘J’: (4L, 1L)}}
      Job: 0 Get device information started
      DeviceJob: 0 Get device information done, calling callback
      DeviceJob: 0 Get device information callback returned
      Job: 1 Set library information started
      DeviceJob: 1 Set library information done, calling callback
      DeviceJob: 1 Set library information callback returned
      Job: 2 Get list of books on device started
      DEBUG: 0.0 Version of driver: (2, 5, 1) Has kepubs: True
      DEBUG: 0.0 Version of firmware: (1, 9, 12) Has kepubs: True
      DEBUG: 0.3 Database Version: 162
      Job: 0 Get device information finished
      No details available.
      Job: 1 Set library information finished
      No details available.
      DeviceJob: 2 Get list of books on device done, calling callback
      DeviceJob: metadata_downloaded: Starting set_books_in_library
      DeviceJob: set_books_in_library: books to process= 272
      DeviceJob: set_books_in_library finished: time= 0.0230000019073
      DeviceJob: metadata_downloaded: updating views
      DeviceJob: metadata_downloaded: syncing
      DeviceJob: metadata_downloaded: refreshing ondevice
      DeviceJob: metadata_downloaded: sending metadata_available signal
      DeviceJob: 2 Get list of books on device callback returned
      Job: 2 Get list of books on device finished
      No details available.
      [43.94] splash screen hidden
      [43.94] Started up in 43.94 seconds with 0 books
      Running Obok DeDRM v6.7.0
      DEBUG: 45.1 get_device_settings – device_path= J:\
      Obok v3.2.4
      Copyright © 2012-2016 Physisticated et al.
      c:\users\dave\appdata\local\temp\tmpemvd66
      DEBUG: 45.2 got kobodir J:.kobo
      Found 40 possible keys to try.
      DEBUG: 54.6 BookListTableWidget:get_books – book_num: 0
      DEBUG: 54.6 BookListTableWidget:get_books – book: A Christmas Carol
      DEBUG: 54.6 BookListTableWidget:get_books – book_num: 1
      DEBUG: 54.6 BookListTableWidget:get_books – book: A Tale Of Two Cities
      DEBUG: 54.6 BookListTableWidget:get_books – book_num: 2
      DEBUG: 54.6 BookListTableWidget:get_books – book: Aesop’s Fables
      DEBUG: 54.6 InterfacePluginAction::launchObok – number of books to decrypt: 3
      Obok DeDRM v6.7.0 – Decrypting A Christmas Carol
      Trying key: a836199c4498abebdb6ca4e8542df2db
      Decryption failed, trying next key.
      Trying key: 25bd3992de789d84212d92f88c252bc0
      Decryption failed, trying next key.
      Trying key: 2ba890b7af980e4f16eaa28387a7b502
      Decryption failed, trying next key.
      Trying key: d725ad0fbcab795baf259ceb56f8e53a
      Decryption failed, trying next key.
      Trying key: 72399d5bfd027538d7fc883d7bb37949
      Decryption failed, trying next key.
      Trying key: 942cf96c16d9c59c9f59f72f6947cc4d
      Decryption failed, trying next key.
      Trying key: be62c6cd88d72e4b71bf64a57678f232
      Decryption failed, trying next key.
      Trying key: e7148b417297a8db6f989ad20f40750d
      Decryption failed, trying next key.
      Trying key: f42ab052f23f661283a419ce86ec1593
      Decryption failed, trying next key.
      Trying key: d77236339167f55317eb77f8e617332f
      Decryption failed, trying next key.
      Trying key: 767968550fece470f8ea21971aad576b
      Decryption failed, trying next key.
      Trying key: 5b7086211fd5138ad03f3ee1d81c9c51
      Decryption failed, trying next key.
      Trying key: 7e44a51823b7a810cc89785e0909a9f7
      Decryption failed, trying next key.
      Trying key: 9a79be9c0a2d3f4d5e90007a7871a029
      Decryption failed, trying next key.
      Trying key: 1fae412f525cf9984190b5d67fa0b3d6
      Decryption failed, trying next key.
      Trying key: ce96cd294ef43839be2fe81a322d6610
      Decryption failed, trying next key.
      Trying key: 64511e28ce7d0f935bc2cd5db453ca86
      Decryption failed, trying next key.
      Trying key: 81aaa19ef79c554728ffde7ce6c3e3e7
      Decryption failed, trying next key.
      Trying key: 670e39ff81657050d2ebc5717ac9fc37
      Decryption failed, trying next key.
      Trying key: 20445a7ba90e6aee9bd6f26d8bb0f096
      Decryption failed, trying next key.
      Trying key: ecec5923ffe66d1a3a02a7e1b4c0c81f
      Decryption failed, trying next key.
      Trying key: 48ff5f21e20c608423f8197d451ac209
      Decryption failed, trying next key.
      Trying key: dd89babaa9894f2e8194c0bc9cb95d0b
      Decryption failed, trying next key.
      Trying key: e767283f591cd4f4c0733311d0410e85
      Decryption failed, trying next key.
      Trying key: 43e205b889717575748473842a130547
      Decryption failed, trying next key.
      Trying key: 3118c3479bf592687b87dfa92f52a069
      Decryption failed, trying next key.
      Trying key: ba0c8bdcb0e3300eed591ad8b26d8856
      Decryption failed, trying next key.
      Trying key: 21d3ec41ef69be195a9e52436824b205
      Decryption failed, trying next key.
      Trying key: 3b2550d09fc47d4f85c18effc02fcdf0
      Decryption failed, trying next key.
      Trying key: 3a4c6b88c80493bebd75394513449415
      Decryption failed, trying next key.
      Trying key: c0edefbf5cd749ee32f091c51e92655d
      Decryption failed, trying next key.
      Trying key: 78abd22d980403b733dc4a1b569116b3
      Decryption failed, trying next key.
      Trying key: 531118a9f99276630748b542ea603242
      Decryption failed, trying next key.
      Trying key: dc999a6396a56bc0d34b7ee3fc780baf
      Decryption failed, trying next key.
      Trying key: 5a12b45ec530a85d69a01be277de68d2
      Decryption failed, trying next key.
      Trying key: 81b78ffc4f6eb68dff0bb1bfd1121f9c
      Decryption failed, trying next key.
      Trying key: b242e3c4045e67a559d3ca4100c5964f
      Decryption failed, trying next key.
      Trying key: 5fceb8aead22ecf75344ad0b86b381d6
      Decryption failed, trying next key.
      Trying key: b895f3aca85d255e0bed4c8d82ce5514
      Decryption failed, trying next key.
      Trying key: 843611bdcbf67b4ef004d4cb39d19e2c
      Decryption failed, trying next key.
      Obok DeDRM v6.7.0 – Couldn’t decrypt A Christmas Carol
      DEBUG: 55.4 DecryptAddProgressDialog::do_book_action – book decryption failed: ‘A Christmas Carol’
      Obok DeDRM v6.7.0 – Decrypting A Tale Of Two Cities
      Trying key: a836199c4498abebdb6ca4e8542df2db
      Decryption failed, trying next key.
      Trying key: 25bd3992de789d84212d92f88c252bc0
      Decryption failed, trying next key.
      Trying key: 2ba890b7af980e4f16eaa28387a7b502
      Decryption failed, trying next key.
      Trying key: d725ad0fbcab795baf259ceb56f8e53a
      Decryption failed, trying next key.
      Trying key: 72399d5bfd027538d7fc883d7bb37949
      Decryption failed, trying next key.
      Trying key: 942cf96c16d9c59c9f59f72f6947cc4d
      Decryption failed, trying next key.
      Trying key: be62c6cd88d72e4b71bf64a57678f232
      Decryption failed, trying next key.
      Trying key: e7148b417297a8db6f989ad20f40750d
      Decryption failed, trying next key.
      Trying key: f42ab052f23f661283a419ce86ec1593
      Decryption failed, trying next key.
      Trying key: d77236339167f55317eb77f8e617332f
      Decryption failed, trying next key.
      Trying key: 767968550fece470f8ea21971aad576b
      Decryption failed, trying next key.
      Trying key: 5b7086211fd5138ad03f3ee1d81c9c51
      Decryption failed, trying next key.
      Trying key: 7e44a51823b7a810cc89785e0909a9f7
      Decryption failed, trying next key.
      Trying key: 9a79be9c0a2d3f4d5e90007a7871a029
      Decryption failed, trying next key.
      Trying key: 1fae412f525cf9984190b5d67fa0b3d6
      Decryption failed, trying next key.
      Trying key: ce96cd294ef43839be2fe81a322d6610
      Decryption failed, trying next key.
      Trying key: 64511e28ce7d0f935bc2cd5db453ca86
      Decryption failed, trying next key.
      Trying key: 81aaa19ef79c554728ffde7ce6c3e3e7
      Decryption failed, trying next key.
      Trying key: 670e39ff81657050d2ebc5717ac9fc37
      Decryption failed, trying next key.
      Trying key: 20445a7ba90e6aee9bd6f26d8bb0f096
      Decryption failed, trying next key.
      Trying key: ecec5923ffe66d1a3a02a7e1b4c0c81f
      Decryption failed, trying next key.
      Trying key: 48ff5f21e20c608423f8197d451ac209
      Decryption failed, trying next key.
      Trying key: dd89babaa9894f2e8194c0bc9cb95d0b
      Decryption failed, trying next key.
      Trying key: e767283f591cd4f4c0733311d0410e85
      Decryption failed, trying next key.
      Trying key: 43e205b889717575748473842a130547
      Decryption failed, trying next key.
      Trying key: 3118c3479bf592687b87dfa92f52a069
      Decryption failed, trying next key.
      Trying key: ba0c8bdcb0e3300eed591ad8b26d8856
      Decryption failed, trying next key.
      Trying key: 21d3ec41ef69be195a9e52436824b205
      Decryption failed, trying next key.
      Trying key: 3b2550d09fc47d4f85c18effc02fcdf0
      Decryption failed, trying next key.
      Trying key: 3a4c6b88c80493bebd75394513449415
      Decryption failed, trying next key.
      Trying key: c0edefbf5cd749ee32f091c51e92655d
      Decryption failed, trying next key.
      Trying key: 78abd22d980403b733dc4a1b569116b3
      Decryption failed, trying next key.
      Trying key: 531118a9f99276630748b542ea603242
      Decryption failed, trying next key.
      Trying key: dc999a6396a56bc0d34b7ee3fc780baf
      Decryption failed, trying next key.
      Trying key: 5a12b45ec530a85d69a01be277de68d2
      Decryption failed, trying next key.
      Trying key: 81b78ffc4f6eb68dff0bb1bfd1121f9c
      Decryption failed, trying next key.
      Trying key: b242e3c4045e67a559d3ca4100c5964f
      Decryption failed, trying next key.
      Trying key: 5fceb8aead22ecf75344ad0b86b381d6
      Decryption failed, trying next key.
      Trying key: b895f3aca85d255e0bed4c8d82ce5514
      Decryption failed, trying next key.
      Trying key: 843611bdcbf67b4ef004d4cb39d19e2c
      Decryption failed, trying next key.
      Obok DeDRM v6.7.0 – Couldn’t decrypt A Tale Of Two Cities
      DEBUG: 56.1 DecryptAddProgressDialog::do_book_action – book decryption failed: ‘A Tale Of Two Cities’
      Obok DeDRM v6.7.0 – Decrypting Aesop’s Fables
      Trying key: a836199c4498abebdb6ca4e8542df2db
      Decryption failed, trying next key.
      Trying key: 25bd3992de789d84212d92f88c252bc0
      Decryption failed, trying next key.
      Trying key: 2ba890b7af980e4f16eaa28387a7b502
      Decryption failed, trying next key.
      Trying key: d725ad0fbcab795baf259ceb56f8e53a
      Decryption failed, trying next key.
      Trying key: 72399d5bfd027538d7fc883d7bb37949
      Decryption failed, trying next key.
      Trying key: 942cf96c16d9c59c9f59f72f6947cc4d
      Decryption failed, trying next key.
      Trying key: be62c6cd88d72e4b71bf64a57678f232
      Decryption failed, trying next key.
      Trying key: e7148b417297a8db6f989ad20f40750d
      Decryption failed, trying next key.
      Trying key: f42ab052f23f661283a419ce86ec1593
      Decryption failed, trying next key.
      Trying key: d77236339167f55317eb77f8e617332f
      Decryption failed, trying next key.
      Trying key: 767968550fece470f8ea21971aad576b
      Decryption failed, trying next key.
      Trying key: 5b7086211fd5138ad03f3ee1d81c9c51
      Decryption failed, trying next key.
      Trying key: 7e44a51823b7a810cc89785e0909a9f7
      Decryption failed, trying next key.
      Trying key: 9a79be9c0a2d3f4d5e90007a7871a029
      Decryption failed, trying next key.
      Trying key: 1fae412f525cf9984190b5d67fa0b3d6
      Decryption failed, trying next key.
      Trying key: ce96cd294ef43839be2fe81a322d6610
      Decryption failed, trying next key.
      Trying key: 64511e28ce7d0f935bc2cd5db453ca86
      Decryption failed, trying next key.
      Trying key: 81aaa19ef79c554728ffde7ce6c3e3e7
      Decryption failed, trying next key.
      Trying key: 670e39ff81657050d2ebc5717ac9fc37
      Decryption failed, trying next key.
      Trying key: 20445a7ba90e6aee9bd6f26d8bb0f096
      Decryption failed, trying next key.
      Trying key: ecec5923ffe66d1a3a02a7e1b4c0c81f
      Decryption failed, trying next key.
      Trying key: 48ff5f21e20c608423f8197d451ac209
      Decryption failed, trying next key.
      Trying key: dd89babaa9894f2e8194c0bc9cb95d0b
      Decryption failed, trying next key.
      Trying key: e767283f591cd4f4c0733311d0410e85
      Decryption failed, trying next key.
      Trying key: 43e205b889717575748473842a130547
      Decryption failed, trying next key.
      Trying key: 3118c3479bf592687b87dfa92f52a069
      Decryption failed, trying next key.
      Trying key: ba0c8bdcb0e3300eed591ad8b26d8856
      Decryption failed, trying next key.
      Trying key: 21d3ec41ef69be195a9e52436824b205
      Decryption failed, trying next key.
      Trying key: 3b2550d09fc47d4f85c18effc02fcdf0
      Decryption failed, trying next key.
      Trying key: 3a4c6b88c80493bebd75394513449415
      Decryption failed, trying next key.
      Trying key: c0edefbf5cd749ee32f091c51e92655d
      Decryption failed, trying next key.
      Trying key: 78abd22d980403b733dc4a1b569116b3
      Decryption failed, trying next key.
      Trying key: 531118a9f99276630748b542ea603242
      Decryption failed, trying next key.
      Trying key: dc999a6396a56bc0d34b7ee3fc780baf
      Decryption failed, trying next key.
      Trying key: 5a12b45ec530a85d69a01be277de68d2
      Decryption failed, trying next key.
      Trying key: 81b78ffc4f6eb68dff0bb1bfd1121f9c
      Decryption failed, trying next key.
      Trying key: b242e3c4045e67a559d3ca4100c5964f
      Decryption failed, trying next key.
      Trying key: 5fceb8aead22ecf75344ad0b86b381d6
      Decryption failed, trying next key.
      Trying key: b895f3aca85d255e0bed4c8d82ce5514
      Decryption failed, trying next key.
      Trying key: 843611bdcbf67b4ef004d4cb39d19e2c
      Decryption failed, trying next key.
      Obok DeDRM v6.7.0 – Couldn’t decrypt Aesop’s Fables
      DEBUG: 56.9 DecryptAddProgressDialog::do_book_action – book decryption failed: ‘Aesop’s Fables’
      Obok DeDRM v6.7.0 – wrapping up results.

      I’ve entered my serial number for my reader in the OBOK plugin and it still doesn’t work.

      Can someone please let me know what I can possibly doing wrong here? Are my kepub’s from 2011 to old that the decryption are not known? Would appreciate any assistance here.

      • The 100 included ebooks in the original Kobo and Kobo WiFi ereaders are not stored as book files. They are in the SQLite database. In theory, you could extract them from the database but it is probably less work to download them from Gutenberg, Standard eBooks, etc.

  2. I’ve used Calibre in the past with dedrm, but am having an issue this time around with a fresh install. I’ve followed the guide, but am stumped with it the DRM isn’t being stripped. Details and log below:

    which tool was used: Calibre 3.48, DeDRM 6.8
    which OS you are using: Mac
    where the ebook file came from (device or application), Application — Loaded azw3 file from local machine into calibre library
    any error messages
    a log of the DRM-removal attempt (see the FAQs on how to get a log).

    Log:
    calibre Debug log
    calibre 3.48 embedded-python: True is64bit: True
    Darwin-16.7.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘16.7.0’, ‘Darwin Kernel Version 16.7.0: Sun Jun 2 20:26:31 PDT 2019; root:xnu-3789.73.50~1/RELEASE_X86_64’)
    Python 2.7.15
    OSX: (‘10.12.6’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (6, 8, 0)
    calibre 3.48 embedded-python: True is64bit: True
    Darwin-16.7.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘16.7.0’, ‘Darwin Kernel Version 16.7.0: Sun Jun 2 20:26:31 PDT 2019; root:xnu-3789.73.50~1/RELEASE_X86_64’)
    Python 2.7.15
    OSX: (‘10.12.6’, (”, ”, ”), ‘x86_64’)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (6, 8, 0)
    devicePixelRatio: 1.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 126.000001892 x 127.000001907
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.04] Showing splash screen…
    [0.25] splash screen shown
    [0.25] Initializing db…
    [0.26] db initialized
    [0.26] Constructing main UI…
    [2.19] main UI initialized…
    [2.19] Hiding splash screen
    [2.19] splash screen hidden
    [2.20] Started up in 2.20 seconds with 1 books
    DeDRM v6.8.0: Trying to decrypt Great Demo!_ How To Create And Execute Stunning Software Demonstrations.azw3
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.42.
    Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Great Demo!: How To Create And Execute Stunning Software Demonstrations
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.8.0: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.8.0: Looking for new default Kindle Key after 0.1 seconds
    No k4Mac kindle-info/rainier/kinf2011 files have been found.
    DeDRM v6.8.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
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 625, in run
    File “calibre_plugins.dedrm.init“, line 575, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.8.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

    {u’bsd_drives’: {u’main’: u’/dev/disk2s1′},
    u’drives’: {u’main’: ‘/Volumes/Kindle’},
    u’mount_map’: {‘/Volumes/calibre-5.11.0/calibre.app’: ‘/private/var/folders/j4/w0srd4611lb6l21ls9nx2xq00000gn/T/AppTranslocation/0CCFE415-4D77-4E26-B00C-7CAFA68F038E’,
    ‘/dev/disk0s4’: ‘/Volumes/BOOTCAMP’,
    ‘/dev/disk1’: ‘/’,
    ‘/dev/disk2s1’: ‘/Volumes/Kindle’,
    ‘/dev/disk4s1’: ‘/Volumes/calibre-5.11.0’,
    ‘devfs’: ‘/dev’,
    ‘map -hosts’: ‘/net’,
    ‘map auto_home’: ‘/home’}}
    Job: 0 Get device information started
    DeviceJob: 0 Get device information done, calling callback
    DeviceJob: 0 Get device information callback returned
    Job: 1 Set library information started
    DeviceJob: 1 Set library information done, calling callback
    DeviceJob: 1 Set library information callback returned
    Job: 2 Get list of books on device started
    DEBUG: 0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= None
    DEBUG: 0.0 USBMS: dirs are: /Volumes/Kindle/ documents
    DEBUG: 0.0 USBMS: scan from root False /Volumes/Kindle/documents
    DEBUG: 0.1 USBMS: count found in cache: 33, count of files in metadata: 33, need_sync: False
    DEBUG: 0.1 USBMS: Finished fetching list of books from device. oncard= None
    DEBUG: 0.1 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= carda
    DEBUG: 0.1 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= cardb
    DeviceJob: 2 Get list of books on device done, calling callback
    DeviceJob: metadata_downloaded: Starting set_books_in_library
    DeviceJob: set_books_in_library: books to process= 33
    DeviceJob: set_books_in_library finished: time= 0.00574994087219
    DeviceJob: metadata_downloaded: updating views
    DeviceJob: metadata_downloaded: syncing
    DeviceJob: metadata_downloaded: refreshing ondevice
    DeviceJob: metadata_downloaded: sending metadata_available signal
    DeviceJob: 2 Get list of books on device callback returned
    Job: 0 Get device information finished
    No details available.
    Job: 1 Set library information finished
    No details available.
    Job: 2 Get list of books on device finished
    No details available.
    Added Great Demo!: How To Create And Execute Stunning Software Demonstrations to db in: 0.0
    Added 1 books in 0.9 seconds

  3. I use an older computer for storing all my books since my laptop hard drive is tiny. My calibre computer is running on Mac OS 10.11.6 so I can’t update Calibre past version 3.48. Where can I get a version of dedrm for an older version of calibre? Thanks

  4. Awesome tools! Can I make a humble request to continue Tetrachroma’s work on v8.4.51’s fileopen plugin to update it to handle the new encryption? Such an amazing tool that I have used countless times over the years. I’ll buy you a coffee! 😉

  5. I see since quite some time in many EPUB files a “bad zipfile” error when running ineptepub.py. Full message:

    zipfile.BadZipFile: File name in directory ‘OEBPS/cha7{Q\x04ÿ╜3\x00√\x7f\r\x10′ and header b’OEBPS/chapter055.html’ differ.

    It goes away when I manually correct the filename in the EPUB file. Probably something the DRM guys do on purpose in order to break the tool?

  6. I’m trying to get the plugin installed and I think all I need to do is put the key from Kindle for PC in. Running 1.17.
    I think I just have to run kindlekey.py to do that and I think I need python 2 not 3. But all I get is ImportError: No module named winreg.
    What am I not understanding?

    • To clarify, everything is installed and I just need my kindle key. But I can’t seem to create the k4i file to import it or find it anywhere in the kindle for pc app.

    • Are we talking about a Linux setup here? Yes, run kindlekey.py where you have Kindle for PC. Alternatively, you could temporarily install Windows calibre with DeDRM there, get the key, and import it to Linux calibre. Then you won’t have worry about getting the right combo of Python, PyCrypto, or whatever else to try to run kindlekey.py on its own.

  7. Hello,

    I am using a Big sur 11.2.1
    the books were bought on Amazon, I’m just trying to get a pdf version to print them

    calibre Debug log
    calibre 4.23 embedded-python: True is64bit: True
    Darwin-20.3.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘20.3.0’, ‘Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64’)
    Python 2.7.16
    OSX: (‘10.16’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (6, 8, 0) && Obok DeDRM (6, 7, 0)
    calibre 4.23 embedded-python: True is64bit: True
    Darwin-20.3.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘20.3.0’, ‘Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64’)
    Python 2.7.16
    OSX: (‘10.16’, (”, ”, ”), ‘x86_64’)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (6, 8, 0) && Obok DeDRM (6, 7, 0)
    devicePixelRatio: 2.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 113.500001705 x 113.500001705
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.03] Showing splash screen…
    [0.37] splash screen shown
    [0.37] Initializing db…
    [0.38] db initialized
    [0.38] Constructing main UI…
    DEBUG: 0.0 obok::utilities.py – loading translations
    DEBUG: 0.0 obok::dialogs.py – loading translations
    DEBUG: 0.0 obok::config.py – loading translations
    DEBUG: 0.0 obok::action_err.py – loading translations
    [1.31] main UI initialized…
    [1.31] Hiding splash screen
    qt.qpa.window: Window position QRect(-59,366 732×120) outside any known screen, using primary screen
    [8.70] splash screen hidden
    [8.70] Started up in 8.70 seconds with 1 books
    DeDRM v6.8.0: Trying to decrypt B00IMGZQBM_EBOK.azw
    Using Library AlfCrypto Python
    MobiDeDrm v0.42.
    Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Le travail de l’enseignant: Une approche par la didactique professionnelle (Le point sur… Pédagogie) (French Edition)
    Got SerialNumber from database default_key
    Got UsernameHash from database default_key
    Found 4 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.8.0: Failed to decrypt with error: No key found in 4 keys tried.
    DeDRM v6.8.0: Looking for new default Kindle Key after 0.1 seconds
    Found k4Mac kinf2018 file: /Users/SaraZ/Library/Application Support/Kindle/storage/.kinf2018
    DeDRM v6.8.0: Trying to decrypt B01N32Q9H8_EBOK.azw
    Using Library AlfCrypto Python
    MobiDeDrm v0.42.
    Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: L’éducation interculturelle (Que sais-je ?) (French Edition)
    Got SerialNumber from database default_key
    Got UsernameHash from database default_key
    Found 4 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.8.0: Failed to decrypt with error: No key found in 4 keys tried.
    DeDRM v6.8.0: Looking for new default Kindle Key after 0.1 seconds
    Found k4Mac kinf2018 file: /Users/SaraZ/Library/Application Support/Kindle/storage/.kinf2018
    Couldn’t decrypt file.
    DeDRM v6.8.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
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 625, in run
    File “calibre_plugins.dedrm.init“, line 575, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.8.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
    DeDRM v6.8.0: Trying to decrypt B072FSXNDR_EBOK.azw
    Using Library AlfCrypto Python
    Couldn’t decrypt file.
    DeDRM v6.8.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
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 625, in run
    File “calibre_plugins.dedrm.init“, line 575, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.8.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
    MobiDeDrm v0.42.
    Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: 27 applications pour formateurs et enseignants (French Edition)
    Got SerialNumber from database default_key
    Got UsernameHash from database default_key
    Found 4 keys to try after 0.1 seconds
    Crypto Type is: 0
    This book is not encrypted.
    Decryption succeeded after 0.1 seconds
    DeDRM v6.8.0: Finished after 0.1 seconds
    DeDRM v6.8.0: Trying to decrypt B0787KJ94S_EBOK.azw
    MobiDeDrm v0.42.
    Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Développer la pratique réflexive (Pédagogies) (French Edition)
    Got SerialNumber from database default_key
    Got UsernameHash from database default_key
    Found 4 keys to try after 0.0 seconds
    Crypto Type is: 2
    DeDRM v6.8.0: Failed to decrypt with error: No key found in 4 keys tried.
    DeDRM v6.8.0: Looking for new default Kindle Key after 0.0 seconds
    Found k4Mac kinf2018 file: /Users/SaraZ/Library/Application Support/Kindle/storage/.kinf2018
    Couldn’t decrypt file.
    DeDRM v6.8.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
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 625, in run
    File “calibre_plugins.dedrm.init“, line 575, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.8.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
    Added Le travail de l’enseignant: Une approche par la didactique professionnelle (Le point sur… Pédagogie) (French Edition) to db in: 0.1
    Added L’éducation interculturelle (Que sais-je ?) (French Edition) to db in: 0.1
    Added Développer la pratique réflexive (Pédagogies) (French Edition) to db in: 0.0
    Added 27 applications pour formateurs et enseignants (French Edition) to db in: 0.1
    Added 4 books in 1.4 seconds

  8. Can someone please tell me what I’m doing wrong or not doing… I thought no key needed to be entered if the reader was Kindle for Windows? In the debug the book used is a sample sent from amazon to Kindle for Windows but no other files I have tried work either.

    calibre Debug log
    calibre 5.12 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.19041 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: en_GB
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 36, 0) && DeDRM (7, 1, 0) && Package KFX (from KFX Input) (1, 36, 0) && KFX metadata reader (from KFX Input) (1, 36, 0) && KFX Input (1, 36, 0) && Set KFX metadata (from KFX Output) (1, 49, 0) && KFX Output (1, 49, 0)
    calibre 5.12 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.19041 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: en_GB
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 36, 0) && DeDRM (7, 1, 0) && Package KFX (from KFX Input) (1, 36, 0) && KFX metadata reader (from KFX Input) (1, 36, 0) && KFX Input (1, 36, 0) && Set KFX metadata (from KFX Output) (1, 49, 0) && KFX Output (1, 49, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 2.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 129.8044164037855 x 130.00947867298575
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.50] splash screen shown
    [0.50] Initializing db…
    [0.50] db initialized
    [0.50] Constructing main UI…
    [0.94] main UI initialized…
    [0.94] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.36.0: Importing C:\Users\pauln\Documents\My Kindle Content\B006GH4D54_EBSP\B006GH4D54_EBSP.azw
    Gather KFX-ZIP (from KFX Input): Gathered 2 file(s) as C:\Users\pauln\AppData\Local\Temp\calibre_44izg1vd\rr2t091i.kfx-zip
    DeDRM v7.1.0: Trying to decrypt rr2t091i.kfx-zip
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: rr2t091i
    Found 0 keys to try after 0.0 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.537a0fa8-b67e-41b6-bbb4-47b11e7732df.voucher
    DeDRM v7.1.0: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v7.1.0: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\pauln\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\pauln\AppData\Local\Amazon\Kindle\storage.kinf2018
    [9.44] splash screen hidden
    [9.44] Started up in 9.44 seconds with 0 books
    Decrypted key file using IDString ‘2757339213’ and UserName ‘pauln’
    DeDRM v7.1.0: Found 1 new key
    Decrypting KFX-ZIP ebook: rr2t091i
    Got DSN key from database default_key_1
    Found 1 keys to try after 2.6 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.537a0fa8-b67e-41b6-bbb4-47b11e7732df.voucher
    DeDRM v7.1.0: Ultimately failed to decrypt after 2.6 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\pauln\AppData\Local\Temp\calibre_44izg1vd\rr2t091i.kfx-zip
    Processing container: B006GH4D54_EBSP.azw
    KFX metadata reader (from KFX Input) activated for C:\Users\pauln\AppData\Local\Temp\calibre_44izg1vd\0qw8tgz7_add_books\0\B006GH4D54_EBSP.kfx-zip
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 538, 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

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 631, in run
    File “calibre_plugins.dedrm.init“, line 581, in KindleMobiDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.1.0: Ultimately failed to decrypt after 2.6 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 172, in _run_filetype_plugins
    File “calibre_plugins.kfx_input.package_filetype”, line 21, in run
    File “calibre_plugins.kfx_input.package_filetype”, line 32, in run_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 83, in convert_to_single_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 208, in decode_book
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 315, in get_container
    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container B006GH4D54_EBSP.azw has DRM and cannot be converted
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 428, in get_file_type_metadata
    File “calibre_plugins.kfx_input.metadata_reader”, line 28, in get_metadata
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 148, in get_metadata
    Exception: Failed to locate a KFX container with metadata
    Added B006GH4D54 EBSP to db in: 0.2
    Added 1 books in 3.2 seconds
    Worker Launch took: 0.01 seconds
    Job: 0 Convert book 1 of 1 (B006GH4D54 EBSP) finished
    Convert book 1 of 1 (B006GH4D54 EBSP)

    DeDRM v7.1.0: Trying to decrypt z3ob49zr.kfx-zip
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: z3ob49zr
    Found 0 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.537a0fa8-b67e-41b6-bbb4-47b11e7732df.voucher
    DeDRM v7.1.0: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v7.1.0: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\pauln\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\pauln\AppData\Local\Amazon\Kindle\storage\.kinf2018
    Decrypted key file using IDString '2757339213' and UserName 'pauln'
    DeDRM v7.1.0: Found 1 new key
    Decrypting KFX-ZIP ebook: z3ob49zr
    Got DSN key from database default_key_1
    Found 1 keys to try after 2.4 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.537a0fa8-b67e-41b6-bbb4-47b11e7732df.voucher
    DeDRM v7.1.0: Ultimately failed to decrypt after 2.4 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Conversion options changed from defaults:
    
      verbose: 2
    
      read_metadata_from_opf: 'C:\\Users\\pauln\\AppData\\Local\\Temp\\calibre_44izg1vd\\axlw0k4b.opf'
    
      output_profile: 'generic_eink'
    
    Resolved conversion options
    
    calibre version: 5.12.0
    
    {'allow_conversion_with_errors': False,
    
     'asciiize': False,
    
     'author_sort': None,
    
     'authors': None,
    
     'base_font_size': 0.0,
    
     'book_producer': None,
    
     'change_justification': 'original',
    
     'chapter': "//*[((name()='h1' or name()='h2') and re:test(., "
    
                "'\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', "
    
                "'i')) or @class = 'chapter']",
    
     'chapter_mark': 'pagebreak',
    
     'comments': None,
    
     'cover': None,
    
     'debug_pipeline': None,
    
     'dehyphenate': True,
    
     'delete_blank_paragraphs': True,
    
     'disable_font_rescaling': False,
    
     'dont_split_on_page_breaks': False,
    
     'duplicate_links_in_toc': False,
    
     'embed_all_fonts': False,
    
     'embed_font_family': None,
    
     'enable_heuristics': False,
    
     'epub_flatten': False,
    
     'epub_inline_toc': False,
    
     'epub_toc_at_end': False,
    
     'epub_version': '2',
    
     'expand_css': False,
    
     'extra_css': None,
    
     'extract_to': None,
    
     'filter_css': '',
    
     'fix_indents': True,
    
     'flow_size': 260,
    
     'font_size_mapping': None,
    
     'format_scene_breaks': True,
    
     'html_unwrap_factor': 0.4,
    
     'input_encoding': None,
    
     'input_profile': <calibre.customize.profiles.InputProfile object at 0x0000020EDCF6D640>,
    
     'insert_blank_line': False,
    
     'insert_blank_line_size': 0.5,
    
     'insert_metadata': False,
    
     'isbn': None,
    
     'italicize_common_cases': True,
    
     'keep_ligatures': False,
    
     'language': None,
    
     'level1_toc': None,
    
     'level2_toc': None,
    
     'level3_toc': None,
    
     'line_height': 0.0,
    
     'linearize_tables': False,
    
     'margin_bottom': 5.0,
    
     'margin_left': 5.0,
    
     'margin_right': 5.0,
    
     'margin_top': 5.0,
    
     'markup_chapter_headings': True,
    
     'max_toc_links': 50,
    
     'minimum_line_height': 120.0,
    
     'no_chapters_in_toc': False,
    
     'no_default_epub_cover': False,
    
     'no_inline_navbars': False,
    
     'no_svg_cover': False,
    
     'output_profile': <calibre.customize.profiles.GenericEink object at 0x0000020EDCF6D910>,
    
     'page_breaks_before': '/',
    
     'prefer_metadata_cover': False,
    
     'preserve_cover_aspect_ratio': False,
    
     'pretty_print': True,
    
     'pubdate': None,
    
     'publisher': None,
    
     'rating': None,
    
     'read_metadata_from_opf': 'C:\\Users\\pauln\\AppData\\Local\\Temp\\calibre_44izg1vd\\axlw0k4b.opf',
    
     'remove_fake_margins': True,
    
     'remove_first_image': False,
    
     'remove_paragraph_spacing': False,
    
     'remove_paragraph_spacing_indent_size': 1.5,
    
     'renumber_headings': True,
    
     'replace_scene_breaks': '',
    
     'search_replace': '[]',
    
     'series': None,
    
     'series_index': None,
    
     'smarten_punctuation': False,
    
     'sr1_replace': None,
    
     'sr1_search': None,
    
     'sr2_replace': None,
    
     'sr2_search': None,
    
     'sr3_replace': None,
    
     'sr3_search': None,
    
     'start_reading_at': None,
    
     'subset_embedded_fonts': False,
    
     'tags': None,
    
     'timestamp': None,
    
     'title': None,
    
     'title_sort': None,
    
     'toc_filter': None,
    
     'toc_threshold': 6,
    
     'toc_title': None,
    
     'transform_css_rules': '[]',
    
     'unsmarten_punctuation': False,
    
     'unwrap_lines': True,
    
     'use_auto_toc': False,
    
     'verbose': 2}
    
    Running file type plugin DeDRM failed with traceback:
    
    Traceback (most recent call last):
    
      File "calibre_plugins.dedrm.__init__", line 538, 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
    
    
    
    During handling of the above exception, another exception occurred:
    
    
    
    Traceback (most recent call last):
    
      File "calibre\customize\ui.py", line 172, in _run_filetype_plugins
    
      File "calibre_plugins.dedrm.__init__", line 631, in run
    
      File "calibre_plugins.dedrm.__init__", line 581, in KindleMobiDecrypt
    
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.1.0: Ultimately failed to decrypt after 2.4 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    
    DeDRM v7.1.0: Trying to decrypt z3ob49zr.kfx-zip
    Decrypting KFX-ZIP ebook: z3ob49zr
    Found 0 keys to try after 0.0 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.537a0fa8-b67e-41b6-bbb4-47b11e7732df.voucher
    DeDRM v7.1.0: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v7.1.0: Looking for new default Kindle Key after 0.0 seconds
    searching for kinfoFiles in C:\Users\pauln\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\pauln\AppData\Local\Amazon\Kindle\storage\.kinf2018
    Decrypted key file using IDString '2757339213' and UserName 'pauln'
    DeDRM v7.1.0: Found 1 new key
    Decrypting KFX-ZIP ebook: z3ob49zr
    Got DSN key from database default_key_1
    Found 1 keys to try after 2.3 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.537a0fa8-b67e-41b6-bbb4-47b11e7732df.voucher
    DeDRM v7.1.0: Ultimately failed to decrypt after 2.3 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/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 538, 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
    
    
    
    During handling of the above exception, another exception occurred:
    
    
    
    Traceback (most recent call last):
    
      File "calibre\customize\ui.py", line 172, in _run_filetype_plugins
    
      File "calibre_plugins.dedrm.__init__", line 631, in run
    
      File "calibre_plugins.dedrm.__init__", line 581, in KindleMobiDecrypt
    
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.1.0: Ultimately failed to decrypt after 2.3 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    
    InputFormatPlugin: KFX Input running
    
    on C:\Users\pauln\AppData\Local\Temp\calibre_44izg1vd\z3ob49zr.kfx-zip
    
    Software versions: KFX Input 1.36.0, calibre 5.12 [64bit], Windows-10-10.0.19041
    
    KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290
    
    Converting C:\Users\pauln\AppData\Local\Temp\calibre_44izg1vd\z3ob49zr.kfx-zip
    
    Processing container: B006GH4D54_EBSP.azw
    
    Traceback (most recent call last):
    
      File "calibre_plugins.kfx_input.__init__", line 105, in convert
    
      File "calibre_plugins.kfx_input.kfxlib.yj_book", line 208, in decode_book
    
      File "calibre_plugins.kfx_input.kfxlib.yj_book", line 315, in get_container
    
    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container B006GH4D54_EBSP.azw has DRM and cannot be converted
    
    
    
    During handling of the above exception, another exception occurred:
    
    
    
    Traceback (most recent call last):
    
      File "runpy.py", line 194, in _run_module_as_main
    
      File "runpy.py", line 87, in _run_code
    
      File "site.py", line 82, in <module>
    
      File "site.py", line 77, in main
    
      File "site.py", line 49, in run_entry_point
    
      File "calibre\utils\ipc\worker.py", line 216, in main
    
      File "calibre\gui2\convert\gui_conversion.py", line 41, in gui_convert_override
    
      File "calibre\gui2\convert\gui_conversion.py", line 28, in gui_convert
    
      File "calibre\ebooks\conversion\plumber.py", line 1108, in run
    
      File "calibre\customize\conversion.py", line 245, in __call__
    
      File "calibre_plugins.kfx_input.__init__", line 123, in convert
    
    calibre.ebooks.DRMError: This
    

    ook has DRM!

  9. Hi

    I have two problems .

    I am trying to remove the DRM from some Kindle books I downloaded from the Kindle-Amazon Cloud..

    I have done this many times in the past with no problem.
    Previously, I had to enter the a 15 digits book code starting with B…. and it worked.
    I now use Calibre’s most recent version 5.
    The De DRM plugin is installed and everything seems to run fine until the very last step, when I have to enter the Kindle Book serial number. I thought this s/n would be the BOOK id, as I have done many times previously.
    In this case, I entered the BO8R447F3P_ebok sequence as it appears in the My Kindle folder for the book downloaded from the Kindle Cloud. This number has an AZW fike ending. It didn’t go through. I keep getting a message saying tha I need a 16 digits Eink Kindle s/n . Where is it? I tried three times. Same story.
    I do not have a Kindle e-book reader tablet, because I use the PC ( Windows 10) with Calibre or Foxreader

    I am trying to convert an epub book to PDF with Calibre, but the conversion fails after 10 minutes at 70%. Again, I have already done this in the past with the older Calibre, with no problems.
    Can you please help me?

    Thanks

    Ittiandro

    • When you download a book from Amazon’s website, you need to choose an E-ink Kindle (not a Fire) for the device and enter that Kindle’s serial number into DeDRM’s customization. If you do not have an E-ink Kindle on your Account, you can use Kindle for PC/Mac. The key will be picked up automatically as long as Kindle for PC/Mac is on the same machine and user as calibre with DeDRM. See this post for details on getting books you can decrypt from Amazon: https://www.mobileread.com/forums/showthread.php?t=283371

      • Thanks Laura
        I am still not out of the woods.

        Further to my previous post, when trying to DeDrm the book I am still stuck on the 16 digits e-ink s/n. Where do I get it?
        Elsewhere, Apprentice Alf suggested I can get around it by going to the Amazon site, Manage your Your Content and devices and copying and pasting the book info into the Calibre S/n box. I can see my books listed, with the Title, Author and Date, but there is no s/n . I tried to select/copy/ paste the entire line, but when I try to paste it in to the s/n box in Calibre it wont work.
        I thought I could use the AZW file, but, again, no land in sight.
        I never had this problem before because all I needed was the 15 digits book I.D. from the downloads folder.

        Any help? By the way, the 64-bits Calibre you suggested won’t install.I thought it wouldn’t, but I tried, just in case.

        Thanks

        Ittiandro

      • Thanks Laura
        I was finally able to DeDrm MOST OF THE books with the older Kindle for Pc/Mac v. 1.17. I still have problems, though, with a couple of books downloaded from Amazon Kindle, but this time with with a AZW3 ending. Usually there is a book of the Kindle type. Not in this case. How can I DeDrm the AZW3 files to convert them to PDF, which is my main purpose?

        Thanks

        Franco

          • THanks, I solved the problem. For some reasons, there was, indeed, a Kindle book file in the “My Caliber Content” folder , but when I imported it into Caliber, it showed as an AZW3 file . It would open in Caliber only in EDit mode and I couldn’t really read it. However the DRM must have been somehow removed because I was able to convert it into PDF.

            Thanks again
            Franco

            • What you describe is as I remember the setting for the viewer what filetypes to open, for some reason the default is AZW(3) not to open in the viewer, just set it to open and that should work in the future.
              Settings – Behavior – (right column) Use internal viewer for:
              (x) AZW
              (x) AZW3
              (x) AZW4
              (x) AZW8

              This is the way I have set it after a clean install.

  10. I’m using Calibre version 5.7.2 and downloaded the latest DeDRM plugin. Running Kindle for PC Vers 1.17.1. I’ve used all of these successfully for many, many years. Not sure what I’m doing wrong, but I keep getting a “Syntax” error when I try to install the new plugin. Here’s the error log:

    calibre, version 5.7.2
    ERROR: Unhandled exception: SyntaxError:invalid syntax (calibre_plugins.dedrm.init, line 153)

    calibre 5.7.2 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Count Pages (1, 11, 0) && EpubMerge (2, 11, 0) && FanFicFare (3, 29, 0) && Generate Cover (1, 5, 25) && food network Recipe Reader (1, 0, 2)
    Traceback (most recent call last):
    File “calibre\gui2\preferences\plugins.py”, line 317, in add_plugin
    File “calibre\customize\ui.py”, line 472, in add_plugin
    File “calibre\customize\ui.py”, line 61, in load_plugin
    File “calibre\customize\zipplugin.py”, line 293, in load
    File “importlib__init__.py”, line 127, in import_module
    File “”, line 1014, in _gcd_import
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “calibre\customize\zipplugin.py”, line 185, in exec_module
    File “calibre\customize\zipplugin.py”, line 181, in get_code
    File “calibre_plugins.dedrm.init“, line 153
    print u”{0} v{1}: Copying needed library files from plugin’s zip”.format(PLUGIN_NAME, PLUGIN_VERSION)
    ^
    SyntaxError: invalid syntax

    Help would be greatly appreciated!

      • Hmmm… I downloaded it from the link at the top of the blog just a couple of days ago. I’ll delete what I have and download it again.

        Thank you so much for your speedy reply!

  11. MAC OSX 10.15.7, Calibre 5.11, DRM 7.1, Kindle 1.30.
    All my stuff worked except for 5 books. They are all azw-zip files.
    Anyone know what how to get passed this because naturally my favorite book happens to be one of them.
    Thank yall so much!

  12. Thank you so much, literally close to tears by how happy I am. I am disabled, I need TTS to listen to my favorite books and usually google books was the easiest one to do that. However they only sell on amazon now which meant I was stuffed because every time you tab out of kindle it would pause the audio. This solves all of my issues, I don’t want to share the books or anything like that. I just want to listen to my favourite books and escape into these worlds. Thank you truly for providing this plugin.

  13. Amazon Kindle Version : 1.30.0 (59056)

    calibre Debug log
    calibre 5.13 embedded-python: True is64bit: False
    Windows-10-10.0.18362 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘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, 1, 0)
    calibre 5.13 embedded-python: True is64bit: False
    Windows-10-10.0.18362 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘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, 1, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 96.0 x 95.99847908745247
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.02] Showing splash screen…
    [0.80] splash screen shown
    [0.80] Initializing db…
    [0.88] db initialized
    [0.88] Constructing main UI…
    [1.55] main UI initialized…
    [1.55] Hiding splash screen
    Starting QuickView
    DeDRM v7.1.0: Trying to decrypt B08TVLVW8L_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Fintech Business Models
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v7.1.0: Failed to decrypt with error: No key found in 0 PIDs tried.
    DeDRM v7.1.0: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\Molnár Bálint\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\Molnár Bálint\AppData\Local\Amazon\Kindle\storage.kinf2018
    [22.77] splash screen hidden
    [22.77] Started up in 22.77 seconds with 294 books
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b”\x0c\x89\xf6D\x0bS\xcc\xac\xde’\xb5\x9b\x96\rj7\x01-\xc2\xd2\xaf)f\x0eU\xb5\x9f\x99]\x18\xbe\xea”, b’C:\Users\Moln\xc3\xa1r B\xc3\xa1lint\Documents\My Kindle Content\B08TVLVW8L_EBOK\B08TVLVW8L_EBOK.azw’]
    Couldn’t decrypt file.
    DeDRM v7.1.0: Ultimately failed to decrypt after 3.0 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/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 538, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.mobidedrm”, line 484, in processBook
    calibre_plugins.dedrm.mobidedrm.DrmException: No key found in 0 PIDs tried.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 631, in run
    File “calibre_plugins.dedrm.init“, line 581, in KindleMobiDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.1.0: Ultimately failed to decrypt after 3.0 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md

  14. Amazon Kindle 1.30.0
    calibre Debug log
    calibre 5.13 embedded-python: True is64bit: False
    Windows-10-10.0.18362 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘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, 1, 0)
    calibre 5.13 embedded-python: True is64bit: False
    Windows-10-10.0.18362 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘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, 1, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 96.0 x 95.99847908745247
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.02] Showing splash screen…
    [0.80] splash screen shown
    [0.80] Initializing db…
    [0.88] db initialized
    [0.88] Constructing main UI…
    [1.55] main UI initialized…
    [1.55] Hiding splash screen
    Starting QuickView
    DeDRM v7.1.0: Trying to decrypt B08TVLVW8L_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Fintech Business Models
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v7.1.0: Failed to decrypt with error: No key found in 0 PIDs tried.
    DeDRM v7.1.0: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\Molnár Bálint\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\Molnár Bálint\AppData\Local\Amazon\Kindle\storage.kinf2018
    [22.77] splash screen hidden
    [22.77] Started up in 22.77 seconds with 294 books
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b”\x0c\x89\xf6D\x0bS\xcc\xac\xde’\xb5\x9b\x96\rj7\x01-\xc2\xd2\xaf)f\x0eU\xb5\x9f\x99]\x18\xbe\xea”, b’C:\Users\Moln\xc3\xa1r B\xc3\xa1lint\Documents\My Kindle Content\B08TVLVW8L_EBOK\B08TVLVW8L_EBOK.azw’]
    Couldn’t decrypt file.
    DeDRM v7.1.0: Ultimately failed to decrypt after 3.0 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/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 538, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.mobidedrm”, line 484, in processBook
    calibre_plugins.dedrm.mobidedrm.DrmException: No key found in 0 PIDs tried.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 631, in run
    File “calibre_plugins.dedrm.init“, line 581, in KindleMobiDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.1.0: Ultimately failed to decrypt after 3.0 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md

  15. First of all, a big thanks you. I bought a book on Amazon , just to discover that it did not work in the ebook reader I use!
    MacOS Catalina, Last version of Calibre from here: https://calibre-ebook.com/download_osx and last version of the plug-in and last version of kindle. Used the command to downlaod AZW file.
    Everything works, except that at the last step, the DRM is not removed.
    I have the same error log posted before (I think, see lof afterwards), but I do not know where to download the 64-bit calibre as suggested above.
    If the error is different, I appreciate any suggestion.

    LOG:
    calibre Debug log
    calibre 5.14 embedded-python: True is64bit: True
    macOS-10.15.7-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘19.6.0’, ‘Darwin Kernel Version 19.6.0: Tue Nov 10 00:10:30 PST 2020; root:xnu-6153.141.10~1/RELEASE_X86_64’)
    Python 3.8.5
    OSX: (‘10.15.7’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 1, 0)
    calibre 5.14 embedded-python: True is64bit: True
    macOS-10.15.7-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘19.6.0’, ‘Darwin Kernel Version 19.6.0: Tue Nov 10 00:10:30 PST 2020; root:xnu-6153.141.10~1/RELEASE_X86_64’)
    Python 3.8.5
    OSX: (‘10.15.7’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 1, 0)
    devicePixelRatio: 2.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 128.00000192236715 x 127.50000191485789
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.03] Showing splash screen…
    [0.21] splash screen shown
    [0.21] Initializing db…
    [0.22] db initialized
    [0.22] Constructing main UI…
    [1.02] main UI initialized…
    [1.02] Hiding splash screen
    Starting QuickView
    DeDRM v7.1.0: Trying to decrypt B0756MTX6K_EBOK.azw
    Using Library AlfCrypto Python
    Using Library AlfCrypto Python
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Swipe to Unlock: The Primer on Technology and Business Strategy
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v7.1.0: Failed to decrypt with error: No key found in 0 PIDs tried.
    DeDRM v7.1.0: Looking for new default Kindle Key after 0.1 seconds
    Found k4Mac kinf2018 file: /Users/hiddenusername/Library/Application Support/Kindle/storage/.kinf2018
    trying username b’hiddenusername’ on file /Users/hiddenusername/Library/Application Support/Kindle/storage/.kinf2018
    trying IDString: b’45eae6fe3732′
    trying IDString: b’01264237c4e8′
    Decrypted key file using IDString ‘01264237c4e8’ and UserName ‘hiddenusername’
    DeDRM v7.1.0: Found 1 new key
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Swipe to Unlock: The Primer on Technology and Business Strategy
    Got SerialNumber from database default_key_1
    Got UsernameHash from database default_key_1
    Found 4 keys to try after 0.9 seconds
    Crypto Type is: 2
    DeDRM v7.1.0: Ultimately failed to decrypt after 0.9 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    [3.16] splash screen hidden
    [3.16] Started up in 3.16 seconds with 1 books
    Added Swipe to Unlock: The Primer on Technology and Business Strategy to db in: 0.0
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 538, 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.mobidedrm”, line 484, in processBook
    raise DrmException(“No key found in {0:d} PIDs tried.”.format(len(goodpids)))
    calibre_plugins.dedrm.mobidedrm.DrmException: No key found in 0 PIDs tried.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “calibre/customize/ui.py”, line 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 631, in run
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
    File “calibre_plugins.dedrm.init“, line 581, 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.1.0: Ultimately failed to decrypt after 0.9 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Added 1 books in 1.4 seconds

      • Thanks Laura for the quick reply! OK, clear for the calibre version.
        I’ve already followed the “chmod” method and already managed to download the azw file of the book on my mac. See log “DeDRM v7.1.0: Trying to decrypt B0756MTX6K_EBOK.azw”.
        The problem is that after I open the azw file in calibre, the DRM is not removed (see log).
        Any ideas? thanks a lot!

  16. I made it! Thanks Laura for pointing the right direction. In the link you sent it’s written: “chmod -x (Method 2) works on K4Mac 1.23.1 thru 1.30.0 with tools v6.8.x and Calibre 3.x/4.x. There are mostly positive reports of success regarding tools v7.x and Calibre 5.x.”

    I can confirm that Calibre 5 + plugin 7 does NOT WORK.
    It does work with Calibre 4.23 + plugin 6.8.

    Thanks!

    • Ok, calibre 5.x and DeDRM 7.1.0 is working on Windows for AZW3 and Adobe EPUBs. I have mostly heard the same for Macs except for Big Sur. Also some of the less common Amazon file types need the older calibre 4.23 and DeDRM 6.8.1.

  17. Hi, I tried but book (Solar Returns) still DRMed, here is log

    calibre 4.19 embedded-python: True is64bit: False
    Windows-10-10.0.18362-SP0 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.18362’)
    Python 2.7.16+
    Windows: (’10’, ‘10.0.18362’, ‘SP0′, u’Multiprocessor Free’)
    Interface language: hu
    Successfully initialized third party plugins: DeDRM (6, 8, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 120.0 x 120.0
    physicalDpi: 99.5265306122 x 85.725
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.02] Showing splash screen…
    [0.47] splash screen shown
    [0.47] Initializing db…
    [0.47] db initialized
    [0.47] Constructing main UI…
    [2.30] main UI initialized…
    [2.30] Hiding splash screen
    [2.75] splash screen hidden
    [2.77] Started up in 2.77 seconds with 37 books
    Storage number map:
    {(7L, 0L): [(2L, ‘C’)],
    (7L, 1L): [(1L, ‘E’), (2L, ‘D’)],
    (7L, 2L): [(1L, ‘G’)],
    (7L, 3L): [(1L, ‘H’)]}
    Storage number for USBSTOR\DISK&VEN_KINDLE&PROD_INTERNAL_STORAGE&REV_0100\B00E1510210601DB&0: StorageDeviceNumber(type=7L, number=3L, partition_number=0L)
    Drive letters for USBDevice(vendor_id=0x1949 product_id=0x4 bcd=0x100 devid=usb\vid_1949&pid_0004&rev_0100 devinst=16)
    {u’drive_letters’: [‘H’],
    u’pnp_id_map’: {‘H’: u’\\?\usbstor#disk&ven_kindle&prod_internal_storage&rev_0100#b00e1510210601db&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}’},
    u’readonly_drives’: set([]),
    u’sort_map’: {‘H’: (3L, 1L)}}
    Syncing cover thumbnails to workaround amazon cover bug
    Job: 0 Eszköz-információk lekérdezése started
    DeviceJob: 0 Eszköz-információk lekérdezése done, calling callback
    DeviceJob: 0 Eszköz-információk lekérdezése callback returned
    Job: 1 Könyvtár információ beálítása started
    DeviceJob: 1 Könyvtár információ beálítása done, calling callback
    DeviceJob: 1 Könyvtár információ beálítása callback returned
    Job: 2 Az eszközön lévő könyvek listájának letöltése started
    DEBUG: 0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= None
    DEBUG: 0.0 USBMS: dirs are: H:\ documents
    DEBUG: 0.1 USBMS: scan from root False H:\documents
    DEBUG: 0.3 USBMS: count found in cache: 196, count of files in metadata: 196, need_sync: False
    DEBUG: 0.3 USBMS: Finished fetching list of books from device. oncard= None
    DEBUG: 0.3 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= carda
    DEBUG: 0.3 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= cardb
    DeviceJob: 2 Az eszközön lévő könyvek listájának letöltése done, calling callback
    DeviceJob: metadata_downloaded: Starting set_books_in_library
    DeviceJob: set_books_in_library: books to process= 196
    DeviceJob: set_books_in_library finished: time= 0.0110001564026
    DeviceJob: metadata_downloaded: updating views
    DeviceJob: metadata_downloaded: syncing
    DeviceJob: metadata_downloaded: refreshing ondevice
    DeviceJob: metadata_downloaded: sending metadata_available signal
    DeviceJob: 2 Az eszközön lévő könyvek listájának letöltése callback returned
    Job: 0 Eszköz-információk lekérdezése finished
    Nem érhetőek el információk.
    Job: 1 Könyvtár információ beálítása finished
    Nem érhetőek el információk.
    Job: 2 Az eszközön lévő könyvek listájának letöltése finished
    Nem érhetőek el információk.
    stdout+stderr from file dialog helper: [”, ”]
    piped data from file dialog helper: [‘\x10\xb1\xa65\x11\xe8\x08a\xf04\x94f:y\x97\xec%[v\xdc\xb5\x16\x05\x02\n\xa4D9\xec\xd8\x07\’, ‘H:\documents\Solar Returns-asin_B084HJ562N-type_EBOK-v_0.azw3’]
    DeDRM v6.8.0: Trying to decrypt Solar Returns-asin_B084HJ562N-type_EBOK-v_0.azw3
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.42.
    Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Solar Returns
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.8.0: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.8.0: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\Soma\AppData\Local
    No K4PC kindle.info/kinf/kinf2011 files have been found.
    DeDRM v6.8.0: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 626, in run
    File “calibre_plugins.dedrm.init“, line 576, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.8.0: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    C:\Program Files (x86)\Calibre2\app\pylib.zip\dateutil\parser_parser.py:1177: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode – interpreting them as being unequal
    Added Solar Returns to db in: 0.2
    Added 1 books in 0.9 seconds

  18. All was going well till I tried buying these books today:

    https://www.amazon.in/dp/B08XZPYZG1

    I get the message saying: Update required
    An app update is required to read this title on the selected device.
    Get the app update

    Clearly, that would mean I would lose the ability to use Calibre for De-DRMing. And if I do not upgrade, I still cannot read on my macbook anyway. So perhaps the only way out for now is to buy i directly on my Kindle device and forget about being able to de-DRM it.

    • Yes, if it cannot be downloaded with Kindle for PC/Mac 1.26 or earlier, then it is likely only available in KFX format with a newer DRM which cannot be removed yet. You could see if you could download and decrypt a sample, but that still might not mean the full book is available in a format that can be decrypted.

      • Yes, when I downloaded the book it did not let me read it in Kindle for Mac. I had to upgrade my Kindle version and then I panicked and then quickly managed to downgrade it. Have decided to read it for now on my Kindle device where I don’t have to worry about the format and versions. But what a pity that I won’t be able to read it on my Macbook – or even on my phone where I don’t have Kindle and normally would have used the converted epub to read as Audio. I hope we are able to get a way to de-DRM such books too.

        Also, that reminds me, I have not even been upgrading my Calibre, worrying that I might lose the ability to de-DRM but perhaps that can be taken care of with newer versions of these tools?

        On Sat, 3 Apr 2021 at 00:08, Apprentice Alf’s Blog wrote:

        > Laura commented: “Yes, if it cannot be downloaded with Kindle for PC/Mac > 1.26 or earlier, then it is likely only available in KFX format with a > newer DRM which cannot be removed yet. You could see if you could download > and decrypt a sample, but that still might not mean t” >

          • I have followed the old maxim: “Why fix it if it ain’t broke” as far as old versions of Calibre is concerned but I guess will have to give in at some point and relearn all about using these tools and their new version: DeDRM 7.1.0

            On Sat, 3 Apr 2021 at 00:29, Apprentice Alf’s Blog wrote:

            > Laura commented: “DeDRM 7.1.0 works with calibre 5.” >

        • Regarding reading it on a Macbook, you could add another User for that. Once you have done that, install the newer version for Kindle for Mac in /Users//Applications, this should work, although I did not try it (!).

          Another solution would be to buy an older Kindle, pre-Paperwhite 2, that may even be broken, but you should be able to read the serial number to add that to your account. Then Amazon should allow you to download an older format through amazon.com/myk the “Manage Your Content and Devices” page, hopefully. If you already tried that (the newer Kindles can read KFX, so be aware of that), and it did not work, you are out of luck.

          • The book’s page indicates that it is not available for older Kindles. Probably not available for “download & transfer via USB” for newer Kindles either. Doesn’t appear to be any real need for this book to require KFX format, except for the DRM protection.

            • OK, maybe this should be a separate thread altogether. There are these two books I downloaded recently and was able to read them in Kindle (1.23.1, as downgraded yesterday again). When I bring them into Calibre, I they are added but am told “this book is locked by DRM” and cannot be opened. KFX-Zip is the format. Will it help if I upgrade Calibre and DRM tools?

              On Sat, 3 Apr 2021 at 16:30, Apprentice Alf’s Blog wrote:

              > Laura commented: “The book’s page indicates that it is not available for > older Kindles. Probably not available for “download & transfer via USB” for > newer Kindles either. Doesn’t appear to be any real need for this book to > require KFX format, except for the DRM prote” >

                • Sorry, I am clearly taxing your patience. But what is the KFX input plugin please? Should I just download the latest version of Calibre and DeDRM 7.10 and will it solve my problems? Will I be able to use it on books that I already have?

                  On Sat, 3 Apr 2021 at 17:47, Apprentice Alf’s Blog wrote:

                  > Laura commented: “Either install the KFX Input plugin or disable KFX > downloads. See this post: > https://www.mobileread.com/forums/showpost.php?p=3819708&postcount=508” >

                  • Just realized you must already have the KFX Input plugin if you’re seeing KFX-ZIP in calibre. I’d try disabling KFX downloads. If you’re currently using calibre 4.23 and DeDRM 6.8.0 or DeDRM 6.8.1, you are fine as far as DRM removal. If you want to update calibre to 5.x, you will need to update to DeDRM 7.1.0.

                    • Yes, my plug-ins are updated. But does it mean that these KFX-Zip files basically cannot be de-DRMd right now? So all right, will try to see that I disable new purchases from Amazon. The problem with that is that some books demand the new format.

                      On Sat, 3 Apr 2021 at 18:28, Apprentice Alf’s Blog wrote:

                      > Laura commented: “Just realized you must already have the KFX Input plugin > if you’re seeing KFX-ZIP in calibre. I’d try disabling KFX downloads. If > you’re currently using calibre 4.23 and DeDRM 6.8.0 or DeDRM 6.8.1, you are > fine as far as DRM removal. If you want to upd” >

                    • You can decrypt KFX format downloaded with Kindle for PC 1.26 or earlier. If you can only download it with a later version, then it cannot be decrypted yet.

                    • Oh that means there is hope for me? I downloaded with Kindle for Mac 1.23.1 (50131).

                      On Sat, 3 Apr 2021 at 19:14, Apprentice Alf’s Blog wrote:

                      > Laura commented: “You can decrypt KFX format downloaded with Kindle for PC > 1.26 or earlier. If you can only download it with a later version, then it > cannot be decrypted yet.” >

                    • Yes, those will work as long as Kindle for Mac used to download is on the same machine and user as calibre with DeDRM.

                    • So please tell me what I have to do as Calibre tells me: Cannot convert [book name]. This book is locked by DRM. To learn more about… etc

                      On Sat, 3 Apr 2021 at 19:31, Apprentice Alf’s Blog wrote:

                      > Laura commented: “Yes, those will work as long as Kindle for Mac used to > download is on the same machine and user as calibre with DeDRM.” > Respond to this comment by replying above this line > > New comment on *Apprentice Alf’s Blog > * > > > > *Laura* commented > > on DRM Removal Tools for eBooks > . > > > in response to *Shabnam Ali*: > > Oh that means there is hope for me? I downloaded with Kindle for Mac > 1.23.1 (50131).

                    • Delete the DRM book from calibre and Kindle for Mac. Make sure Kindle for Mac is still on version 1.26 or earlier. Redownload and re-add the fresh copy to calibre.

                    • I must mention that these were downloaded on my Kindle 1.23.1 (50131) running on the same Macbook Air with Calibre.

                      On Sun, 4 Apr 2021 at 03:25, Apprentice Alf’s Blog wrote:

                      > Laura commented: “Delete the DRM book from calibre and Kindle for Mac. > Make sure Kindle for Mac is still on version 1.26 or earlier. Redownload > and re-add the fresh copy to calibre.” > Respond to this comment by replying above this line > > New comment on *Apprentice Alf’s Blog > * > > > > *Laura* commented > > on DRM Removal Tools for eBooks > . > > > in response to *Shabnam Ali*: > > So please tell me what I have to do as Calibre tells me: Cannot convert > [book name]. This book is locked by DRM. To learn more about… etc On Sat, 3 > Apr 2021

  19. Hi,

    I’ve tried to load and decrypt, but the book is still decrypted or can’t be viewed due to the issue “unknown security plug-in”.:

    Here’s the log of calibre in debug mode and loading the pdf:

    Starting QuickView
    DeDRM v7.1.0: Trying to decrypt Elektronische Schaltungstechnik.pdf
    DeDRM v7.1.0: Elektronische Schaltungstechnik.pdf is a PDF ebook
    DeDRM v7.1.0: Trying Encryption key default_key
    error writing pdf: max() arg is an empty sequence
    DeDRM v7.1.0: Failed to decrypt with key default_key after 0.2 seconds
    DeDRM v7.1.0: Looking for new default Adobe Digital Editions Keys after 0.2 seconds
    Found 1 keys
    DeDRM v7.1.0: Trying a new default key
    error writing pdf: max() arg is an empty sequence
    DeDRM v7.1.0: Failed to decrypt with new default key after 0.3 seconds
    DeDRM v7.1.0: Ultimately failed to decrypt after 0.3 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    [12.25] splash screen hidden
    [12.25] Started up in 12.25 seconds with 243 books
    Added Elektronische Schaltungstechnik to db in: 0.1
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 638, in run
    File “calibre_plugins.dedrm.init“, line 513, in PDFDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.1.0: Ultimately failed to decrypt after 0.3 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 428, in get_file_type_metadata
    File “calibre\customize\builtins.py”, line 347, in get_metadata
    File “calibre\ebooks\metadata\pdf.py”, line 126, in get_metadata
    ValueError: Could not read info dict from PDF
    Syntax Error: Couldn’t find the ‘EBX_HANDLER’ security handler

    pdfinfo errored out with return code: 1
    Exception ignored in:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.adobekey”, line 266, in del
    TypeError: ‘NoneType’ object is not callable
    Exception ignored in:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.adobekey”, line 266, in del
    TypeError: ‘NoneType’ object is notAdded 1 books in 1.1 seconds

    Thanks for your help

  20. calibre, version 5.14.0
    ERROR: Obok DeDRM v7.1.0: “No userkeys found to decrypt books with. No point in proceeding.”

    So that’s the error I’m getting if I click the Obok toolbar icon in Calibre on Mac OS X 11.2.3, using the latest version shown above. DrDRM Tools 7.1.0 package, and Kobo Desktop latest, which is apparently 4.26.12741.

    I haven’t been able to find this error documented since 2019, so inquring if anyone knows what causes this in the latest Obok package?

    Ta!

  21. I’m using Calibre and Kindle on Windows 10. DeDRM failed to decrypt. Here is the log:
    calibre Debug log
    calibre 5.14 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 32, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 32, 0) && KFX metadata reader (from KFX Input) (1, 32, 0) && KFX Input (1, 32, 0)
    calibre 5.14 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 32, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 32, 0) && KFX metadata reader (from KFX Input) (1, 32, 0) && KFX Input (1, 32, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 120.0 x 120.0
    physicalDpi: 141.7674418604651 x 141.4020618556701
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.49] splash screen shown
    [0.49] Initializing db…
    [0.50] db initialized
    [0.50] Constructing main UI…
    [1.08] main UI initialized…
    [1.08] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.32.0: Importing C:/Users/gteal/Documents/My Kindle Content/B009B246X0_EBOK/B009B246X0_EBOK.azw
    Gather KFX-ZIP (from KFX Input): Gathered 4 file(s) as C:\Users\gteal\AppData\Local\Temp\calibre_z511os1r\43ivg7sn.kfx-zip
    DeDRM v7.2.1: Trying to decrypt 43ivg7sn.kfx-zip
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: 43ivg7sn
    Got DSN key from database default_key
    Got DSN key from database new_key
    Found 1 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.b408da69-4aef-4a3f-a261-a61007d4cd2f.voucher
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    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
    searching for kinfoFiles in C:\Users\gteal\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\gteal\AppData\Local\Amazon\Kindle\storage.kinf2018
    [45.72] splash screen hidden
    [45.72] Started up in 45.72 seconds with 586 books
    Decrypted key file using IDString ‘3931771920’ and UserName ‘gteal’
    DeDRM v7.2.1: Found 1 new key
    Decrypting KFX-ZIP ebook: 43ivg7sn
    Got DSN key from database default_key_1
    Found 1 keys to try after 2.8 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.b408da69-4aef-4a3f-a261-a61007d4cd2f.voucher
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 540, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 45, in processBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 89, in decrypt_voucher
    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
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 540, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 45, in processBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 89, in decrypt_voucher
    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
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\gteal\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    DeDRM v7.2.1: Ultimately failed to decrypt after 2.8 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Package KFX (from KFX Input) 1.32.0: Packaging C:\Users\gteal\AppData\Local\Temp\calibre_z511os1r\43ivg7sn.kfx-zip
    Processing container: B009B246X0_EBOK.azw
    KFX metadata reader (from KFX Input) activated for C:\Users\gteal\AppData\Local\Temp\calibre_z511os1r\6yspfyxg_add_books\0\B009B246X0_EBOK.kfx-zip
    Import symbol table YJ_symbols version 10 max_id 778 exceeds known table size 777
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 540, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 45, in processBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 89, in decrypt_voucher
    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 172, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 633, in run
    File “calibre_plugins.dedrm.init“, line 583, in KindleMobiDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 2.8 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 172, in _run_filetype_plugins
    File “calibre_plugins.kfx_input.package_filetype”, line 21, in run
    File “calibre_plugins.kfx_input.package_filetype”, line 33, in run_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 87, in convert_to_single_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 182, in decode_book
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 289, in get_container
    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container B009B246X0_EBOK.azw has DRM and cannot be converted

  22. DeDRM is not removing the DRM from either Kindle or Nook. I have DeDRM 7.21, Calibre 5.15 running on a Windows 10 PC. My version of the Kindle for PC app is 3.0. I have been fighting this for a while now and have reached the conclusion that I don’t have the codes to decrypt the files. I have been trying to locate the codes and have been unable to do so. Can somebody give me instructions as to how to find them?

    I didn’t intend to update my Kindle for PC but it was updated without my input and they also updated all of my Kindle files to their new format at the same time, so I can’t revert.

  23. Well, I may have been making trouble for myself. I’m not sure; I will have to try some more, but I just got a fairly new book converted from Kindle to EPUB, using Calibre wtih DeDRM. Tomorrow I will try again. If it works I will have to check to see what I need to do to make it work all the time.

    Thanks,
    Bill

      • Keys from Kindle for PC are automatically extracted as long as it is installed on the same machine and user as calibre with DeDRM. See the link I gave above for methods of obtaining Kindle books that can be decrypted. The link I gave for Nook explains how to extract your key for those.

          • Odd. I tried obtaining the Nook DRM bits about 9 months ago. I followed the Windows instructions and went step by step and managed to obtain the key needed to decrypt the files. I really don’t see what difference having a video would make. I will admit that I do have some experience in playing with computers but I would assume that someone labelling themselves digitalfreak should have enough experience to follow a step by step recipe.

    • I am using Kindle for PC 1.26 and Calibre 5.16. When I try to import an encrypted .awz file I get the following message. Any ideas?

      calibre Debug log
      calibre 5.16 embedded-python: True is64bit: False
      Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
      32bit process running on 64bit windows
      (‘Windows’, ’10’, ‘10.0.19041’)
      Python 3.8.5
      Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
      Interface language: None
      Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 38, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 38, 0) && KFX metadata reader (from KFX Input) (1, 38, 0) && KFX Input (1, 38, 0)
      calibre 5.16 embedded-python: True is64bit: False
      Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
      32bit process running on 64bit windows
      (‘Windows’, ’10’, ‘10.0.19041’)
      Python 3.8.5
      Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
      Interface language: None
      Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 38, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 38, 0) && KFX metadata reader (from KFX Input) (1, 38, 0) && KFX Input (1, 38, 0)
      Turning on automatic hidpi scaling
      devicePixelRatio: 1.0
      logicalDpi: 120.0 x 120.0
      physicalDpi: 141.7674418604651 x 141.4020618556701
      Using calibre Qt style: True
      [0.00] Starting up…
      [0.00] Showing splash screen…
      [0.69] splash screen shown
      [0.69] Initializing db…
      [0.80] db initialized
      [0.80] Constructing main UI…
      [1.58] main UI initialized…
      [1.58] Hiding splash screen
      Starting QuickView
      Gather KFX-ZIP (from KFX Input) 1.38.0: Importing C:/Users/gteal/Documents/My Kindle Content/B004CRU1K6_EBOK/B004CRU1K6_EBOK.azw
      Gather KFX-ZIP (from KFX Input): File is not KFX format
      DeDRM v7.2.1: Trying to decrypt B004CRU1K6_EBOK.azw
      Using Library AlfCrypto DLL/DYLIB/SO
      Using Library AlfCrypto DLL/DYLIB/SO
      Decrypting Topaz ebook: Infant Baptism and the Covenant of Grace
      Got DSN key from database default_key
      Got DSN key from database new_key
      Found 4 keys to try after 0.1 seconds
      Trying: b’XjNqjA74′
      Trying: b’/rQ5M5WX’
      Trying: b’ZiGHApUa’
      Book Key Found! (9cefd858cc320eab)
      Processing Section: color
      . . . . . . . . . .
      blah blah blah ……………….

      DeDRM v7.2.1: Ultimately failed to decrypt after 15.7 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/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 540, in KindleMobiDecrypt
      File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
      File “calibre_plugins.dedrm.topazextract”, line 372, in processBook
      File “calibre_plugins.dedrm.genbook”, line 520, in generateBook
      File “calibre_plugins.dedrm.flatxml2html”, line 806, in convert2HTML
      File “calibre_plugins.dedrm.flatxml2html”, line 731, in process
      File “calibre_plugins.dedrm.flatxml2html”, line 476, in buildParagraph
      AttributeError: ‘str’ object has no attribute ‘decode’

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File “calibre\customize\ui.py”, line 176, in _run_filetype_plugins
      File “calibre_plugins.dedrm.init“, line 633, in run
      File “calibre_plugins.dedrm.init“, line 583, in KindleMobiDecrypt
      calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 15.7 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
      Traceback (most recent call last):
      File “calibre\customize\ui.py”, line 433, in get_file_type_metadata
      File “calibre\customize\builtins.py”, line 289, in get_metadata
      File “calibre\ebooks\metadata\mobi.py”, line 491, in get_metadata
      File “calibre\ebooks\metadata\topaz.py”, line 378, in get_metadata
      File “calibre\ebooks\metadata\topaz.py”, line 114, in init
      ValueError: ‘C:/Users/gteal/Documents/My Kindle Content/B004CRU1K6_EBOK/B004CRU1K6_EBOK.azw’: Invalid Topaz format – no metadata record

  24. Amazon Kindle for Mac has again forced an autoupdate, although that option was disabled in the settings.
    Had to apply the patch from mobileread again to disable KFX download.
    Mac:
    chmod -x /Applications/Kindle.app/Contents/MacOS/renderer-test
    This prevents the renderer-test program from executing, blocking the use of KFX.
    Just so you know, as per the file dates it was changed on March 29th, 2021.

    Deleted the book with KFX, emptied the trash and re-downloaded the book new after patching, and it worked – the book in question was then without DRM in the older format, pre-ordered “The Last Watch (The Divide Series)” from Dewes, J. S. (published today).
    This is just for information, no question, so you are warned.

  25. Unable to get DeDRM working…here is my logfile.

    alibre 5.16 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.19041 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: en_GB
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 38, 0) && DeDRM (7, 2, 0) && Package KFX (from KFX Input) (1, 38, 0) && KFX metadata reader (from KFX Input) (1, 38, 0) && KFX Input (1, 38, 0) && KePub Metadata Reader (3, 4, 3) && KePub Metadata Writer (3, 4, 3) && KePub Output (3, 4, 4) && Kobo Books (1, 8, 2) && KoboTouchExtended (3, 4, 4)
    calibre 5.16 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.19041 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: en_GB
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 38, 0) && DeDRM (7, 2, 0) && Package KFX (from KFX Input) (1, 38, 0) && KFX metadata reader (from KFX Input) (1, 38, 0) && KFX Input (1, 38, 0) && KePub Metadata Reader (3, 4, 3) && KePub Metadata Writer (3, 4, 3) && KePub Output (3, 4, 4) && Kobo Books (1, 8, 2) && KoboTouchExtended (3, 4, 4)
    Turning on automatic hidpi scaling
    devicePixelRatio: 2.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 55.54441913439636 x 56.56082474226804
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.01] Showing splash screen…
    [0.45] splash screen shown
    [0.45] Initializing db…
    [0.45] db initialized
    [0.45] Constructing main UI…
    [1.19] main UI initialized…
    [1.19] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.38.0: Importing F:\Users\Peter\Documents\My Kindle Content\B018FHCPDO_EBOK.azw
    Gather KFX-ZIP (from KFX Input): File is not KFX format
    DeDRM v7.2.0: Trying to decrypt B018FHCPDO_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    [9.11] splash screen hidden
    [9.11] Started up in 9.11 seconds with 6 books
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b’.J$\xa9O,\xef\x80r\xb1\xfc \xd5\xf8\xeal\xfc\xe3\xf1WM\xbe\xcf\x03^\x17\x13\xe0\xba?\x89D’, b’F:\Users\Peter\Documents\My Kindle Content\B018FHCPDO_EBOK.azw’]
    Added Never Split the Difference to db in: 2.0
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 176, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 632, in run
    File “calibre_plugins.dedrm.init“, line 526, in KindleMobiDecrypt
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “calibre\customize\zipplugin.py”, line 192, in exec_module
    File “calibre_plugins.dedrm.k4mobidedrm”, line 88, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “calibre\customize\zipplugin.py”, line 185, in exec_module
    File “calibre\customize\zipplugin.py”, line 181, in get_code
    File “calibre_plugins.dedrm.kfxdedrm”, line 85
    traceback.print_exc()
    ^
    TabError: inconsistent use of tabs and spaces in indentatioAdded 1 books in 2.8 seconds

    • That problem does not appear to be related to DRM. Probably an issue with conversion.

      It would help to know which book is causing the problem. (The 10-character ASIN is the exact book identifier, otherwise the title and author.)

        • That book uses Amazon Topaz format, which is like a proprietary reflowable PDF. Conversion from that format is problematic.

          • I’m no expert, but… wondering if your kindle is an e-ink kindle, and if so, if you’ve tried the method of downloading from Amazon using “download for transfer via USB” (that’s probably not exact, it’s from my memory) which, as I understand it, cause it to be in a different kindle format.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.