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. tried 4.23 and 5 calibre with plugns , started on 4/29/21 on not working…get this message

    calibre, version 4.23.0
    ERROR: KFX conversion failed:

    Cannot convert Advance by Bounds (Alaskan Security-Team Rogue Book 6)Exception(u’Unexpected Ion symbols used: $789\nsection cK1, $269 1611, story lK5, $269 1690 content type $269 has extra data: ($789: $353)\nsection cZA, $269 1998, story lZE, $269 2141 content type $269 has extra data: ($789: $353)\nsection c1X8, $269 2941, story l1XC, $269 2984 content type $269 has extra data: ($789: $353)\nsection c2JA, $269 3603, story l2JE, $269 3780 content type $269 has extra data: ($789: $353)\nsection c3DG, $269 4458, story l3DM, $269 4552 content type $269 has extra data: ($789: $353)\nsection c40W, $269 5066, story l410, $269 5169 content type $269 has extra data: ($789: $353)\nsection c4C9, $269 5422, story l4CD, $269 5536 content type $269 has extra data: ($789: $353)’,)

    has happened on 2 books so far from amozon kfx

  2. Hi,

    Obok plugin removes DRM for a book but the content is not readble.

    Below is the log file:

    calibre Hata ayıklama logu
    calibre 5.17 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.18362 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.18362’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.18362’, ”, ‘Multiprocessor Free’)
    Interface language: tr
    Failed to initialize plugin: ‘C:\Users\faruk\AppData\Roaming\calibre\plugins\DeDRM.zip’
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0) && Obok DeDRM (7, 2, 1)
    calibre 5.17 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.18362 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.18362’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.18362’, ”, ‘Multiprocessor Free’)
    Interface language: tr
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0) && Obok DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 166.4436860068259 x 166.25454545454545
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.81] splash screen shown
    [0.81] Initializing db…
    [0.83] db initialized
    [0.83] 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.73] main UI initialized…
    [1.73] Hiding splash screen
    Starting QuickView
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 741, in initialize_plugins
    File “calibre\customize\ui.py”, line 65, 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 164
    print u”{0} v{1}: Copying needed library files from plugin’s zip”.format(PLUGIN_NAME, PLUGIN_VERSION)
    ^
    SyntaxError: invalid syntax
    Traceback (most recent call last):
    File “calibre\db\cache.py”, line 1417, in set_metadata
    File “calibre\db\cache.py”, line 1340, in set_cover
    File “calibre\db\backend.py”, line 1515, in set_cover
    File “calibre\utils\img.py”, line 288, in save_cover_data_to
    File “calibre\utils\img.py”, line 196, in image_to_data
    ValueError: Failed to export image as JPEG with error: Image is empty
    Traceback (most recent call last):
    File “calibre\db\cache.py”, line 1417, in set_metadata
    File “calibre\db\cache.py”, line 1340, in set_cover
    File “calibre\db\backend.py”, line 1515, in set_cover
    File “calibre\utils\img.py”, line 288, in save_cover_data_to
    File “calibre\utils\img.py”, line 196, in image_to_data
    ValueError: Failed to export image as JPEG with error: Image is empty
    [7.34] splash screen hidden
    [7.34] Started up in 7.34 seconds with 109 books
    Running Obok DeDRM v7.2.1
    DEBUG: 10.4 didn’t find device
    Obok v4.0.0
    Copyright © 2012-2020 Physisticated et al.
    C:\Users\faruk\AppData\Local\Temp\tmp5pi26p02
    DEBUG: 10.5 got kobodir C:\Users\faruk\AppData\Local\Kobo\Kobo Desktop Edition
    Found 12 possible keys to try.
    DEBUG: 16.1 BookListTableWidget:get_books – book_num: 1
    DEBUG: 16.1 BookListTableWidget:get_books – book: Dünyanın Merkezine Yolculuk
    DEBUG: 16.1 InterfacePluginAction::launchObok – number of books to decrypt: 1
    Obok DeDRM v7.2.1 – Decrypting Dünyanın Merkezine Yolculuk
    Trying key: b’83be46ace68f0f9187df0d4a327750d8′
    Checking text:b’)\xda\xbe\xdc\xbcQ\xaans\xbb’:
    Perhaps utf-8 without BOM
    Bad character at 1, value 218
    Decryption failed, trying next key.
    Trying key: b’7412c544bf3ab93b686a1ddcdbbeca24′
    Checking text:b'[\xf3\x14t|\xfd9\xb0<5′:
    Perhaps utf-8 without BOM
    Bad character at 1, value 243
    Decryption failed, trying next key.
    Trying key: b’0abc06bfde263f3a824c7bd417ac4bdb’
    Checking text:b’\xa5\r\xf5\x8b\xcc\x13\xbe\xed\x1c':
    Perhaps utf-8 without BOM
    Bad character at 0, value 165
    Decryption failed, trying next key.
    Trying key: b'4ad220976a1d68b250c6e01169b0e7f3'
    Checking text:b'\xfa\x8a\x8f2\x975\xae\xf7\x12g':
    Perhaps utf-8 without BOM
    Bad character at 0, value 250
    Decryption failed, trying next key.
    Trying key: b'12759d96ba3388c52a64ff67f0bdffe6'
    Checking text:b'\xd3\xdcA\x1b\x9a\x08\x1a7\x01\x97':
    Perhaps utf-8 without BOM
    Bad character at 0, value 211
    Decryption failed, trying next key.
    Trying key: b'4492b4ff927d44f3742c99e786c12141'
    Checking text:b'\xcb\x8f\x7f\xfb\x14\xfe\r\x97\x19\x9a':
    Perhaps utf-8 without BOM
    Bad character at 0, value 203
    Decryption failed, trying next key.
    Trying key: b'ea4b8e6f4f34c3ba496efbb699f34f75'
    Checking text:b'\xf1\xbe]\x17Rz\xbe\xda\xa9\x17':
    Perhaps utf-8 without BOM
    Bad character at 0, value 241
    Decryption failed, trying next key.
    Trying key: b'c3f1a416eccec2d886e547dc233638bd'
    Checking text:b'k"0z+V\x18\xad-\xb4':
    Perhaps utf-8 without BOM
    Seems to be good text
    Success!
    DEBUG: 16.3 DecryptAddProgressDialog::do_book_action - decrypted book: 'Dünyanın Merkezine Yolculuk'
    Obok DeDRM v7.2.1 - Added Dünyanın Merkezine Yolculuk
    Obok DeDRM v7.2.1 - wrapping up results.
    Worker Launch took: 0.00 seconds
    Running Obok DeDRM v7.2.1
    DEBUG: 82.1 didn't find device
    Obok v4.0.0
    Copyright © 2012-2020 Physisticated et al.
    C:\Users\faruk\AppData\Local\Temp\tmpvapysbfu
    DEBUG: 82.2 got kobodir C:\Users\faruk\AppData\Local\Kobo\Kobo Desktop Edition
    Found 12 possible keys to try.
    DEBUG: 88.5 BookListTableWidget:get_books - book_num: 1
    DEBUG: 88.5 BookListTableWidget:get_books - book: Dünyanın Merkezine Yolculuk
    DEBUG: 88.5 InterfacePluginAction::launchObok - number of books to decrypt: 1
    Obok DeDRM v7.2.1 - Decrypting Dünyanın Merkezine Yolculuk
    Trying key: b'83be46ace68f0f9187df0d4a327750d8'
    Checking text:b')\xda\xbe\xdc\xbcQ\xaans\xbb':
    Perhaps utf-8 without BOM
    Bad character at 1, value 218
    Decryption failed, trying next key.
    Trying key: b'7412c544bf3ab93b686a1ddcdbbeca24'
    Checking text:b'[\xf3\x14t|\xfd9\xb0<5':
    Perhaps utf-8 without BOM
    Bad character at 1, value 243
    Decryption failed, trying next key.
    Trying key: b'0abc06bfde263f3a824c7bd417ac4bdb'
    Checking text:b'\xa5\r
    \xf5\x8b\xcc\x13\xbe\xed\x1c’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 165
    Decryption failed, trying next key.
    Trying key: b’4ad220976a1d68b250c6e01169b0e7f3′
    Checking text:b’\xfa\x8a\x8f2\x975\xae\xf7\x12g’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 250
    Decryption failed, trying next key.
    Trying key: b’12759d96ba3388c52a64ff67f0bdffe6′
    Checking text:b’\xd3\xdcA\x1b\x9a\x08\x1a7\x01\x97′:
    Perhaps utf-8 without BOM
    Bad character at 0, value 211
    Decryption failed, trying next key.
    Trying key: b’4492b4ff927d44f3742c99e786c12141′
    Checking text:b’\xcb\x8f\x7f\xfb\x14\xfe\r\x97\x19\x9a’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 203
    Decryption failed, trying next key.
    Trying key: b’ea4b8e6f4f34c3ba496efbb699f34f75′
    Checking text:b’\xf1\xbe]\x17Rz\xbe\xda\xa9\x17′:
    Perhaps utf-8 without BOM
    Bad character at 0, value 241
    Decryption failed, trying next key.
    Trying key: b’c3f1a416eccec2d886e547dc233638bd’
    Checking text:b’k”0z+V\x18\xad-\xb4′:
    Perhaps utf-8 without BOM
    Seems to be good text
    Success!
    DEBUG: 88.6 DecryptAddProgressDialog::do_book_action – decrypted book: ‘Dünyanın Merkezine Yolculuk’
    Obok DeDRM v7.2.1 – Added Dünyanın Merkezine Yolculuk
    Obok DeDRM v7.2.1 – wrapping up results.

  3. What am I doing wrong with trying to convert this book to mobi? I downloaded the ebook from my Amazon account via the “download and use USB” option. Thanks in advance!

    calibre Debug log
    calibre 2.34 [64bit] isfrozen: True is64bit: True
    Windows-8-6.2.9200 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ‘8’, ‘6.2.9200’)
    Python 2.7.9
    Windows: (‘8’, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
    Successfully initialized third party plugins: DeDRM
    Starting up…
    Loaded cached store plugin for: Empik at version: 8
    Loaded cached store plugin for: Amazon FR Kindle at version: 15
    Loaded cached store plugin for: eBooks.com at version: 3
    Loaded cached store plugin for: Woblink at version: 14
    Loaded cached store plugin for: Amazon ES Kindle at version: 15
    Loaded cached store plugin for: Virtualo at version: 9
    Loaded cached store plugin for: Nexto at version: 4
    Loaded cached store plugin for: Legimi at version: 9
    Loaded cached store plugin for: Baen Ebooks at version: 2
    Loaded cached store plugin for: ebook.de at version: 5
    Loaded cached store plugin for: Amazon DE Kindle at version: 15
    Loaded cached store plugin for: Amazon CA Kindle at version: 7
    Loaded cached store plugin for: Smashwords at version: 5
    Loaded cached store plugin for: Mills and Boon UK at version: 4
    Loaded cached store plugin for: Kobo at version: 7
    Loaded cached store plugin for: Ebookpoint at version: 8
    Loaded cached store plugin for: Beam EBooks DE at version: 4
    Loaded cached store plugin for: Amazon UK Kindle at version: 15
    Loaded cached store plugin for: Amazon IT Kindle at version: 15
    Loaded cached store plugin for: Google Books at version: 6
    Loaded cached store plugin for: Amazon Kindle at version: 17
    Loaded cached store plugin for: Publio at version: 9
    Loaded cached store plugin for: eBook.nl at version: 2
    Started up in 18.17 seconds with 316 books
    DeDRM v6.7.0: Trying to decrypt Dr. Colbert’s Keto Zone Diet.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: Dr. Colbert’s Keto Zone Diet
    Got DSN key from database default_key_2
    Found 14 keys to try after 0.7 seconds
    Crypto Type is: 2
    DeDRM v6.7.0: Failed to decrypt with error: No key found in 14 keys tried.
    DeDRM v6.7.0: Looking for new default Kindle Key after 0.7 seconds
    searching for kinfoFiles in C:\Users\Tarissa\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\Tarissa\AppData\Local\Amazon\Kindle\storage.kinf2018
    Decrypted key file using IDString ‘1548564916’ and UserName ‘54617269737361’
    DeDRM v6.7.0: Found 1 new key
    MobiDeDrm v0.42.
    Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Dr. Colbert’s Keto Zone Diet
    Got DSN key from database default_key_1
    Found 3 keys to try after 1.2 seconds
    Crypto Type is: 2
    DeDRM v6.7.0: Ultimately failed to decrypt after 1.2 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 155, 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.7.0: Ultimately failed to decrypt after 1.2 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Added Dr. Colbert’s Keto Zone Diet to db in: 11.2
    Added 1 books in 15.5 seconds

    • When you download a book from the website, you need to choose an E-ink Kindlle (not a Fire) and have the Kindle’s serial number entered into DeDRM’s customization.

      I’d recommend updating to the current calibre 5.17 and DeDRM 7.2.1. If you don’t want to update calibre, I’d still update DeDRM to 6.8.1.

  4. I borrow e-books from the library. Usually the DRM doesn’t get in the way, so I leave it. But this time, Adobe stubbornly refused to acknowledge my authorization to read. I tried a bunch of things, called the library, etc. After repeatedly trying to log on to the Adobe website and getting the message, “Something went wrong. Please try again later,” over and over again, I’d had enough. I installed the Calibre plug in.

    Now I can read my book. Thanks, Apprentice Alf!

  5. Hello,
    I’m on Windows 10 64x. I used Adobe Digital Editions 2.0 to download an e-book from Kaplan’s website via an acsm file which was easily opened by ADE 2.0. I then attempted to import the book from the ADE folder in Documents but I get the error message ‘the security plug-in required by this command is unavailable.’
    I followed all the troubleshooting steps in Apprentice Harper’s FAQ but couldn’t get it to work.
    I would greatly appreciate any help.

    Error log:
    calibre Debug log
    calibre 5.17 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: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    calibre 5.17 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: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    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…
    [1.12] splash screen shown
    [1.12] Initializing db…
    [1.12] db initialized
    [1.12] 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.1 obok::action_err.py – loading translations
    [2.70] main UI initialized…
    [2.70] Hiding splash screen
    Starting QuickView
    DeDRM v7.2.1: Trying to decrypt The Official Guide to OET.pdf
    DeDRM v7.2.1: The Official Guide to OET.pdf is a PDF ebook
    DeDRM v7.2.1: Looking for new default Adobe Digital Editions Keys after 0.1 seconds
    Found 1 keys
    DeDRM v7.2.1: Trying a new default key
    error writing pdf: max() arg is an empty sequence
    DeDRM v7.2.1: Failed to decrypt with new default key after 0.3 seconds
    DeDRM v7.2.1: 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
    [29.61] splash screen hidden
    [29.62] Started up in 29.62 seconds with 1 books
    Added The Official Guide to OET to db in: 0.2
    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 640, in run
    File “calibre_plugins.dedrm.init“, line 515, in PDFDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: 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 433, 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 268, in del
    TypeError: ‘NoneType’ object is not callable
    Exception ignored in:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.adobekey”, line 268, in del
    TypeError: ‘NoneType’ object is not caAdded 1 books in 1.3 seconds

    • It looks like PDF decryption may not be working in DeDRM 7.2.1. Install portable calibre 4.23 and DeDRM 6.8.1 and see if that does it. If it does, raise an issue at Harper’s github repository.

      • Just seen this message. Does that mean I need to go back to older versions of Calibre and DeDRM to open/convert ascm files from ADE? Because I can’t open 80% of my files from ADE in Calibre.
        How will that affect my other books?

        • Assume you mean pdfs, since acsm files are what you open in ADE to download the actual book file. Adobe epubs (and some pdfs) will work fine with DeDRM 7.2.1. If you’re on Windows, portable calibre can be run alongside a main installation and it will have its own library and plugins. 64-bit and 32-bit calibre can also be installed at the same time, but by default they will share the same library and plugins.

  6. Trying to use KFX Input with DeDRM 6.6.3 (which works for my ADE content), but unable to get it working for KFX. Any ideas? Log below.

    calibre Debug log
    calibre 3.16 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.19041-SP0 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 2.7.12+
    Windows: (’10’, ‘10.0.19041’, ‘SP0′, u’Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (6, 6, 3) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0)
    calibre 3.16 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.19041-SP0 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 2.7.12+
    Windows: (’10’, ‘10.0.19041’, ‘SP0′, u’Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (6, 6, 3) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 69.8681948424 x 69.9795918367
    Using calibre Qt style: True
    Starting up…
    Started up in 3.63 seconds with 58 books
    stdout+stderr from file dialog helper: [”, ”]
    piped data from file dialog helper: [‘\xa2\xe1D\xdd\x9a\xff}\xca\xa0 w\xf4\x0f\xdd\xa2E\xda\x94\xcd\x1a(\xb5\x94<#\xec\x0cr\xee\x84{\xf2’, ‘C:\Users\vnasi62\Documents\My Kindle Content\B08L9DLMKK_EBOK\B08L9DLMKK_EBOK.azw’]
    Gather KFX-ZIP (from KFX Input) 1.39.0: Importing C:\Users\vnasi62\Documents\My Kindle Content\B08L9DLMKK_EBOK\B08L9DLMKK_EBOK.azw
    Gather KFX-ZIP (from KFX Input): Gathered 9 file(s) as C:\Users\vnasi62\AppData\Local\Temp\calibre_x0j7w6\f9apta.kfx-zip
    DeDRM v6.6.3: Trying to decrypt f9apta.kfx-zip
    Using Library AlfCrypto Python
    Decrypting KFX-ZIP ebook: f9apta
    Got DSN key from database default_key
    Found 1 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.2b4ae03b-ada1-4e40-acc0-e25d5fb4539d.voucher
    DeDRM v6.6.3: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v6.6.3: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\vnasi62\AppData\Local
    Found K4PC 2.25+ kinf2018 file: C:\Users\vnasi62\AppData\Local\Amazon\Kindle\storage.kinf2018
    Decrypted key file using IDString ‘909018894’ and UserName ‘56617368656e6e’
    DeDRM v6.6.3: Found 1 new key
    Decrypting KFX-ZIP ebook: f9apta
    Got DSN key from database default_key_1
    Found 1 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.2b4ae03b-ada1-4e40-acc0-e25d5fb4539d.voucher
    DeDRM v6.6.3: 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 171, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 624, in run
    File “calibre_plugins.dedrm.init“, line 574, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.6.3: 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
    Package KFX (from KFX Input) 1.39.0: Packaging C:\Users\vnasi62\AppData\Local\Temp\calibre_x0j7w6\f9apta.kfx-zip
    Processing container: B08L9DLMKK_EBOK.azw
    Running file type plugin Package KFX (from KFX Input) failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 171, 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 85, in convert_to_single_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 212, in decode_book
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 319, in get_container
    KFXDRMError: Book container B08L9DLMKK_EBOK.azw has DRM and cannot be converted
    KFX metadata reader (from KFX Input) activated for C:\Users\vnasi62\AppData\Local\Temp\calibre_x0j7w6\ajafcl_add_books\0\B08L9DLMKK_EBOK.kfx-zip
    Added Mark. Plan. Teach. 2.0 to db in: 1.9
    Added 1 books in 3.0 seconds

  7. I’ve been downloading my Amazon books explicitly (I bought a Kindle Paperwhite (2013) just for that ability), and loading them to Calibre. But it stopped working, I can no longer convert the books. I just tried a .azw3 and Calibre tells me it is DRM protected.
    I have Calibre 5.17.0
    KFX input 1.39.0
    KFC Output 1.51.0

    What changed? What do I need to do now?

  8. When I go to Amazon and look at my devices, I see two entries for my iPad with different Kindle e-mail addresses. How do I find which one is invalid to delete it?

    • Try looking under settings in the Kindle app for the send to kindle address. That’s where I see it in the Android app. I’d guess the iPad app is similar.

  9. DRM is not removed

    calibre: 5.17
    dedrm: 7.2
    kfx input: 1.39
    kfx output: 1.51
    kindle pc: 1.31

    using kindle pc, i download my book > B087QPQ1RF_EBOK. Then I drag and drop the book into calibre, so far so good – i can see the metadata like title, description, etc. When i try to convert the book from kfx-zip into epub, i get an error message stating: this book is protected by DRM.

    any clue?

  10. Having recently got a new Mac with Catalina, I decided to try using Kindle for mac version 1.31 with Method 2 as described on the MobileRead Forum – but I seem to have run into trouble. I started out with Calibre 4.2 & an earlier version of the tools, then updated to Calibre 5.17 & DeDRM 7.2.1, but still no joy.
    I am running the kindle app in the same user account as calibre, so I am unsure why it seems not to be able to find a key? Should I try and downgrade to 1.30, or am I making a very obvious mistake that I have missed? I have tried deleting & re-registering the Kindle app, but the problem persists.

    calibre Debug log
    calibre 5.17 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: en_GB
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0) && Obok DeDRM (7, 2, 1)
    calibre 5.17 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: en_GB
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0) && Obok DeDRM (7, 2, 1)
    devicePixelRatio: 2.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 132.00000198244115 x 132.50000198995036
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.02] Showing splash screen…
    [0.23] splash screen shown
    [0.23] Initializing db…
    [0.25] db initialized
    [0.25] 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.03] main UI initialized…
    [1.03] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.39.0: Importing /Users/calypso/Library/Application Support/Kindle/My Kindle Content/B07T4SW594_EBOK/B07T4SW594_EBOK.azw
    Gather KFX-ZIP (from KFX Input): File is not KFX format
    DeDRM v7.2.1: Trying to decrypt B07T4SW594_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: The City We Became (The Great Cities Trilogy)
    Got DSN key from database default_key
    Got DSN key from database default_key_2
    Found 6 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 6 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    Found k4Mac kinf2018 file: /Users/calypso/Library/Application Support/Kindle/storage/.kinf2018
    trying username b’calypso’ on file /Users/calypso/Library/Application Support/Kindle/storage/.kinf2018
    trying IDString: b’918c2abb3696′
    trying IDString: b’99875e95cc0f’
    Decrypted key file using IDString ‘99875e95cc0f’ and UserName ‘calypso’
    DeDRM v7.2.1: Found 1 new key
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: The City We Became (The Great Cities Trilogy)
    Got SerialNumber from database default_key_1
    Got UsernameHash from database default_key_1
    Found 4 keys to try after 0.8 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Ultimately failed to decrypt after 0.8 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    [2.99] splash screen hidden
    [2.99] Started up in 2.99 seconds with 740 books
    Added The City We Became (The Great Cities Trilogy) to db in: 0.0
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 540, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    mb.processBook(totalpids)
    File “calibre_plugins.dedrm.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 6 PIDs tried.

    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
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
    File “calibre_plugins.dedrm.init“, line 583, in KindleMobiDecrypt
    raise DeDRMError(“{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md“.format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 0.8 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md

    • I’ve seen some trouble with retrieving the key with the latest calibre and DeDRM on Mac if you didn’t update from a previously working setup. I would try with these specific versions: calibre 4.23 and DeDRM 6.8.1. If you get that working, you’ll probably fine to update to the latest. Be sure to download a fresh copy of the book with the current install of Kindle for Mac because the key will change if you de-register and re-register. Delete the book in calibre and add the new copy. Looks like method 2 is still working fine with Kindle for Mac 1.31 since the log shows this book isn’t in KFX format.

  11. can’t convert books or read them. Using the latest version of Calibre and DeDRM. And trying to convert from Android Kindle

    here’s the error. this is with all my books, would appreciate any help, thanks!

    calibre, version 5.17.0
    ERROR: KFX conversion failed: Cannot convert Always a Love SongException(‘Book is incomplete. All of the KFX container files that make up the book must be combined into a KFX-ZIP file for successful conversion. (Missing containers CR!1X4K8M6R054Z9FAMHDMA0NZ54M03, CR!5VRV9GE5EX1H78DYXMTDAXSN43S7)’)

  12. Posting again but actually following the instructions this time (sorry). Thanks so much to anyone who can help me. (After looking at the log, I figure “Key cannot be the null string” must be the problem, but I can’t even begin to guess how I can correct that.)

    which tool was used – Calibre 4.23, DeDRM 6.6.3 [I could not get the latest versions working, so I thought I’d revert to a combination of versions that is known to work with nookbooks]
    which OS you are using – Win 10
    where the ebook file came from (device or application) – Nook (was DL’d via the virtual machine I used to get the key)
    any error messages – “This book has DRM. Cannot convert. This book is locked by DRM. To learn more about DRM and why you cannot read or convert this book in Calibre, click here.”

    Incidentally, it says below it was trying to use “mykeyX”, but the key is actually called “mykey2″. I tried renaming it to mykeyX to see if it made any difference. The log results were the same.

    Log:
    calibre Debug log
    calibre 4.23 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.19041-SP0 Windows (’64bit’, ‘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, 6, 3)
    calibre 4.23 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.19041-SP0 Windows (’64bit’, ‘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, 6, 3)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 118.139534884 x 118.445595855
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.66] splash screen shown
    [0.66] Initializing db…
    [0.66] db initialized
    [0.66] Constructing main UI…
    [2.42] main UI initialized…
    [2.42] Hiding splash screen
    [6.89] splash screen hidden
    [6.89] Started up in 6.89 seconds with 0 books
    stdout+stderr from file dialog helper: [”, ”]
    piped data from file dialog helper: [‘\xf3\xdd\xf9\x8c\xc4 \x02??s\nA\xa4\xb7\x87\xfe\xac\xf8\x9a\nh\xdf\xdfOVDgq.\x98\xee\xe6’, ‘C:\Users\Kathryn\AppData\Local\Android\Sdk\platform-tools\files\B&N Downloads\Books\2940162703006_epub.v2.epub’]
    DeDRM v6.6.3: Trying to decrypt 2940162703006_epub.v2.epub
    DeDRM v6.6.3: Verifying zip archive integrity
    DeDRM v6.6.3: “2940162703006_epub.v2.epub” is a secure Barnes & Noble ePub
    DeDRM v6.6.3: Trying Encryption key mykeyX
    Could not decrypt dx6ubr.epub because of an exception:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.ignobleepub”, line 280, in decryptBook
    File “calibre_plugins.dedrm.ignobleepub”, line 211, in init
    File “calibre_plugins.dedrm.ignobleepub”, line 182, in init
    File “site-packages\Crypto\Cipher\AES.py”, line 95, in new
    File “site-packages\Crypto\Cipher\AES.py”, line 59, in init
    File “site-packages\Crypto\Cipher\blockalgo.py”, line 141, in init
    ValueError: Key cannot be the null string

    DeDRM v6.6.3: Failed to decrypt with key mykeyX after 0.3 seconds
    DeDRM v6.6.3: Looking for new NOOK Study Keys after 0.3 seconds
    No nook Study log files have been found.
    DeDRM v6.6.3: 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
    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 635, in run
    File “calibre_plugins.dedrm.init“, line 304, in ePubDecrypt
    DeDRMError: DeDRM v6.6.3: 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
    Added Ascendance of a Bookworm: Part 3 Adopted Daughter of an Archduke Volume 3 to db in: 0.3
    Added 1 books in 1.9 seconds
    Worker Launch took: 0.391999959946
    Job: 0 Convert book 1 of 1 (Ascendance of a Bookworm: Part 3 Adopted Daughter of an Archduke Volume 3) finished
    Convert book 1 of 1 (Ascendance of a Bookworm: Part 3 Adopted Daughter of an Archduke Volume 3)
    Conversion options changed from defaults:
    read_metadata_from_opf: u’C:\Users\Kathryn\AppData\Local\Temp\calibre_kv0kaa\ojdomc.opf’
    verbose: 2
    output_profile: u’nook’
    Resolved conversion options
    calibre version: 4.23.0
    {‘asciiize’: False,
    ‘author_sort’: None,
    ‘authors’: None,
    ‘base_font_size’: 0.0,
    ‘book_producer’: None,
    ‘change_justification’: u’original’,
    ‘chapter’: u”//*[((name()=’h1′ or name()=’h2′) and re:test(., ‘\s*((chapter|book|section|part)\s+)|((prolog|prologue|epilogue)(\s+|$))’, ‘i’)) or @class = ‘chapter’]”,
    ‘chapter_mark’: u’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’: u’2′,
    ‘expand_css’: False,
    ‘extra_css’: None,
    ‘extract_to’: None,
    ‘filter_css’: u”,
    ‘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 0x00000154A4E47908>,
    ‘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.NookOutput object at 0x00000154A4E56548>,
    ‘page_breaks_before’: u’/’,
    ‘prefer_metadata_cover’: False,
    ‘preserve_cover_aspect_ratio’: False,
    ‘pretty_print’: True,
    ‘pubdate’: None,
    ‘publisher’: None,
    ‘rating’: None,
    ‘read_metadata_from_opf’: u’C:\Users\Kathryn\AppData\Local\Temp\calibre_kv0kaa\ojdomc.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’: u”,
    ‘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}
    InputFormatPlugin: EPUB Input running
    on C:\Users\Kathryn\AppData\Local\Temp\calibre_kv0kaa\e3ffwt.epub
    Python function terminated unexpectedly
    e3ffwt.epub (Error Code: 1)
    Traceback (most recent call last):
    File “site.py”, line 114, in main
    File “site.py”, line 88, in run_entry_point
    File “site-packages\calibre\utils\ipc\worker.py”, line 209, in main
    File “site-packages\calibre\gui2\convert\gui_conversion.py”, line 43, in gui_convert_override
    File “site-packages\calibre\gui2\convert\gui_conversion.py”, line 28, in gui_convert
    File “site-packages\calibre\ebooks\conversion\plumber.py”, line 1110, in run
    File “site-packages\calibre\customize\conversion.py”, line 246, in call
    File “site-packages\calibre\ebooks\conversion\plugins\epub_input.py”, line 290, in convert
    calibre.ebooks.DRMError: e3ffwt.epub

    • When creating the .b64 file, you put in only those 28 characters including the equal sign at the end? After importing the key, be sure to click ok and apply on your way out of the windows. Then close and restart calibre before adding your books.

      BTW, someone over at GitHub is having trouble with not finding any key in the cchashdata.db file. Would you mind sharing what virtual device, Android version, and Nook app version worked for you?

      • Right, those are the steps I followed. Didn’t work.

        I followed the directions at Aric Renzo’s site, which I think you linked here previously. So it was a Nexus 5 with 7.1.1 Nougat (API, not google play) and Nook app version 5.0.2.38. Once I figured out the directions (they were definitely not written for someone who has never done any SW dev or used a terminal interface before), I didn’t have a problem getting the key.

        Fun fact: I just tried changing my B&N password. (There is a forward slash in the key, so I was wondering if that could be causing the problem.) The key generated was the same. The error was also the same – “Key cannot be null string”.

        • I don’t know. That error has usually just meant wrong key for this copy of the book. Possibly the correct key is just not getting put in that database anymore.

          • Problem solved! I had initially been unable to copy/paste from the terminal window, so I had re-typed the key manually. I managed to figure out how to copy/paste from the terminal window (you have to open the Edit menu and select Mark, highlight the text, then hit Enter, then paste it into Notepad or whatever), saved that file, and tried it again. It worked!

            Interestingly, I cannot see any visual difference between the manually typed key and the copy/pasted key, at least in Notepad.

            Thanks for your help!

              • No, the zero was clearly a zero (had a slash in it). I don’t know. Must have been some unicode formatting.

                Anyway, I found Aric Renzo’s instructions so confusing that I posted my own more detailed instructions here. These instructions are for Win 10 users and are geared to people who might know what a virtual device is but have certainly never created one before. Maybe they will help your person at GitHub…

  13. Unable to remove DRM from Kindle file. Latest version of Calibre and DeDRM. Running Kindle PC on same machine fully capable of reading the book. Here is the log file.

    calibre Debug log
    calibre 5.18 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    (‘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, 39, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0)
    calibre 5.18 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    (‘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, 39, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 93.6046065259117 x 93.62457337883959
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.83] splash screen shown
    [0.83] Initializing db…
    [1.19] db initialized
    [1.19] Constructing main UI…
    [2.78] main UI initialized…
    [2.78] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.39.0: Importing C:/Users/Agata/Documents/My Kindle Content/B08Z4DWY1C_EBOK/B08Z4DWY1C_EBOK.azw
    Gather KFX-ZIP (from KFX Input): Gathered 4 file(s) as C:\Users\Agata\AppData\Local\Temp\calibre_brnlkuua\f7dlxt33.kfx-zip
    DeDRM v7.2.1: Trying to decrypt f7dlxt33.kfx-zip
    [125.23] splash screen hidden
    [125.23] Started up in 125.23 seconds with 2762 books
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: f7dlxt33
    Found 0 keys to try after 0.9 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.5f37c225-d845-4761-8896-70fa82f6b384.voucher
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\Agata\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\Agata\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\Agata\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.9 seconds
    searching for kinfoFiles in C:\Users\Agata\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\Agata\AppData\Local\Amazon\Kindle\storage.kinf2018
    Decrypted key file using IDString ‘1081611872’ and UserName ‘Agata’
    DeDRM v7.2.1: Found 1 new key
    Decrypting KFX-ZIP ebook: f7dlxt33
    Got DSN key from database default_key_1
    Found 1 keys to try after 9.2 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.5f37c225-d845-4761-8896-70fa82f6b384.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\Agata\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\Agata\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\Agata\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\Agata\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\Agata\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\Agata\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 9.2 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Package KFX (from KFX Input) 1.39.0: Packaging C:\Users\Agata\AppData\Local\Temp\calibre_brnlkuua\f7dlxt33.kfx-zip
    Processing container: B08Z4DWY1C_EBOK.azw
    KFX metadata reader (from KFX Input) activated for C:\Users\Agata\AppData\Local\Temp\calibre_brnlkuua\ywhy5t4e_add_books\0\B08Z4DWY1C_EBOK.kfx-zip
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 540, in KindleMobiDecrypt
    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 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 9.2 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Running file type plugin Package KFX (from KFX Input) failed with traceback:
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 176, 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 85, in convert_to_single_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 212, in decode_book
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 319, in get_container
    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container Added Crypto 101: A Beginner’s Guide To Cryptocurrency to db in: 1.0
    Added 1 books in 11.4 seconds

  14. Hi! My Calibre stopped letting me turn my Kindle AZW into non-DRMed books s that I can read them with my preferred reader. I am running Kindle 1.31.0 and I’m running the new Calibre with the new DeDRM plugin. I don’t open the book on Kindle, I just download it and then add books on calibre and find the file. Two of them are click/load-able and neither one works. ¯_(ツ)_/¯

    Could you please help? Thank y’all so much in advance!

  15. Hi! Thank you so much in advance. I’m new here so please excuse me if I ask something stupid. I don’t own any Kindle readers, but I bought a few books from Amazon before and now I would like to export them. I used the Window App to download the books, and the export folders were named B00X6OKUW0_EBOK (and something similar). I assume they are encrypted? I installed the latest DeDRM plug-in on Calibre, but it appeared to be error. Hope someone can help me! Here is the log I generated:

    calibre Debug log
    calibre 5.19 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    calibre 5.19 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    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.47] splash screen shown
    [0.47] Initializing db…
    [0.47] db initialized
    [0.47] 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
    [0.98] main UI initialized…
    [0.98] Hiding splash screen
    Starting QuickView
    DeDRM v7.2.1: Trying to decrypt B00X6OKUW0_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    DeDRM v7.2.1: Failed to decrypt with error: The .kfx DRMION file cannot be decrypted by itself. A .kfx-zip archive containing a DRM voucher is required.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\Cynthia Lam\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\Cynthia Lam\AppData\Local\Amazon\Kindle\storage.kinf2018
    [9.28] splash screen hidden
    [9.28] Started up in 9.28 seconds with 0 books
    Decrypted key file using IDString ‘646846998’ and UserName ‘Cynthia Lam’
    DeDRM v7.2.1: Found 1 new key
    DeDRM v7.2.1: Ultimately failed to decrypt after 2.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 208, in GetDecryptedBook
    calibre_plugins.dedrm.k4mobidedrm.DrmException: The .kfx DRMION file cannot be decrypted by itself. A .kfx-zip archive containing a DRM voucher is required.

    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 2.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 503, in get_metadata
    File “calibre\ebooks\mobi\reader\headers.py”, line 295, in init
    File “calibre\ebooks\mobi\reader\headers.py”, line 323, in identity
    calibre.ebooks.mobi.MobiError: Unknown book type: b’\x81\xc4\xde\x02\x9c\xAdded B00X6OKUW0 EBOK to db in: 0.0
    Added 1 books in 3.0 seconds

  16. Time to upgrade Calibre, from 4.22 to latest (5.20). This means upgrading DeDrm from 4.22 to latest (7.21)
    My question – do I need to remove the old version of DeDrm, or just install the latest on top??
    thx,

  17. calibre Debug log
    calibre 5.20 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.18362 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.18362’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.18362’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0)
    calibre 5.20 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.18362 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.18362’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.18362’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 120.0 x 120.0
    physicalDpi: 141.7674418604651 x 142.13471502590673
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.02] Showing splash screen…
    [0.58] splash screen shown
    [0.58] Initializing db…
    [0.61] db initialized
    [0.61] Constructing main UI…
    [1.23] main UI initialized…
    [1.23] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.39.0: Importing C:\Users\Family-PC\Desktop\New folder\Queeristan_ LGBTQ Inclusion in the Indian Workplace_B08DNTG8LL.kfx
    Gather KFX-ZIP (from KFX Input): Cannot locate some files needed for the book. KFX files must remain in their original folder structure for successful import.
    Gather KFX-ZIP (from KFX Input): Gathered 1 file(s) as C:\Users\FAMILY~1\AppData\Local\Temp\calibre_eiam0o45\pr1ne3rl.kfx-zip
    DeDRM v7.2.1: Trying to decrypt pr1ne3rl.kfx-zip
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: pr1ne3rl
    Found 1 keys to try after 0.1 seconds
    DeDRM v7.2.1: Failed to decrypt with error: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\Family-PC\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\Family-PC\AppData\Local\Amazon\Kindle\storage.kinf2018
    [4.22] splash screen hidden
    [4.23] Started up in 4.23 seconds with 0 books
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b’#H{\xb1\xbf@\t\x14\x0e\xa5\x05\xc1\x8cG\xbc\xbc^`>\xae6\xd4\xe1!\x1c\xe7\x8a\x05\xa8(sq’, b’C:\Users\Family-PC\Desktop\New folder\Queeristan_ LGBTQ Inclusion in the Indian Workplace_B08DNTG8LL.kfx’]
    Decrypted key file using IDString ‘2859636301’ and UserName ‘Family-PC’
    DeDRM v7.2.1: Found 1 new key
    Decrypting KFX-ZIP ebook: pr1ne3rl
    Got DSN key from database default_key_1
    Found 1 keys to try after 4.3 seconds
    DeDRM v7.2.1: Ultimately failed to decrypt after 4.3 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Package KFX (from KFX Input) 1.39.0: Packaging C:\Users\FAMILY~1\AppData\Local\Temp\calibre_eiam0o45\pr1ne3rl.kfx-zip
    Processing container: Queeristan_ LGBTQ Inclusion in the Indian Workplace_B08DNTG8LL.kfx
    KFX metadata reader (from KFX Input) activated for C:\Users\FAMILY~1\AppData\Local\Temp\calibre_eiam0o45\r7yz4e1e_add_books\0\Queeristan_ LGBTQ Inclusion in the Indian Workplace_B08DNTG8LL.kfx-zip
    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 66, in decrypt_voucher
    Exception: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher

    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 4.3 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 176, 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 85, in convert_to_single_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 212, in decode_book
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 319, in get_container
    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container Queeristan
    LGBTQ Inclusion in the Indian Workplace_B08DNTG8LL.kfx has DRM and cannot be converted
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 433, 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 150, in get_metadata
    Exception: Failed to locate a KFX container Added Queeristan LGBTQ Inclusion in the Indian Workplace B08DNTG8LL to db in: 2.0
    Added 1 books in 6.9 seconds

    I got (borrowed) this book from Amazon Prime Reading. I’m using ASUS X541UA Laptop with Windows 10 Pro Version 1909 with OS Build 18363.418

    • Even if you purchase that book there is a good chance that you won’t be able to remove DRM from it. It is published by Westland, an Indian import of Amazon. Earlier this year they started making their books available only in KFX format with stronger DRM that has not yet been broken.

      It is unknown whether this is something that is only going to be applied to the Indian market or if this is a pilot program and will coming to a wider set of books worldwide.

  18. Trying to import a book. Here is the debug log:
    calibre Debug log
    calibre 5.21 embedded-python: True is64bit: True
    Linux-5.11.21-200.fc33.x86_64-x86_64-with-glibc2.2.5 Linux (’64bit’, ‘ELF’)
    (‘Linux’, ‘5.11.21-200.fc33.x86_64’, ‘#1 SMP Sat May 15 20:31:00 UTC 2021′)
    Python 3.8.5
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0) && Set KFX metadata (from KFX Output) (1, 52, 0) && KFX Output (1, 52, 0)
    calibre 5.21 embedded-python: True is64bit: True
    Linux-5.11.21-200.fc33.x86_64-x86_64-with-glibc2.2.5 Linux (’64bit’, ‘ELF’)
    (‘Linux’, ‘5.11.21-200.fc33.x86_64’, ‘#1 SMP Sat May 15 20:31:00 UTC 2021’)
    Python 3.8.5
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0) && Set KFX metadata (from KFX Output) (1, 52, 0) && KFX Output (1, 52, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 100.86162790697674 x 100.55257731958763
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.08] splash screen shown
    [0.08] Initializing db…
    [0.12] db initialized
    [0.12] Constructing main UI…
    Looking for desktop notifier support from: org.freedesktop.Notifications
    org.freedesktop.Notifications found in 0.0 seconds
    [0.80] main UI initialized…
    [0.80] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.39.0: Importing /home/JWilliamCupp/My Kindle Content/B01COJUFF4_EBOK.azw
    Gather KFX-ZIP (from KFX Input): File is not KFX format
    DeDRM v7.2.1: Trying to decrypt B01COJUFF4_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: The Shores of Tripoli (A Bliven Putnam Naval Adventure)
    Found 4 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 4 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    002c:fixme:winediag:LdrInitializeThunk wine-staging 6.10 is a testing version containing experimental patches.
    002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
    0034:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0034:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0034:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0064:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0064:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0064:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    006c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    006c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    006c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    005c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    005c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    005c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

    008c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    008c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    008c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    [5.64] splash screen hidden
    [5.64] Started up in 5.64 seconds with 316 books
    [‘zenity’, ‘–modal’, ‘–file-selection’, ‘–title=Select books’, ‘–separator=\n’, ‘–attach=119537687’, ‘–filename=/home/JWilliamCupp/My Kindle Content/.fgdfg.gdfhjdhf*&^839’, ‘–file-filter=Books | *.lrf *.rar *.zip *.rtf *.lit *.txt *.txtz *.text *.htm *.xhtm *.html *.htmlz *.xhtml *.pdf *.pdb *.updb *.pdr *.prc *.mobi *.azw *.doc *.epub *.fb2 *.fbz *.djv *.djvu *.lrx *.cbr *.cb7 *.cbz *.cbc *.oebzip *.rb *.imp *.odt *.chm *.tpz *.azw1 *.pml *.pmlz *.mbp *.tan *.snb *.xps *.oxps *.azw4 *.book *.zbf *.pobi *.docx *.docm *.md *.textile *.markdown *.ibook *.ibooks *.iba *.azw3 *.ps *.kepub *.kfx *.kpf *.kfx-zip *.azw8’, ‘–file-filter=EPUB books | *.epub *.kepub’, ‘–file-filter=Kindle books | *.mobi *.prc *.azw *.azw3 *.kfx *.tpz *.azw1 *.azw4’, ‘–file-filter=PDF books | *.pdf *.azw4’, ‘–file-filter=HTML books | *.htm *.html *.xhtm *.xhtml’, ‘–file-filter=LIT books | *.lit’, ‘–file-filter=Text books | *.txt *.text *.rtf *.md *.markdown *.textile *.txtz’, ‘–file-filter=Comics | *.cbz *.cbr *.cbc’, ‘–file-filter=Archives | *.zip *.rar’, ‘–file-filter=Wordprocessor files | *.odt *.doc *.docx’, ‘–file-filter=All files | *’, ‘–multiple’]
    002c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    002c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    002c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0024:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0024:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0024:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    00fc:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    00fc:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    00fc:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    Installed Pythons found by C:\windows\py.exe Launcher for Windows
    No Installed Pythons Found!

    Requested Python version (3) not installed, use -0 for available pythons
    Python 3 not found!
    00fc:fixme:kernelbase:AppPolicyGetProcessTerminationMethod FFFFFFFA, 0073E64C
    0104:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0104:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0104:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    Application could not be started, or no application associated with the specified file.
    ShellExecuteEx failed: File not found.

    DeDRM v7.2.1: wine python3.exe is not python3
    010c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    010c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    010c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    Application could not be started, or no application associated with the specified file.
    ShellExecuteEx failed: File not found.

    DeDRM v7.2.1: wine python.exe is not python3
    0114:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0114:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0114:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    Application could not be started, or no application associated with the specified file.
    ShellExecuteEx failed: Path not found.

    DeDRM v7.2.1: wine C:\Python27\python.exe is not python3
    DeDRM v7.2.1: Unable to find python3 executable in WINEPREFIX=””/home/JWilliamCupp/.wine””
    DeDRM v7.2.1: Ultimately failed to decrypt after 1.4 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
    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 4 PIDs tried.

    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
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
    File “calibre_plugins.dedrm.init“, line 583, in KindleMobiDecrypt
    raise DeDRMError(“{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md“.format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 1.4 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    0094:err:rpc:I_RpcReceive we got fault packet with status 0x1c010003
    Added The Shores of Tripoli (A Bliven Putnam Naval Adventure) to db in: 1.5
    Added 1 books in 3.6 seconds
    Worker Launch took: 0.01 seconds

    It’s not clear to me why Python cannot be found. I’ve confirmed I have Python 3.9.5 installed in WINE and Python 3.9.5 installed natively on Linux. Using Fedora 33 kernel 5.11.21-200.fc33.x86_64 and also wine-6.10. I’ve been successful at this in the past.

    What am I missing to use DeDRM v7.2.1?

    …thanks!

  19. I get a memory error when I try to convert an ebook.

    Tool: DeDRM 7.2.1
    Calibre version 5.21.0
    OS: Windows 10
    eBook in question: “The NIV Study Bible.epub”; 121,863KB; purchased from ChristianBooks.com. It opens just fine in the desktop app (Adobe Digital Editions).
    Error Message:Failed: Convert book 1 of 1 (The NIV Study Bible) [the last line in the error log is: Memory Error]
    I have a log of the DRM removal attempt from a debug run, how do I attach it? Try this: https://1drv.ms/t/s!AkeJlKrUHHCCgtg3BAXGBRgPcGtYSg?e=UxFFpU

  20. I get following error, what can I do?

    calibre, version 5.22.1
    error

    Failed to convert book: xxxxx.epub with error:
    DeDRM v7.2.1: Trying to decrypt xxxxx.epub
    DeDRM v7.2.1: Verifying zip archive integrity
    DeDRM v7.2.1: xxxxx.epub is a secure Adobe Adept ePub
    DeDRM v7.2.1: Trying Encryption key default_key
    Could not decrypt 1959e7p5.epub because of an exception:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.ineptepub”, line 418, in decryptBook
    TypeError: object of type ‘int’ has no len()

    DeDRM v7.2.1: Failed to decrypt with key default_key after 0.5 seconds
    DeDRM v7.2.1: Looking for new default Adobe Digital Editions Keys after 0.5 seconds
    DeDRM v7.2.1: Exception when getting default Adobe Key after 0.5 seconds
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 358, in ePubDecrypt
    File “calibre_plugins.dedrm.adobekey”, line 362, in adeptkeys
    File “calibre_plugins.dedrm.adobekey”, line 342, in CryptUnprotectData
    calibre_plugins.dedrm.adobekey.ADEPTError: Failed to decrypt user key key (sic)
    DeDRM v7.2.1: Ultimately failed to decrypt after 0.5 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    InputFormatPlugin: EPUB Input running
    on xxxxx.epub
    Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main()
    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 644, in run
    File “calibre_plugins.dedrm.init“, line 415, in ePubDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 0.5 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    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
    File “site.py”, line 77, in main
    File “site.py”, line 49, in run_entry_point
    File “calibre\utils\ipc\worker.py”, line 197, in main
    File “”, line 1, in
    File “calibre\srv\render_book.py”, line 824, in viewer_main
    File “calibre\srv\render_book.py”, line 815, in render_for_viewer
    File “calibre\srv\render_book.py”, line 792, in render
    File “calibre\ebooks\oeb\iterator\book.py”, line 63, in extract_book
    File “calibre\customize\conversion.py”, line 245, in call
    File “calibre\ebooks\conversion\plugins\epub_input.py”, line 290, in convert
    calibre.ebooks.DRMError: xxxxx.epub
    Exception ignored in:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.adobekey”, line 268, in del
    TypeError: ‘NoneType’ object is not callable
    Exception ignored in:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.adobekey”, line 268, in del
    TypeError: ‘NoneType’ object is not callable

  21. I have the following error, what can I do? Thanks in advance

    calibre, version 5.22.1

    Failed to convert book: xxxxx.epub with error:
    DeDRM v7.2.1: Trying to decrypt xxxxx.epub
    DeDRM v7.2.1: Verifying zip archive integrity
    DeDRM v7.2.1: xxxxx.epub is a secure Adobe Adept ePub
    DeDRM v7.2.1: Trying Encryption key default_key
    Could not decrypt zpwa0r.epub because of an exception:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.ineptepub”, line 418, in decryptBook
    TypeError: object of type ‘int’ has no len()

    DeDRM v7.2.1: Failed to decrypt with key default_key after 0.3 seconds
    DeDRM v7.2.1: Looking for new default Adobe Digital Editions Keys after 0.3 seconds
    DeDRM v7.2.1: Exception when getting default Adobe Key after 0.3 seconds
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 358, in ePubDecrypt
    File “calibre_plugins.dedrm.adobekey”, line 362, in adeptkeys
    File “calibre_plugins.dedrm.adobekey”, line 342, in CryptUnprotectData
    calibre_plugins.dedrm.adobekey.ADEPTError: Failed to decrypt user key key (sic)
    DeDRM v7.2.1: 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
    InputFormatPlugin: EPUB Input running
    on C:\Users\xxxxx.epub
    Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main()
    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 644, in run
    File “calibre_plugins.dedrm.init“, line 415, in ePubDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: 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 “runpy.py”, line 194, in _run_module_as_main
    File “runpy.py”, line 87, in _run_code
    File “site.py”, line 82, in
    File “site.py”, line 77, in main
    File “site.py”, line 49, in run_entry_point
    File “calibre\utils\ipc\worker.py”, line 197, in main
    File “”, line 1, in
    File “calibre\srv\render_book.py”, line 824, in viewer_main
    File “calibre\srv\render_book.py”, line 815, in render_for_viewer
    File “calibre\srv\render_book.py”, line 792, in render
    File “calibre\ebooks\oeb\iterator\book.py”, line 63, in extract_book
    File “calibre\customize\conversion.py”, line 245, in call
    File “calibre\ebooks\conversion\plugins\epub_input.py”, line 290, in convert
    calibre.ebooks.DRMError: xxxxx.epub
    Exception ignored in:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.adobekey”, line 268, in del
    TypeError: ‘NoneType’ object is not callable
    Exception ignored in:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.adobekey”, line 268, in del
    TypeError: ‘NoneType’ object is not callable

  22. Trying to convert files from Barnes & Noble app on my laptop running Win 10 Home edition

    calibre Debug log
    calibre 5.14 embedded-python: True is64bit: False
    Windows-10-10.0.17134 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.17134’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.17134’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 37, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 37, 0) && KFX metadata reader (from KFX Input) (1, 37, 0) && KFX Input (1, 37, 0)
    calibre 5.14 embedded-python: True is64bit: False
    Windows-10-10.0.17134 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.17134’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.17134’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 37, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 37, 0) && KFX metadata reader (from KFX Input) (1, 37, 0) && KFX Input (1, 37, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 100.86162790697674 x 101.07357512953367
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.02] Showing splash screen…
    [5.00] splash screen shown
    [5.00] Initializing db…
    [6.53] db initialized
    [6.53] Constructing main UI…
    [12.92] main UI initialized…
    [12.92] Hiding splash screen
    Starting QuickView
    [14.03] splash screen hidden
    [14.03] Started up in 14.03 seconds with 2442 books
    DeDRM v7.2.1: Trying to decrypt 2940163607280.epub
    DeDRM v7.2.1: Verifying zip archive integrity
    DeDRM v7.2.1: Trying to decrypt 9781497673656.epub
    DeDRM v7.2.1: Verifying zip archive integrity
    DeDRM v7.2.1: “9781497673656.epub” is a secure Barnes & Noble ePub
    DeDRM v7.2.1: Trying Encryption key clair
    Could not decrypt 40xt53vn.epub because of an exception:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.ignobleepub”, line 266, in decryptBook
    File “calibre_plugins.dedrm.ignobleepub”, line 197, in init
    File “calibre_plugins.dedrm.ignobleepub”, line 168, in init
    File “Crypto\Cipher\AES.py”, line 232, in new
    File “Crypto\Cipher__init__.py”, line 79, in _create_cipher
    File “Crypto\Cipher_mode_cbc.py”, line 274, in _create_cbc_cipher
    File “Crypto\Cipher\AES.py”, line 93, in _create_base_cipher
    ValueError: Incorrect AES key length (0 bytes)

    DeDRM v7.2.1: Failed to decrypt with key clair after 0.5 seconds
    DeDRM v7.2.1: Looking for new NOOK Study Keys after 0.5 seconds
    No nook Study log files have been found.
    DeDRM v7.2.1: Ultimately failed to decrypt after 0.5 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md

    • B&N books are really tough these days. That book isn’t working with that key. Did you extract the key from an Android emulator? Is the book from the same?

  23. I am having trouble with DeDRM. I’m using Calibre 5.22.1 and DeDRM 7.2.1. I’ve been working on this for awhile; I have used this set up in the past but cannot now get it to work. For a clean shot, I removed and entirely reinstalled WINE on my Linux system, and installed KindleForPC-installer-1.16.44025.exe and python-3.9.6-amd64.exe — they are the only tools in WINE right now. I started Calibre and opened the plugin tools, making sure the Kindle key on my machine is registered in the DeDRM plugin.

    Running Calibre in debug mode produces the following output (some lines highlighted):
    calibre Debug log
    calibre 5.22.1 embedded-python: True is64bit: True
    Linux-5.12.13-300.fc34.x86_64-x86_64-with-glibc2.2.5 Linux (’64bit’, ‘ELF’)
    (‘Linux’, ‘5.12.13-300.fc34.x86_64’, ‘#1 SMP Wed Jun 23 16:18:11 UTC 2021′)
    Python 3.8.5 <—- NATIVE LINUX PYTHON IDENTIFIED HERE
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0) && Set KFX metadata (from KFX Output) (1, 52, 0) && KFX Output (1, 52, 0)
    calibre 5.22.1 embedded-python: True is64bit: True
    Linux-5.12.13-300.fc34.x86_64-x86_64-with-glibc2.2.5 Linux (’64bit’, ‘ELF’)
    (‘Linux’, ‘5.12.13-300.fc34.x86_64’, ‘#1 SMP Wed Jun 23 16:18:11 UTC 2021’)
    Python 3.8.5
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 39, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0) && Set KFX metadata (from KFX Output) (1, 52, 0) && KFX Output (1, 52, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 100.86162790697674 x 100.55257731958763
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.05] splash screen shown
    [0.05] Initializing db…
    [0.07] db initialized
    [0.07] Constructing main UI…
    Looking for desktop notifier support from: org.freedesktop.Notifications
    org.freedesktop.Notifications found in 0.0 seconds
    [0.63] main UI initialized…
    [0.63] Hiding splash screen
    Starting QuickView
    qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 883, resource id: 13295904, major code: 40 (TranslateCoords), minor code: 0
    Gather KFX-ZIP (from KFX Input) 1.39.0: Importing /home/JWilliamCupp/My Kindle Content/B01COJUFF4_EBOK.azw
    Gather KFX-ZIP (from KFX Input): File is not KFX format
    DeDRM v7.2.1: Trying to decrypt B01COJUFF4_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: The Shores of Tripoli (A Bliven Putnam Naval Adventure)
    Found 4 keys to try after 0.2 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 4 PIDs tried. <—- NOT SURE WHY KEYS DON’T WORK HERE
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.2 seconds
    0200:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0200:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    Application could not be started, or no application associated with the specified file.
    ShellExecuteEx failed: File not found.

    DeDRM v7.2.1: wine py.exe -3 is not python3 <—- PYTHON 3 FOR WINDOWS IS INSTALLED
    0208:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0208:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    Application could not be started, or no application associated with the specified file.
    ShellExecuteEx failed: File not found.

    DeDRM v7.2.1: wine python3.exe is not python3 <—- PYTHON 3 FOR WINDOWS IS INSTALLED
    0210:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0210:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    [3.57] splash screen hidden
    [3.58] Started up in 3.58 seconds with 317 books
    [‘zenity’, ‘–modal’, ‘–file-selection’, ‘–title=Select books’, ‘–separator=\n’, ‘–attach=81788951’, ‘–filename=/home/JWilliamCupp/My Kindle Content/.fgdfg.gdfhjdhf*&^839’, ‘–file-filter=Books | *.lrf *.rar *.zip *.rtf *.lit *.txt *.txtz *.text *.htm *.xhtm *.html *.htmlz *.xhtml *.pdf *.pdb *.updb *.pdr *.prc *.mobi *.azw *.doc *.epub *.fb2 *.fbz *.djv *.djvu *.lrx *.cbr *.cb7 *.cbz *.cbc *.oebzip *.rb *.imp *.odt *.chm *.tpz *.azw1 *.pml *.pmlz *.mbp *.tan *.snb *.xps *.oxps *.azw4 *.book *.zbf *.pobi *.docx *.docm *.md *.textile *.markdown *.ibook *.ibooks *.iba *.azw3 *.ps *.kepub *.kfx *.kpf *.kfx-zip *.azw8’, ‘–file-filter=EPUB books | *.epub *.kepub’, ‘–file-filter=Kindle books | *.mobi *.prc *.azw *.azw3 *.kfx *.tpz *.azw1 *.azw4’, ‘–file-filter=PDF books | *.pdf *.azw4’, ‘–file-filter=HTML books | *.htm *.html *.xhtm *.xhtml’, ‘–file-filter=LIT books | *.lit’, ‘–file-filter=Text books | *.txt *.text *.rtf *.md *.markdown *.textile *.txtz’, ‘–file-filter=Comics | *.cbz *.cbr *.cbc’, ‘–file-filter=Archives | *.zip *.rar’, ‘–file-filter=Wordprocessor files | *.odt *.doc *.docx’, ‘–file-filter=All files | *’, ‘–multiple’]
    Application could not be started, or no application associated with the specified file.
    ShellExecuteEx failed: File not found.

    DeDRM v7.2.1: wine python.exe is not python3 <—- PYTHON 3 FOR WINDOWS IS INSTALLED
    0218:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    0218:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
    Application could not be started, or no application associated with the specified file.
    ShellExecuteEx failed: Path not found.

    DeDRM v7.2.1: wine C:\Python27\python.exe is not python3
    DeDRM v7.2.1: Unable to find python3 executable in WINEPREFIX=””/home/JWilliamCupp/.wine””
    DeDRM v7.2.1: Ultimately failed to decrypt after 0.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
    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 4 PIDs tried.

    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
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
    File “calibre_plugins.dedrm.init“, line 583, in KindleMobiDecrypt
    raise DeDRMError(“{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md“.format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 0.7 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 1713, resource id: 13308266, major code: 40 (TranslateCoords), minor code: 0
    qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 988, resource id: 13314195, major code: 40 (TranslateCoords), minor code: 0
    Added The Shores of Tripoli (A Bliven Putnam Naval Adventure) to db in: 6.5
    Added 1 books in 7.9 seconds
    Worker Launch took: 0.01 seconds

    Anyone have any ideas for what I can try next? What is going wrong here?
    Thanks.

    • Getting things set up with Linux is tricky. I’m not sure what else you need installed under Wine with the current version of DeDRM or exactly how it needs to be set up. Python 3.8.5 in the log here is actually referring to calibre’s embedded Python. The keys that aren’t working are probably from a previous installation of Kindle for PC, not from the one you downloaded these books from. And DeDRM isn’t retrieving the current key because it can’t run the key script for whatever reason. A workaround is to temporarily install Windows calibre with DeDRM, decrypt a book, save the key, and import that key into Linux. Then you don’t have to worry about why Python isn’t working under Wine to retrieve the key.

      • Okay — got it done. What worked was: (1) make a separate instance of WINE (so I could revert easily), install Calibre 3.48 and DeDRM 6.8.0 in that. Because I made the new instance by copying my existing ~/.wine folder, Kindle was already installed in that. Then I imported and de-DRM’d the book from Kindle using Calibre entirely within WINE. Then I copied the book out to my desktop, removed the temporary WINE instance, and imported the de-DRM’d copies into my main Linux Calibre library. Tedious, but it worked.

  24. Has Kindle moved the location of books in the Kindle for PC app? When I look in

    Kindle ebooks are in My Kindle Content

    all I see are books downloaded 4/3/2021 and before. None of the books I downloaded on 7/1/2021 appear. I have done searches and can’t find them.

    thanks!

        • (also on Mac, but Windows was the same last time I checked):
          Kindle for Windows App:
          In the list of ebooks there is a column which shows which are downloaded.
          And in the main settings is whole path to the folder where the books are (now) stored listed, even if it has changed.
          If it did not change, and the books are not shown, my guess is, you used a different account at amazon to buy (lend) them.

          And your Kindle ebooks should be listed here, to check with a browser:
          amazon.com/myk (Amazon Account – Manage you contend and devices ) – books – sort by “purchase date)
          if not, you have bought them under a different account.

          Try if you like:
          – note version number of the Kindle App (important for DeDRM!)
          – check if you still have the installer for that version, else download it
          – in the main settings of Kindle note your account and date (should be older) you use there
          ( Menu Tools – Options – Registration )
          – note the path to your older Kindle ebooks ( Menu Tools – Options – Content )
          – logout
          – delete Kindle App on your computer
          – delete settings, if you find them
          – reboot (most probably not necessary)
          – install the needed Kindle Version
          – login
          – Sync (the older ebooks should be there before sync),
          depending on what went wrong and how long ago, this may take a while.

          Another test, when DeDRM does not find all settings, which also might help, works on Windows and Mac nearly the same:
          Add a new User, install everything fresh, with special care for the older and correct Kindle Version,
          login, test wether you can read a few books in your apps (be it Kindle or Kobo, or Adobe or …).

          This is important:
          if you cannot read your books with DRM you will not have a chance to DeDRM them!
          Also only bought books can be DeDRMed, not lent books (library, Kindle Unlimited).

    • Still downloading to the same location for me. In Kindle for PC, go to Tools > Options > Content to see where your books are downloaded.

  25. I installed KFX plugin, and DeDRM following a couple different tutorials, I tried both 7.2.0 and 7.2.1 on DeDRM however when I pull .azw files from my kindle content from the amazon app on my computer, they still import and I can’t open, or view them. Any help would be much appreciated!

    calibre Debug log
    calibre 5.22.1 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, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0)
    calibre 5.22.1 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, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 2.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 78.9126213592233 x 78.82758620689654
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.38] splash screen shown
    [0.38] Initializing db…
    [0.38] db initialized
    [0.38] Constructing main UI…
    [0.84] main UI initialized…
    [0.84] Hiding splash screen
    Starting QuickView
    [5.69] splash screen hidden
    [5.69] Started up in 5.69 seconds with 0 books
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b’PG6 KY \xc5kD\xfe#\xf9\xccp<iiU+\xe8\xd3\xc1ST\xea\xd4\xdbWz\t\x9b’, b’C:\Users\Joy\Documents\My Kindle Content\B002Q1823S_EBOK\CR!XBQQ37KRRS2F1EPTX0W3AV8ZWF0S.azw.md’]
    Added CR!XBQQ37KRRS2F1EPTX0W3AV8ZWF0S.azw to db in: 0.2
    Added 1 books in 0.5 seconds

  26. Hello, my library is switching to Readium LCP protection, is there any chance this will be supported by the DeDrm tools?

    • The DeDRM Tools are for ebooks you bought, not lent. New and different DRM has to be worked into the Tools, and that depends on how much work that is, access to books with that DRM etc. In my opinion even for non-library-books unlikely. Newer Adobe would be needed, but as far as I know, that is not broken yet.

  27. Hi! I’m using calibre 5.23.0 and DeDRM 7.2.1 on my Mac. I used Method 1 from the mobilrereads tutorial (older versions of Kindle won’t run on my OS so I got the .azw files from Kindle for PC 1.17 and sent them to my Mac). DRM is still attached. Any help would be appreciated!

    calibre Debug log
    calibre 5.23 embedded-python: True is64bit: True
    macOS-10.16-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 3.8.5
    OSX: (‘10.16’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0) && KindleUnpack – The Plugin (0, 83, 0)
    calibre 5.23 embedded-python: True is64bit: True
    macOS-10.16-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 3.8.5
    OSX: (‘10.16’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0) && KindleUnpack – The Plugin (0, 83, 0)
    devicePixelRatio: 2.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 113.50000170459899 x 113.50000170459901
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.02] Showing splash screen…
    [0.35] splash screen shown
    [0.35] Initializing db…
    [0.35] db initialized
    [0.35] Constructing main UI…
    [1.44] main UI initialized…
    [1.44] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.40.0: Importing /Users/shruti/Downloads/B089ZRZKPW_EBOK.azw
    Gather KFX-ZIP (from KFX Input): File is not KFX format
    DeDRM v7.2.1: Trying to decrypt B089ZRZKPW_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: 【合本版】心霊探偵八雲 全12巻 (角川書店単行本)
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 0 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    Found k4Mac kinf2018 file: /Users/shruti/Library/Application Support/Kindle/storage/.kinf2018
    trying username b’shruti’ on file /Users/shruti/Library/Application Support/Kindle/storage/.kinf2018
    trying IDString: b’0919971774fe’
    [4.13] splash screen hidden
    [4.13] Started up in 4.13 seconds with 3 books
    Decrypted key file using IDString ‘0919971774fe’ and UserName ‘shruti’
    DeDRM v7.2.1: Found 1 new key
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: 【合本版】心霊探偵八雲 全12巻 (角川書店単行本)
    Got SerialNumber from database default_key_1
    Got UsernameHash from database default_key_1
    Found 4 keys to try after 0.7 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Ultimately failed to decrypt after 0.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
    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 176, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 633, in run
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
    File “calibre_plugins.dedrm.init“, line 583, in KindleMobiDecrypt
    raise DeDRMError(“{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md“.format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 0.7 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md

    • The Kindle app where the book was downloaded and calibre with DeDRM need to be on the same machine and user. So install calibre with DeDRM on the PC and decrypt the books there. Or use method 2 or 4 to decrypt books downloaded with the Kindle app on your Mac.

  28. Hello,

    I got my calibre program and adobe digital editions 2.0 a few years ago and have been downloading my purchased ebooks without any problems but I just changed my hard drive for a SSD disc, I cloned one disc to the other but know adobe digital editions 2.0 says my computer is authorized without id and doesn’t alow me to download my url links from Kobo, it tells me there is an error in the activation. I have changed my adobe id password and try to activate the program again but there is no changed, what can I do?, I cannot see my books through adobe digital editions so I can copy them in calibre and have them free in my ebook.
    I would really appreciate the help.

    Thanks a lot in advance.

  29. About once a year or so I’ll reformat my C drive and re-install Windows just to get rid of the accumulating bit-rot. Last year when I re-installed Windows, I had no issues installing and using the DeDRM plugin with my purchased books. This year, for some reason, the plugin will not install. Instead, I get this syntax error. I looked first to see if anyone else had this plugin installation error and didn’t see any posts. If anyone has an idea of what I should try next, I’m open to suggestions. Thanks!

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

    calibre 5.23 [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: None
    Successfully initialized third party plugins: WordDumb (3, 10, 0)
    Traceback (most recent call last):
    File “calibre\gui2\preferences\plugins.py”, line 327, in add_plugin
    File “calibre\customize\ui.py”, line 477, in add_plugin
    File “calibre\customize\ui.py”, line 65, 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 167
    print u”{0} v{1}: Copying needed library files from plugin’s zip”.format(PLUGIN_NAME, PLUGIN_VERSION)
    ^
    SyntaxError: invalid syntax

      • Wow! I’m not sure how I missed that. I would’ve sworn I pulled down the newest version and not used my old version. I both apologize and thank you for your assistance! This tool has been amazing.

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.