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,402 thoughts on “DRM Removal Tools for eBooks

  1. Hi, I read in the FAQ that the tools should work with books from any store selling ebooks that are compatible with ADE 2.0.1, but I don’t know how to tell whether the books I have are compatible or not. The individual files (10 – 20 per book) seem to be renamed pdfs – if I change the extension to pdf and open them in Acrobat reader I am prompted for a password. I can’t find any .rer files that seem to be related but then they might also have been renamed. Just wondering if there is any mileage in pursuing this.

  2. Hi, I download a amazon book to kindle for pc, updated my /DeDRM_tools, configured the plugin and still couldn’t convert the book. Log reads:
    EpubMerge: DEBUG: 2021-09-25 11:02:12,101: calibre_plugins.epubmerge.epubmerge_plugin(158): macmenuhack file_path:C:\Users\patty\AppData\Roaming\calibre\plugins\fanficfare_macmenuhack.txt
    calibre Debug log
    calibre 5.26 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, 43, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 43, 0) && EpubMerge (2, 11, 0) && Find Duplicates (1, 8, 10) && KFX metadata reader (from KFX Input) (1, 43, 0) && KFX Input (1, 43, 0)
    calibre 5.26 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, 43, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 43, 0) && EpubMerge (2, 11, 0) && Find Duplicates (1, 8, 10) && KFX metadata reader (from KFX Input) (1, 43, 0) && KFX Input (1, 43, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 2.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 69.96843615494979 x 69.9795918367347
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.33] splash screen shown
    [0.33] Initializing db…
    [0.56] db initialized
    [0.56] Constructing main UI…
    [1.20] main UI initialized…
    [1.20] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.43.0: Importing H:\Documents\My Kindle Content\B00G6SK3EI_EBOK\B00G6SK3EI_EBOK.azw
    Gather KFX-ZIP (from KFX Input): Gathered 4 file(s) as C:\Users\patty\AppData\Local\Temp\calibre_qrf708kw\0qdhyn22.kfx-zip
    DeDRM v7.2.1: Trying to decrypt 0qdhyn22.kfx-zip
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: 0qdhyn22
    Got DSN key from database default_key
    Got DSN key from database default_key_2
    Got DSN key from database default_key_3
    Found 5 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.c0520fbb-3a92-44fc-a08b-cf2be8ac0a8e.voucher
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 884, in decryptvoucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Expected KeySet, got
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 759, in pkcs7unpad
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    DeDRM v7.2.1: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\patty\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\patty\AppData\Local\Amazon\Kindle\storage.kinf2018
    [41.48] splash screen hidden
    [41.48] Started up in 41.48 seconds with 6205 books
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b’\xe9\x929\x80\x9a\xb4\xf62q\x1c5\xca\xcb\xbd\x01\xc8\xd2\x19\xe9\x0c\x9a\x0e\xd5\n\xaa\x103I\xb7\xe5′, b’H:\Documents\My Kindle Content\B00G6SK3EI_EBOK\B00G6SK3EI_EBOK.azw’]
    Decrypted key file using IDString ‘4271640437’ and UserName ‘patty’
    DeDRM v7.2.1: Found 1 new key
    Decrypting KFX-ZIP ebook: 0qdhyn22
    Got DSN key from database default_key_1
    Found 1 keys to try after 2.6 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.c0520fbb-3a92-44fc-a08b-cf2be8ac0a8e.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\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\patty\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\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    DeDRM v7.2.1: Ultimately failed to decrypt after 2.6 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Package KFX (from KFX Input) 1.43.0: Packaging C:\Users\patty\AppData\Local\Temp\calibre_qrf708kw\0qdhyn22.kfx-zip
    Processing container: B00G6SK3EI_EBOK.azw
    KFX metadata reader (from KFX Input) activated for C:\Users\patty\AppData\Local\Temp\calibre_qrf708kw\sqf8pfx__add_books\0\B00G6SK3EI_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 2.6 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Running file type plugin Package KFX (from KFX Input) failed with traceback:
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 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 84, in convert_to_single_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 211, in decode_book
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 318, in get_container
    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container B00G6SK3EI_EBOK.azw has DRM and cannot be converted
    Added Holy Poison – The Judas Pledge to db in: 0.2
    Added 1 books in 3.2 seconds
    Worker Launch took: 0.05 seconds
    Job: 0 Convert book 1 of 1 (Holy Poison – The Judas Pledge) finished
    Convert book 1 of 1 (Holy Poison – The Judas Pledge)

    DeDRM v7.2.1: Trying to decrypt bfgtj7ta.kfx-zip
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: bfgtj7ta
    Got DSN key from database default_key
    Got DSN key from database default_key_2
    Got DSN key from database default_key_3
    Found 5 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.c0520fbb-3a92-44fc-a08b-cf2be8ac0a8e.voucher
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 759, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 884, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Expected KeySet, got 
    DeDRM v7.2.1: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\patty\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\patty\AppData\Local\Amazon\Kindle\storage\.kinf2018
    Decrypted key file using IDString '4271640437' and UserName 'patty'
    DeDRM v7.2.1: Found 1 new key
    Decrypting KFX-ZIP ebook: bfgtj7ta
    Got DSN key from database default_key_1
    Found 1 keys to try after 2.9 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.c0520fbb-3a92-44fc-a08b-cf2be8ac0a8e.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\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\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\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    DeDRM v7.2.1: Ultimately failed to decrypt after 2.9 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Conversion options changed from defaults:
    
      verbose: 2
    
      read_metadata_from_opf: 'C:\\Users\\patty\\AppData\\Local\\Temp\\calibre_qrf708kw\\lj2d3h1z.opf'
    
      output_profile: 'kindle_pw3'
    
      cover: 'C:\\Users\\patty\\AppData\\Local\\Temp\\calibre_qrf708kw\\uilawtgf.jpeg'
    
    Resolved conversion options
    
    calibre version: 5.26.0
    
    {'allow_conversion_with_errors': False,
    
     'asciiize': False,
    
     'author_sort': None,
    
     'authors': None,
    
     'base_font_size': 0.0,
    
     'book_producer': None,
    
     'change_justification': 'original',
    
     'chapter': "//*[((name()='h1' or name()='h2') and re:test(., "
    
                "'\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', "
    
                "'i')) or @class = 'chapter']",
    
     'chapter_mark': 'pagebreak',
    
     'comments': None,
    
     'cover': 'C:\\Users\\patty\\AppData\\Local\\Temp\\calibre_qrf708kw\\uilawtgf.jpeg',
    
     'debug_pipeline': None,
    
     'dehyphenate': True,
    
     'delete_blank_paragraphs': True,
    
     'disable_font_rescaling': False,
    
     'dont_compress': False,
    
     'duplicate_links_in_toc': False,
    
     'embed_all_fonts': False,
    
     'embed_font_family': None,
    
     'enable_heuristics': False,
    
     'expand_css': False,
    
     'extra_css': None,
    
     'extract_to': None,
    
     'filter_css': '',
    
     'fix_indents': True,
    
     'font_size_mapping': None,
    
     'format_scene_breaks': True,
    
     'html_unwrap_factor': 0.4,
    
     'input_encoding': None,
    
     'input_profile': <calibre.customize.profiles.InputProfile object at 0x07823A90>,
    
     '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,
    
     'mobi_file_type': 'old',
    
     'mobi_ignore_margins': False,
    
     'mobi_keep_original_images': False,
    
     'mobi_toc_at_start': False,
    
     'no_chapters_in_toc': False,
    
     'no_inline_navbars': True,
    
     'no_inline_toc': False,
    
     'output_profile': <calibre.customize.profiles.KindlePaperWhite3Output object at 0x07823D90>,
    
     'page_breaks_before': '/',
    
     'personal_doc': '[PDOC]',
    
     'prefer_author_sort': False,
    
     'prefer_metadata_cover': False,
    
     'pretty_print': False,
    
     'pubdate': None,
    
     'publisher': None,
    
     'rating': None,
    
     'read_metadata_from_opf': 'C:\\Users\\patty\\AppData\\Local\\Temp\\calibre_qrf708kw\\lj2d3h1z.opf',
    
     'remove_fake_margins': True,
    
     'remove_first_image': False,
    
     'remove_paragraph_spacing': False,
    
     'remove_paragraph_spacing_indent_size': 1.5,
    
     'renumber_headings': True,
    
     'replace_scene_breaks': '',
    
     'search_replace': '[]',
    
     'series': None,
    
     'series_index': None,
    
     'share_not_sync': False,
    
     'smarten_punctuation': False,
    
     'sr1_replace': None,
    
     'sr1_search': None,
    
     'sr2_replace': None,
    
     'sr2_search': None,
    
     'sr3_replace': None,
    
     'sr3_search': None,
    
     'start_reading_at': None,
    
     'subset_embedded_fonts': False,
    
     'tags': None,
    
     'timestamp': None,
    
     'title': None,
    
     'title_sort': None,
    
     'toc_filter': None,
    
     'toc_threshold': 6,
    
     'toc_title': None,
    
     'transform_css_rules': '[]',
    
     'unsmarten_punctuation': False,
    
     'unwrap_lines': True,
    
     'use_auto_toc': False,
    
     'verbose': 2}
    
    Running file type plugin DeDRM failed with traceback:
    
    Traceback (most recent call last):
    
      File "calibre_plugins.dedrm.__init__", line 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 2.9 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    
    DeDRM v7.2.1: Trying to decrypt bfgtj7ta.kfx-zip
    Decrypting KFX-ZIP ebook: bfgtj7ta
    Got DSN key from database default_key
    Got DSN key from database default_key_2
    Got DSN key from database default_key_3
    Found 5 keys to try after 0.0 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.c0520fbb-3a92-44fc-a08b-cf2be8ac0a8e.voucher
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 759, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.kfxdedrm", line 83, in decrypt_voucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 884, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Expected KeySet, got 
    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.0 seconds
    searching for kinfoFiles in C:\Users\patty\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\patty\AppData\Local\Amazon\Kindle\storage\.kinf2018
    Decrypted key file using IDString '4271640437' and UserName 'patty'
    DeDRM v7.2.1: Found 1 new key
    Decrypting KFX-ZIP ebook: bfgtj7ta
    Got DSN key from database default_key_1
    Found 1 keys to try after 2.8 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.c0520fbb-3a92-44fc-a08b-cf2be8ac0a8e.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\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\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\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 879, in decryptvoucher
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 758, in pkcs7unpad
      File "C:\Users\patty\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 98, in _assert
    Exception: Incorrect padding - Wrong key
    DeDRM v7.2.1: Ultimately failed to decrypt after 2.8 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    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 2.8 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    
    InputFormatPlugin: KFX Input running
    
    on C:\Users\patty\AppData\Local\Temp\calibre_qrf708kw\bfgtj7ta.kfx-zip
    
    Software versions: KFX Input 1.43.0, calibre 5.26, Windows-10-10.0.19041
    
    KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290
    
    Converting C:\Users\patty\AppData\Local\Temp\calibre_qrf708kw\bfgtj7ta.kfx-zip
    
    Processing container: B00G6SK3EI_EBOK.azw
    
    Traceback (most recent call last):
    
      File "calibre_plugins.kfx_input.__init__", line 105, in convert
    
      File "calibre_plugins.kfx_input.kfxlib.yj_book", line 211, in decode_book
    
      File "calibre_plugins.kfx_input.kfxlib.yj_book", line 318, in get_container
    
    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container B00G6SK3EI_EBOK.azw has DRM and cannot be converted
    
    
    
    During handling of the above exception, another exception occurred:
    
    
    
    Traceback (most recent call last):
    
      File "runpy.py", line 194, in _run_module_as_main
    
      File "runpy.py", line 87, in _run_code
    
      File "site.py", line 82, in <module>
    
      File "site.py", line 77, in main
    
      File "site.py", line 49, in run_entry_point
    
      File "calibre\utils\ipc\worker.py", line 216, in main
    
      File "calibre\gui2\convert\gui_conversion.py", line 41, in gui_convert_override
    
      File "calibre\gui2\convert\gui_conversion.py", line 28, in gui_convert
    
      File "calibre\ebooks\conversion\plumber.py", line 1105, in run
    
      File "calibre\customize\conversion.py", line 245, in __call__
    
      File "calibre_plugins.kfx_in
    

    t.init“, line 125, in convert

    calibre.ebooks.DRMError: This book has DRM!
    
  3. Hello,
    I am trying to convert a dictionary I bought on Amazon.
    I use Windows 7 and Calibre 2.85.1. I tried updating to Calibre 5.0, but it refused due to my outdated OS.
    For this reason, I installed DeDRM_tools_6.8.1 in Calibre.
    I was not able to make Kindle 1.17 or 1.24 work for me (I couldn’t register them).
    I downloaded the book with Kindle 1.33.62002 for PC.
    I do not have a physical Kindle.
    Initially, when trying to convert the book in Calibre, I was getting this error message: “KFXError: This is an Amazon KFX book. It cannot be processed.”
    I followed the method “2 b)” listed on https://www.mobileread.com/forums/showthread.php?t=283371: “Method 2 – Disable KFX support in Kindle for PC/Mac – It is possible to prevent some versions of Kindle for PC/Mac from making use of KFX format. (…) For an alternate method that works with more recent versions of Kindle for PC see this post and this post (…) a batch file that edits registry keys”.
    Now, the conversion still fails, but I’m getting a different message: “Conversion impossible – this book is locked by DRMs.”
    The kind people at MobileRead advised me to ask for further help here.
    Is there anything I can do now?
    Thank you.

      • Thank you. Here’s the log:

        calibre Journal de débogage
        calibre 2.85.1 embedded-python: True is64bit: False
        Windows-7-6.1.7601-SP1 Windows (’32bit’, ‘WindowsPE’)
        32bit process running on 64bit windows
        (‘Windows’, ‘7’, ‘6.1.7601’)
        Python 2.7.9
        Windows: (‘7’, ‘6.1.7601’, ‘SP1’, ‘Multiprocessor Free’)
        Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 43, 0) && DeDRM (6, 8, 0) && Package KFX (from KFX Input) (1, 43, 0) && KFX metadata reader (from KFX Input) (1, 43, 0) && KFX Input (1, 43, 0)
        devicePixelRatio: 1.0
        logicalDpi: 96.0 x 96.0
        physicalDpi: 71.9842323651 x 71.9822878229
        Starting up…
        Started up in 29.02 seconds with 31 books
        stdout+stderr from file dialog helper: [”, ”]
        piped data from file dialog helper: [‘\xce\x809\x07\x96\x1c\xd6\x99\xd6\x9c\xc0\x84\x10\xaa\x02n\xa1/\x90\x8b\n\xd4\x05V\x0c\x90s-\xbcx{;’, ‘D:\ConvertKindleBooks\B0714PQMCL_EBOK_ApresBatch\B0714PQMCL_EBOK.azw’]
        Gather KFX-ZIP (from KFX Input) 1.43.0: Importing D:\ConvertKindleBooks\B0714PQMCL_EBOK_ApresBatch\B0714PQMCL_EBOK.azw
        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\Vi\AppData\Local\Temp\calibre_dtlixj\ofqvdf.kfx-zip
        DeDRM v6.8.0: Trying to decrypt ofqvdf.kfx-zip
        Using Library AlfCrypto DLL/DYLIB/SO
        Decrypting KFX-ZIP ebook: ofqvdf
        Found 0 keys to try after 0.4 seconds
        DeDRM v6.8.0: Failed to decrypt with error: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher
        DeDRM v6.8.0: Looking for new default Kindle Key after 0.4 seconds
        searching for kinfoFiles in C:\Users\Vi\AppData\Local
        Found K4PC 1.25+ kinf2018 file: C:\Users\Vi\AppData\Local\Amazon\Kindle\storage.kinf2018
        Found K4PC 1.9+ kinf2011 file: C:\Users\Vi\AppData\Local\Amazon\Kindle\storage.kinf2011
        Decrypted key file using IDString ‘3707549200’ and UserName ‘5669’
        Decrypted key file using IDString ‘3707549200’ and UserName ‘5669’
        DeDRM v6.8.0: Found 2 new keys
        Decrypting KFX-ZIP ebook: ofqvdf
        Got DSN key from database default_key_2
        Got DSN key from database default_key_1
        Found 2 keys to try after 29.6 seconds
        DeDRM v6.8.0: Ultimately failed to decrypt after 29.6 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 170, in _run_filetype_plugins
        File “calibre_plugins.dedrm.init“, line 626, in run
        File “calibre_plugins.dedrm.init“, line 576, in KindleMobiDecrypt
        DeDRMError: DeDRM v6.8.0: Ultimately failed to decrypt after 29.6 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
        Package KFX (from KFX Input) 1.43.0: Packaging C:\Users\Vi\AppData\Local\Temp\calibre_dtlixj\ofqvdf.kfx-zip
        Processing container: B0714PQMCL_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 170, 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 84, in convert_to_single_kfx
        File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 211, in decode_book
        File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 318, in get_container
        KFXDRMError: Book container B0714PQMCL_EBOK.azw has DRM and cannot be converted
        KFX metadata reader (from KFX Input) activated for C:\Users\Vi\AppData\Local\Temp\calibre_dtlixj\vj7lsi_add_books\0\B0714PQMCL_EBOK.kfx-zip
        Traceback (most recent call last):
        File “site-packages\calibre\customize\ui.py”, line 416, 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 149, in get_metadata
        Exception: Failed to locate a KFX container with metadata
        Added B0714PQMCL EBOK to db in: 0.2
        Added 1 books in 32.4 seconds

        • I just realized adding the book from a different folder might cause problems, and tried again from the normal folder:

          calibre Journal de débogage
          calibre 2.85.1 embedded-python: True is64bit: False
          Windows-7-6.1.7601-SP1 Windows (’32bit’, ‘WindowsPE’)
          32bit process running on 64bit windows
          (‘Windows’, ‘7’, ‘6.1.7601’)
          Python 2.7.9
          Windows: (‘7’, ‘6.1.7601’, ‘SP1’, ‘Multiprocessor Free’)
          Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 43, 0) && DeDRM (6, 8, 0) && Package KFX (from KFX Input) (1, 43, 0) && KFX metadata reader (from KFX Input) (1, 43, 0) && KFX Input (1, 43, 0)
          devicePixelRatio: 1.0
          logicalDpi: 96.0 x 96.0
          physicalDpi: 71.9842323651 x 71.9822878229
          Starting up…
          Started up in 7.32 seconds with 31 books
          stdout+stderr from file dialog helper: [”, ”]
          piped data from file dialog helper: [‘\xc9U\xb7\xd8\xc2\x03\x82#e2!\xef\xc8\xc0\xedA\xfe\xc73J\xd9\xd8\x8a\x1av\xbf\xf9\xf3.\x81\xf0\xf1’, ‘C:\Users\Vi\Documents\My Kindle Content\B0714PQMCL_EBOK\B0714PQMCL_EBOK.azw’]
          Gather KFX-ZIP (from KFX Input) 1.43.0: Importing C:\Users\Vi\Documents\My Kindle Content\B0714PQMCL_EBOK\B0714PQMCL_EBOK.azw
          Gather KFX-ZIP (from KFX Input): Gathered 3 file(s) as C:\Users\Vi\AppData\Local\Temp\calibre_z2j_c8\nfjdlf.kfx-zip
          DeDRM v6.8.0: Trying to decrypt nfjdlf.kfx-zip
          Using Library AlfCrypto DLL/DYLIB/SO
          Decrypting KFX-ZIP ebook: nfjdlf
          Found 0 keys to try after 0.2 seconds
          Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.21eeaceb-04ed-48a3-bbfd-522c21102885.voucher
          DeDRM v6.8.0: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
          DeDRM v6.8.0: Looking for new default Kindle Key after 0.2 seconds
          searching for kinfoFiles in C:\Users\Vi\AppData\Local
          Found K4PC 1.25+ kinf2018 file: C:\Users\Vi\AppData\Local\Amazon\Kindle\storage.kinf2018
          Found K4PC 1.9+ kinf2011 file: C:\Users\Vi\AppData\Local\Amazon\Kindle\storage.kinf2011
          Decrypted key file using IDString ‘3707549200’ and UserName ‘5669’
          Decrypted key file using IDString ‘3707549200’ and UserName ‘5669’
          DeDRM v6.8.0: Found 2 new keys
          Decrypting KFX-ZIP ebook: nfjdlf
          Got DSN key from database default_key_1
          Got DSN key from database default_key_2
          Found 2 keys to try after 30.8 seconds
          Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.21eeaceb-04ed-48a3-bbfd-522c21102885.voucher
          DeDRM v6.8.0: Ultimately failed to decrypt after 30.8 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 170, in _run_filetype_plugins
          File “calibre_plugins.dedrm.init“, line 626, in run
          File “calibre_plugins.dedrm.init“, line 576, in KindleMobiDecrypt
          DeDRMError: DeDRM v6.8.0: Ultimately failed to decrypt after 30.8 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
          Package KFX (from KFX Input) 1.43.0: Packaging C:\Users\Vi\AppData\Local\Temp\calibre_z2j_c8\nfjdlf.kfx-zip
          Processing container: B0714PQMCL_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 170, 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 84, in convert_to_single_kfx
          File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 211, in decode_book
          File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 318, in get_container
          KFXDRMError: Book container B0714PQMCL_EBOK.azw has DRM and cannot be converted
          KFX metadata reader (from KFX Input) activated for C:\Users\Vi\AppData\Local\Temp\calibre_z2j_c8\umdc06_add_books\0\B0714PQMCL_EBOK.kfx-zip
          C:\Program Files (x86)\Calibre2\pylib.zip\dateutil\parser.py:339: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode – interpreting them as being unequal
          Added Guide anglais-français de la traduction (French Edition) to db in: 0.7
          Added 1 books in 34.2 seconds
          Worker Launch took: 0.998000144958
          Job: 1 Conversion du livre 1 sur 1 (Guide anglais-français de la traduction (French Edition)) finished
          Conversion du livre 1 sur 1 (Guide anglais-français de la traduction (French Edition))
          C:\Program Files (x86)\Calibre2\pylib.zip\dateutil\parser.py:339: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode – interpreting them as being unequal
          Conversion options changed from defaults:
          cover: u’C:\Users\Vi\AppData\Local\Temp\calibre_z2j_c8\4r7q98.jpeg’
          allow_conversion_with_errors: True
          verbose: 2
          change_justification: u’left’
          read_metadata_from_opf: u’C:\Users\Vi\AppData\Local\Temp\calibre_z2j_c8\qzrwes.opf’
          output_profile: ‘generic_eink’
          Resolved conversion options
          calibre version: 2.85.1
          {‘allow_conversion_with_errors’: True,
          ‘asciiize’: False,
          ‘author_sort’: None,
          ‘authors’: None,
          ‘base_font_size’: 0.0,
          ‘book_producer’: None,
          ‘change_justification’: u’left’,
          ‘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’: u’C:\Users\Vi\AppData\Local\Temp\calibre_z2j_c8\4r7q98.jpeg’,
          ‘debug_pipeline’: None,
          ‘dehyphenate’: True,
          ‘delete_blank_paragraphs’: True,
          ‘disable_font_rescaling’: False,
          ‘duplicate_links_in_toc’: False,
          ’embed_all_fonts’: False,
          ’embed_font_family’: None,
          ‘enable_heuristics’: False,
          ‘expand_css’: False,
          ‘extra_css’: None,
          ‘filter_css’: u”,
          ‘fix_indents’: True,
          ‘font_size_mapping’: None,
          ‘force_max_line_length’: False,
          ‘format_scene_breaks’: True,
          ‘html_unwrap_factor’: 0.4,
          ‘inline_toc’: False,
          ‘input_encoding’: None,
          ‘input_profile’: <calibre.customize.profiles.InputProfile object at 0x0576D830>,
          ‘insert_blank_line’: False,
          ‘insert_blank_line_size’: 0.5,
          ‘insert_metadata’: False,
          ‘isbn’: None,
          ‘italicize_common_cases’: True,
          ‘keep_color’: False,
          ‘keep_image_references’: False,
          ‘keep_ligatures’: False,
          ‘keep_links’: 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_line_length’: 0,
          ‘max_toc_links’: 50,
          ‘minimum_line_height’: 120.0,
          ‘newline’: u’system’,
          ‘no_chapters_in_toc’: False,
          ‘no_inline_navbars’: False,
          ‘output_profile’: <calibre.customize.profiles.GenericEink object at 0x0576DA30>,
          ‘page_breaks_before’: u’/’,
          ‘prefer_metadata_cover’: False,
          ‘pretty_print’: False,
          ‘pubdate’: None,
          ‘publisher’: None,
          ‘rating’: None,
          ‘read_metadata_from_opf’: u’C:\Users\Vi\AppData\Local\Temp\calibre_z2j_c8\qzrwes.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,
          ‘transform_css_rules’: ‘[]’,
          ‘txt_output_encoding’: u’utf-8′,
          ‘txt_output_formatting’: u’plain’,
          ‘unsmarten_punctuation’: False,
          ‘unwrap_lines’: True,
          ‘use_auto_toc’: False,
          ‘verbose’: 2}
          InputFormatPlugin: KFX Input running
          on C:\Users\Vi\AppData\Local\Temp\calibre_z2j_c8\3vqtdl.kfx-zip
          Software versions: KFX Input 1.43.0, calibre 2.85.1, Windows-7-6.1.7601-SP1
          KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290
          Converting C:\Users\Vi\AppData\Local\Temp\calibre_z2j_c8\3vqtdl.kfx-zip
          Processing container: B0714PQMCL_EBOK.azw
          Traceback (most recent call last):
          File “calibre_plugins.kfx_input.init“, line 105, in convert
          File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 211, in decode_book
          File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 318, in get_container
          KFXDRMError: Book container B0714PQMCL_EBOK.azw has DRM and cannot be converted
          Python function terminated unexpectedly
          This book has DRM! (Error Code: 1)
          Traceback (most recent call last):
          File “site.py”, line 132, in main
          File “site.py”, line 109, in run_entry_point
          File “site-packages\calibre\utils\ipc\worker.py”, line 195, in main
          File “site-packages\calibre\gui2\convert\gui_conversion.py”, line 33, in gui_convert_override
          File “site-packages\calibre\gui2\convert\gui_conversion.py”, line 26, in gui_convert
          File “site-packages\calibre\ebooks\conversion\plumber.py”, line 1088, in run
          File “site-packages\calibre\customize\conversion.py”, line 245, in call
          File “calibre_plugins.kfx_input.init“, line 125, in convert
          calibre.ebooks.DRMError: This book has DRM!

        • You’re still getting KFX format which cannot be decrypted from the latest version of the Kindle app. Delete the book from calibre and your Kindle content folder. Start Kindle for PC with the batch file and redownload the book. Make sure there’s no md or voucher files in the folder with the azw (that would mean it’s kfx). Add that to calibre and hopefully that will work.

    • Is this a Dictionary for installing on the Kindle?
      My experience was (that maybe wrong or have changed), that these Dictionaries have different DRM that DeDRM cannot remove.
      It may be possible to buy the Dictionary in a different format – the ones I checked where also available for EPUB-readers. This may or may not solve your problem, but I can understand if you are not willing to buy that Dictionary again – although with Amazon you could give it back, if you bought it a few days ago, the timeframe is 14 days imho.

  4. I don’t know what’s happened. I didn’t change anything from my end, and then things just “broke”.
    Let me explain.
    I use Linux Mint. I have Adobe Digital Editions (Version 2.0.1 78765). I installed that through Lutris. For a long time, I could just drag and drop the ACSM file into ADE, and ADE would download the book (I then proceed with the next steps of adding that book into Calibre, which has Apprentice Alf files). But since about a week ago, when I drag and drop the ACSM file into ADE, I get this error message:

    Connection Error Detected

    Digital Editions could not connect to the fulfillment server. Please make sure you are connected to the Internet.

    But I am connected to the internet. I’m typing this message on the same laptop that has ADE.

    I’ve tried uninstalling ADE and then reinstalling but I still get the same error message.

    I’m authorizing with an AdobeID. (Someone reading may say there’s a problem with AdobeID authorization or there’s a probem with your AdobeID. My response is, when I use the same AdobeID on ADE on my Android phone, I can download the ebook just fine).

  5. Hi Alf,
    Thanks for all your information and the plugins. I’m not super tech savy so it’s super helpful to have all this information.

    I am trying to remove the DRM from an amazon kindle book I purchased but I can’t seem to even with the plugins installed and I’ve read all your FAQs and tried the troubleshooting instructions? Please help! Thanks!

    Here is the log
    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    2021-09-30 22:49:08.647 Calibre[2447:65697] deliverNotificationWithTitle()
    * Notification delivered.
    calibre Debug log
    calibre 2.3 isfrozen: True is64bit: True
    Darwin-16.7.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘16.7.0’, ‘Darwin Kernel Version 16.7.0: Sun Jun 2 20:26:31 PDT 2019; root:xnu-3789.73.50~1/RELEASE_X86_64’)
    Python 2.7.8
    OSX: (‘10.12.6’, (”, ”, ”), ‘x86_64’)
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) && DeDRM && Package KFX (from KFX Input) && KFX metadata reader (from KFX Input) && KFX Input && Obok DeDRM
    Starting up…
    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
    Started up in 10.53 seconds with 3 books
    Worker Launch took: 0.133413076401
    Job: 1 Read metadata (0 of 1) finished
    Read metadata (0 of 1)
    DeDRM v6.8.0: Trying to decrypt Alpha Night (Psy-Changeling Trinity).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: Alpha Night (Psy-Changeling Trinity)
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.8.0: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.8.0: Looking for new default Kindle Key after 0.1 seconds
    No k4Mac kindle-info/rainier/kinf2011 files have been found.
    DeDRM v6.8.0: Ultimately failed to decrypt after 0.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 154, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 626, in run
    File “calibre_plugins.dedrm.init“, line 576, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.8.0: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md

    Added Alpha Night (Psy-Changeling Trinity) to db in: 0.323155879974 seconds
    Worker Launch took: 0.2537150383
    Job: 2 Convert book 1 of 1 (Alpha Night (Psy-Changeling Trinity)) finished
    Convert book 1 of 1 (Alpha Night (Psy-Changeling Trinity))
    Resolved conversion options
    calibre version: 2.3.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’: u’/var/folders/4q/yvh7fc39769c8fjcw5b04xd80000gp/T/calibre_2.3.0_tmp_RepVrs/Cq0AGG.jpeg’,
    ‘debug_pipeline’: None,
    ‘dehyphenate’: True,
    ‘delete_blank_paragraphs’: True,
    ‘disable_font_rescaling’: False,
    ‘dont_compress’: False,
    ‘duplicate_links_in_toc’: False,
    ’embed_all_fonts’: False,
    ’embed_font_family’: None,
    ‘enable_heuristics’: False,
    ‘expand_css’: False,
    ‘extra_css’: None,
    ‘extract_to’: None,
    ‘filter_css’: u”,
    ‘fix_indents’: True,
    ‘font_size_mapping’: None,
    ‘format_scene_breaks’: True,
    ‘html_unwrap_factor’: 0.4,
    ‘input_encoding’: None,
    ‘input_profile’: <calibre.customize.profiles.InputProfile object at 0x10dc5bd90>,
    ‘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,
    ‘mobi_file_type’: u’old’,
    ‘mobi_ignore_margins’: False,
    ‘mobi_keep_original_images’: False,
    ‘mobi_toc_at_start’: False,
    ‘no_chapters_in_toc’: False,
    ‘no_inline_navbars’: False,
    ‘no_inline_toc’: False,
    ‘outp

    • Looks like you need to enter your Kindle’s serial number into DeDRM’s customization. This will work for an E-ink Kindle (not a Fire). Incidentally you could update calibre. Version 3.48 should work with Sierra.

      • Thanks Laura for replying!

        Question though, how do I enter my e-ink kindle’s serial number into de-drm customization ? Which buttons do I press in calibre to do this ? I’m not super tech savvy… I found my kindle’s serial number though so yay for that at least 😉 Please let me know! Thanks !

        -Andrea

        • Open calibre and click on the Preferences icon. If you don’t see it, hit control-P. Click on the Plugins icon in the bottom row. Type dedrm in the search box and hit enter. The DeDRM (7.2.1) item should now be highlighted. Click on the Customize plugin button. Click on the eInk Kindle ebooks button. Enter your serial number there. I would recommend getting the serial number from the Amazon Manage Your Content & Devices page to save the possibility of mistyping it. You should now be able use Download & transfer via USB to download the ebook.

  6. Any chance anyone has had any success with Nook ebooks? Had to purchase one from them as they were only source and would like to convert to dox so I can incorporate into my Logos app.

  7. calibre, version 5.29.0 (win32, embedded-python: True)
    Conversion error: Failed: Convert book 1 of 1 (Auschwitz ultima statie)

    Convert book 1 of 1 (Auschwitz ultima statie)
    DeDRM v7.2.1: Trying to decrypt 2tqq_1s_.pdf
    DeDRM v7.2.1: 2tqq_1s_.pdf is a PDF ebook
    DeDRM v7.2.1: Looking for new default Adobe Digital Editions Keys after 0.0 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.1 seconds
    DeDRM v7.2.1: 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
    Conversion options changed from defaults:
    read_metadata_from_opf: ‘C:\Users\andre\AppData\Local\Temp\calibre_lotoniiz\cnfsyqsd.opf’
    output_profile: ‘kindle_pw3’
    pdf_serif_family: ‘MS Shell Dlg 2’
    pdf_sans_family: ‘MS Shell Dlg 2’
    verbose: 2
    Resolved conversion options
    calibre version: 5.29.0
    {‘asciiize’: False,
    ‘author_sort’: None,
    ‘authors’: None,
    ‘base_font_size’: 0.0,
    ‘book_producer’: None,
    ‘change_justification’: ‘original’,
    ‘chapter’: “//[((name()=’h1′ or name()=’h2′) and re:test(., ”
    “‘\s
    ((chapter|book|section|part)\s+)|((prolog|prologue|epilogue)(\s+|$))’, ”
    “‘i’)) or @class = ‘chapter’]”,
    ‘chapter_mark’: ‘pagebreak’,
    ‘comments’: None,
    ‘cover’: None,
    ‘custom_size’: None,
    ‘debug_pipeline’: None,
    ‘dehyphenate’: True,
    ‘delete_blank_paragraphs’: True,
    ‘disable_font_rescaling’: False,
    ‘duplicate_links_in_toc’: False,
    ’embed_all_fonts’: False,
    ’embed_font_family’: None,
    ‘enable_heuristics’: False,
    ‘expand_css’: False,
    ‘extra_css’: None,
    ‘filter_css’: ”,
    ‘fix_indents’: True,
    ‘font_size_mapping’: None,
    ‘format_scene_breaks’: True,
    ‘html_unwrap_factor’: 0.4,
    ‘input_encoding’: None,
    ‘input_profile’: <calibre.customize.profiles.InputProfile object at 0x07BD6AF0>,
    ‘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,
    ‘new_pdf_engine’: False,
    ‘no_chapters_in_toc’: False,
    ‘no_images’: False,
    ‘no_inline_navbars’: False,
    ‘output_profile’: <calibre.customize.profiles.KindlePaperWhite3Output object at 0x07BD6DF0>,
    ‘page_breaks_before’: “//*[name()=’h1′ or name()=’h2′]”,
    ‘paper_size’: ‘letter’,
    ‘pdf_add_toc’: False,
    ‘pdf_default_font_size’: 20,
    ‘pdf_footer_template’: None,
    ‘pdf_header_template’: None,
    ‘pdf_hyphenate’: False,
    ‘pdf_mark_links’: False,
    ‘pdf_mono_family’: ‘Courier’,
    ‘pdf_mono_font_size’: 16,
    ‘pdf_odd_even_offset’: 0.0,
    ‘pdf_page_margin_bottom’: 72.0,
    ‘pdf_page_margin_left’: 72.0,
    ‘pdf_page_margin_right’: 72.0,
    ‘pdf_page_margin_top’: 72.0,
    ‘pdf_page_number_map’: None,
    ‘pdf_page_numbers’: False,
    ‘pdf_sans_family’: ‘MS Shell Dlg 2’,
    ‘pdf_serif_family’: ‘MS Shell Dlg 2’,
    ‘pdf_standard_font’: ‘serif’,
    ‘pdf_use_document_margins’: False,
    ‘prefer_metadata_cover’: False,
    ‘preserve_cover_aspect_ratio’: False,
    ‘pretty_print’: False,
    ‘pubdate’: None,
    ‘publisher’: None,
    ‘rating’: None,
    ‘read_metadata_from_opf’: ‘C:\Users\andre\AppData\Local\Temp\calibre_lotoniiz\cnfsyqsd.opf’,
    ‘remove_fake_margins’: True,
    ‘remove_first_image’: False,
    ‘remove_paragraph_spacing’: False,
    ‘remove_paragraph_spacing_indent_size’: 1.5,
    ‘renumber_headings’: True,
    ‘replace_scene_breaks’: ”,
    ‘search_replace’: ‘[]’,
    ‘series’: None,
    ‘series_index’: None,
    ‘smarten_punctuation’: False,
    ‘sr1_replace’: None,
    ‘sr1_search’: None,
    ‘sr2_replace’: None,
    ‘sr2_search’: None,
    ‘sr3_replace’: None,
    ‘sr3_search’: None,
    ‘start_reading_at’: None,
    ‘subset_embedded_fonts’: False,
    ‘tags’: None,
    ‘timestamp’: None,
    ‘title’: None,
    ‘title_sort’: None,
    ‘toc_filter’: None,
    ‘toc_threshold’: 6,
    ‘toc_title’: None,
    ‘transform_css_rules’: ‘[]’,
    ‘uncompressed_pdf’: False,
    ‘unit’: ‘inch’,
    ‘unsmarten_punctuation’: False,
    ‘unwrap_factor’: 0.45,
    ‘unwrap_lines’: True,
    ‘use_auto_toc’: False,
    ‘use_profile_size’: False,
    ‘verbose’: 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.1 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    DeDRM v7.2.1: Trying to decrypt 2tqq_1s_.pdf
    DeDRM v7.2.1: 2tqq_1s_.pdf is a PDF ebook
    DeDRM v7.2.1: Looking for new default Adobe Digital Editions Keys after 0.0 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.1 seconds
    DeDRM v7.2.1: 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 “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.1 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    InputFormatPlugin: PDF Input running
    on C:\Users\andre\AppData\Local\Temp\calibre_lotoniiz\2tqq_1s_.pdf
    Converting file to html…
    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 216, in main
    File “calibre\gui2\convert\gui_conversion.py”, line 41, in gui_convert_override
    File “calibre\gui2\convert\gui_conversion.py”, line 28, in gui_convert
    File “calibre\ebooks\conversion\plumber.py”, line 1105, in run
    File “calibre\customize\conversion.py”, line 245, in call
    File “calibre\ebooks\conversion\plugins\pdf_input.py”, line 54, in convert
    File “calibre\ebooks\pdf\pdftohtml.py”, line 83, in pdftohtml
    calibre.ebooks.ConversionError: pdftohtml failed with return code: 1
    Syntax Error: Couldn’t find the ‘EBX_HANDLER’ security handler
    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

    I bought the book, i want to read it on a kindle paperwhite, but i can’t. pls, help

  8. Hi there. I have Calibre 5.29.0 and Version 7.21 of the de-drm tools. The Calibre plugin was installed fine. However, it is not removing the DRM from some ebooks. I choose ‘download to USB’ from Amazon UK, so I can import my ebooks into Calibre and convert, sorting the formatting etc. I downloaded this book (https://www.amazon.co.uk/gp/product/B09BDHQK6H/ref=ppx_yo_dt_b_d_asin_title_o00?ie=UTF8&psc=1), and imported it into Calibre. I went to open it with the Ebook Viewer and got the message “This book is locked by DRM.” I have no idea why this is happening, as it should’ve had the DRM removed when added. I’ve deleted the book in question from Calibre and re-imported it, making sure to have the ‘Automerge’ function checked in the ‘Adding Book’s section of Calibre Preferences, just in case. Nothing seems to work, and I don’t know what else to do. Any help would be hugely appreciated.

  9. Hello.
    Thank you for your hard work on this!
    Mine seems to not be working for some reason.

    – which tool was used – DeDRM + KFX Input + Calibre
    – which OS you are using – Windows 10 Pro x64
    – where the ebook file came from (device or application) – Kindle for PC Application downloaded from Amazon’s website
    – any error messages – None
    – a log of the DRM-removal attempt (see the FAQs on how to get a log) – Please see below.

    calibre Debug log
    calibre 5.29 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, 44, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 44, 0) && KFX metadata reader (from KFX Input) (1, 44, 0) && KFX Input (1, 44, 0) && Set KFX metadata (from KFX Output) (1, 56, 0) && KFX Output (1, 56, 0) && Obok DeDRM (7, 2, 1)
    calibre 5.29 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, 44, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 44, 0) && KFX metadata reader (from KFX Input) (1, 44, 0) && KFX Input (1, 44, 0) && Set KFX metadata (from KFX Output) (1, 56, 0) && KFX Output (1, 56, 0) && Obok DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 2.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 80.34266886326195 x 79.51304347826087
    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.92] main UI initialized…
    [0.92] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.44.0: Importing C:\Users\Saini\Documents\My Kindle Content\B087Y66C5M_EBOK\B087Y66C5M_EBOK.azw
    Gather KFX-ZIP (from KFX Input): Gathered 4 file(s) as C:\Users\Saini\AppData\Local\Temp\calibre_k9hlwfx4\kx912611.kfx-zip
    DeDRM v7.2.1: Trying to decrypt kx912611.kfx-zip
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: kx912611
    Found 0 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.1cd4adf9-96d9-4ef7-a322-62bd24ebc2b9.voucher
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\Saini\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\Saini\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\Saini\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    DeDRM v7.2.1: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\Saini\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\Saini\AppData\Local\Amazon\Kindle\storage.kinf2018
    [3.84] splash screen hidden
    [3.86] Started up in 3.86 seconds with 1 books
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b’\xa8\x8c\xce\xe1\x87\x84`\x10\xab\xd7\n\x86\xedwO\x07 P\xf8~\xf62\xd1\x1a\xbfO\xcd\xd3\xf4L\xa6e’, b’C:\Users\Saini\Documents\My Kindle Content\B087Y66C5M_EBOK\B087Y66C5M_EBOK.azw’]
    Decrypted key file using IDString ‘2497878320’ and UserName ‘Mani’
    DeDRM v7.2.1: Found 1 new key
    Decrypting KFX-ZIP ebook: kx912611
    Got DSN key from database default_key_1
    Found 1 keys to try after 2.8 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.1cd4adf9-96d9-4ef7-a322-62bd24ebc2b9.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\Saini\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\Saini\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\Saini\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\Saini\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\Saini\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\Saini\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    DeDRM v7.2.1: Ultimately failed to decrypt after 2.8 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Package KFX (from KFX Input) 1.44.0: Packaging C:\Users\Saini\AppData\Local\Temp\calibre_k9hlwfx4\kx912611.kfx-zip
    Processing container: B087Y66C5M_EBOK.azw
    KFX metadata reader (from KFX Input) activated for C:\Users\Saini\AppData\Local\Temp\calibre_k9hlwfx4\8gfwwbmu_add_books\0\B087Y66C5M_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 2.8 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Running file type plugin Package KFX (from KFX Input) failed with traceback:
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 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 84, in convert_to_single_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 211, in decode_book
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 318, in get_container
    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container Added BeMo’s Ultimate Guide to Medical School Interview: How to Ace Your Med School Interview without Memorizing any Sample Questions to db in: 0.1
    Added 1 books in 3.3 seconds

  10. Hi all.

    I need to install PyCrypto under Windows 7, but the site pointed in the “DeDRM_App_ReadMe.txt” file from the DeDRM_tools_6.6.3 zip does not exist. I would thank very much any information about installing that without compiling: I need the binaries.

      • Because I would prefer to keep my EPUBs clean & tidy. Although I do not like Calibre at all, under Windows 7, what Calibre version would I need?

        Better yet: is there anyway to ddrm Adobe ePub files under 64bits MacOS?

          • As far as I know, Adobe Digital Editions version 2.0 is required to ddrm Adobe ePubs and it can not run in 64 bits OSs. Please, explained me how to do it.

        • Looks like the calibre folks recommend 3.48 for Windows 7. You would need DeDRM 6.8.1 for that. Whether you can DeDRM Adobe epubs downloaded with ADE 4.5 depends on whether the ebookstore is using the hardened DRM. And that seems to be pretty rare. You can certainly use calibre and DeDRM on the latest MacOS.

  11. I use to ddrm my ebooks using the standalone app: that way warrants that the original styles in the css file are not replaced and the original structure of the ePub is also conserved. Years ago I tried Calibre, but was impossible for me to set it to no altere the original ebook aside the ddrm thing…

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.