Using inept to strip DRM for better viewing

Anathem
Image via Wikipedia

(Update: This post wasn’t intended as a how-to but people are getting some use out of it. To fill in the gaps, here is an article on how to install the required tools like pycrypto.)

I remove DRM whenever possible because I lost a few iTunes tracks. Also, since the FoxIt eSlick won’t work with DRM immediately, I wanted to be able to test how readily I could use purchases on my eink reader. I’m not intending to pirate ebooks here. It turns out that until a new version of ADEPT comes out I don’t have anything to worry about. The process is easy, fast, and appears to be lossless.

I found out about tools to unwrap DRM from e-books when a DCMA takedown notice was used to remove two python scripts. I managed to snag copies of the suppressed python scripts (ineptpdf.pyw, ineptkey.pyw for Windows or ineptkeymac.pyw for OS X, ineptepub.pyw) from the slashdot comments more easily than my copy of Adobe Digital Editions from the Adobe site, since their web installer failed repeatedly and I had to hunt down the EXE.

So, while I install I ask on Twitter where to buy some ePub or ADEPT ebooks. Someone suggested BooksOnBoard. They have a copy of Anathem in ADEPT format for $18.07 after the 1% Google Checkout discount, about $2 less than the cost of the hardcover. I’m not happy that it’s so expensive for an electronic copy but I decide to pay anyways because I can’t find another ADEPT copy, let alone cheaper.

I download the 16 megabyte book through Adobe Digital Editions in about a minute and then execute ineptkey.pyw. It notifies me that my key has been stored in adeptkey.der. Next, I run ineptpdf.pyw. I’m greeted with a dialogue box asking me for the key file, the input file, and the output destination. It turns out that the ebook I bought got sent to My Documents/My Digital Editions/. I fill out all the required boxes and click decrypt.

There’s no progress bar, just the hourglass for about thirty seconds, and then it goes away. No success or failure message.

Just to make sure that the PDF I downloaded from BooksOnBoard was encrypted I tried to open it with FoxIt Reader. I get the error “This document is encrypted with some unsupported security handler.” Okay, now I try to open up the decrypted version. Success!

Everything looks to be in tact, including the chapter bookmarks and graphics. I opened it up side by side with the Adobe Digital Edition and started from chapter six, where I left off from the library book. The two did not look alike.

It turns out that the decrypted version looks better! Take a look at the screenshots below, particularly the middle one which compares the Adobe Digital Edition to the decrypted PDF.

Apparently the ebook I bought contains PDF features that Adobe Digital Editions does not support. FoxIt Reader does, though! I’m stunned to think that if I didn’t break the DMCA I’d be stuck with a product that wasn’t just less flexible, but that was inferior!

I wasn’t the only success, but there were a few others having issues. Mobileread has a thread on the inept decryptor.

85 Comments to “Using inept to strip DRM for better viewing”

  1. aman207 1 May 2010 at 1:33 pm #

    DOES ANYBODY KNOW HOW TO GENERATE THE CERTIFICATE????

  2. Citizentoni 15 May 2010 at 10:42 am #

    Thank you! I purchased a book with Adobe Editions a while ago but I never read it because I found the DRM annoying. Your post was invaluable, thank you Mr.Lance!
    To everyone: remember to always use the latest version of ineptpdf and ineptkey if you see ANY problem.

  3. SAK 24 May 2010 at 2:56 am #

    Lovely ! you are simply great. I purchased a ebook just to find out I can’t print it. I tried the scripts you have given above and it worked beautifully. May god bless you !

  4. pc 25 May 2010 at 8:24 am #

    great Tutorial – also works with eBooks ‘borrowed’ from library

  5. jconway 6 June 2010 at 4:54 pm #

    I think I’ve got everything I need. But I need a bit more of a step by step on how to actually strip the DRM. I have a ePub file, how (exactly) do I run the scripts? Please assume I know nothing about what I am doing, because I don’t.

    Thank you,

    John

  6. DrLarryE 7 June 2010 at 9:18 pm #

    Looks like Lance has abandoned this blog

  7. Ann 15 June 2010 at 9:23 am #

    I am unable to use the ineptPDF-7.4 Converter.

    I choose the Input file and then the output folder but am getting the ERROR : error decrypting book session key.

    And now I am not able to see any of the files on my Adobe Digital Editions.

  8. lance_ 16 June 2010 at 6:08 pm #

    Hi guys,

    Sorry, I don’t buy ebooks all that frequently. I’ve still got a huge backlog to read! I haven’t been testing the new scripts because I haven’t been buying.

    As far as advice goes, Citizentoni is right that you’re best off searching for a newer version if you ever see an issue. Generally you can find them by following the i heart cabbages blog, the one run by writer of the original script. People post pastebin links to newer versions of the scripts in the comments, just read the most recent comments first. You might be able to get some support in the comments too.

    Sorry to hear about the ADE problem Ann, are the originals still okay? Ineptpdf should leave the originals in tact.

  9. Ann 17 June 2010 at 10:19 am #

    Lance,

    Nothing I do seems to be working…

    Have not got the files back… don’t know whats wrong…

  10. fr3dly 9 July 2010 at 4:17 pm #

    this worked like a charm for the five free books i got when i installed borders desktop.

    easily removed the drm from the five .epub files so i could import them into aldiko on my droid incredible.

    i can’t stand drm.

    thanks.

  11. joblack 14 July 2010 at 10:21 pm #

    For the decryption key error you need to get the ineptkey version 5 and reread the adeptkey.der file. You got an old ineptkey version which isn’t working anymore …

  12. lynneth 27 July 2010 at 6:18 am #

    Thanks a million for this: it worked like a dream.

  13. Joseph 16 August 2010 at 9:27 pm #

    Thank you for this. I bought a textbook that only allowed me to download to two different computers. If I put one on my home computer and get stuck on different machines in school I would be screwed. This is great.

  14. EMB 19 August 2010 at 6:06 pm #

    By buying DRM-encumbered ebooks (and overpriced ones at that), you’re supporting DRM, even if you can (and do) remove it.

  15. joblack 19 August 2010 at 6:47 pm #

    Yes you support DRM if you buy a DRMed e-book but I think there will be no way that publishers will publish drm free e-books in a large scale.

  16. DVD Video Software 23 November 2010 at 4:12 am #

    Here is a full guide on How to remove drm from epub use inept script.
    http://www.dvdvideosoftware.org/guide/remove-drm-from-adobe-epub.html

  17. Bulava 2 December 2010 at 8:36 pm #

    Running ineptkey.pyw (v5) i am getting the error: “Failed to decrypt user key key (sic)” – any suggestion?

  18. joblack 2 December 2010 at 10:30 pm #

    Create a new adeptkey.der with the NEWEST ineptkey.

  19. bilbo 7 December 2010 at 7:31 pm #

    Marvelous! Just bought a revision kit ebook with which it is not practical to keep flicking front to back to check answers on a pc screen. This saves taking screenshots and printing out. Thanks.

  20. PRG 13 December 2010 at 2:36 pm #

    Thank you so much for this. Been having so much trouble trying to read a drm pdf on my iphone.

    Many thanks!!

  21. asdsdasdsadas 21 December 2010 at 7:44 am #

    Aweseme post. I previousally to spend alot of my time wakeboarding and watching games. It was possibly the most memorable time of my young life and your content somehow brought back us of that time. Thank You

  22. Perrino 1 January 2011 at 7:30 pm #

    Good point of view. Keep it up. See you

  23. pilling6479 4 January 2011 at 11:56 pm #

    I am also getting the failed to decrypt user key key (sic.) error ….. .anybody found a solution to this yet please! I lost my sony reader recently – and want to upload some of the books i’ve already bought (and not yet read…) to my Kindle!
    Thanks

  24. Suge 21 January 2011 at 8:53 pm #

    Any solution found to the “failed to decrypt user key key (sic)” error?

  25. joblack 21 January 2011 at 9:12 pm #

    Use the *newest* ineptkey and ineptepub, regenerate the adeptkey.der and you’re fine

  26. suge 22 January 2011 at 10:09 pm #

    @joblack21 – i used the newest versions of both files (5 and 5.2 respectively) straight from the ‘i♥cabbages’ home page (http://i-u2665-cabbages.blogspot.com/). Unfortunatelly it wasn’t the solution. What turned out to be the solution was to remove ADE 1.7.2 and re-install the old version (1.7.1) and activate it. It was difficult to find this old version but i got the download link from some other blog. Cheers.

  27. [...] Calibre to convert your ePub to Mobi if they aren’t DRM or if it is you’ll need to use Inept to remove [...]

  28. ePUBee 15 May 2011 at 8:00 pm #

    Remove drm from epub? Just download a free program called ePUBee here http://www.epubee.com, free drm removal, best quality and quickly!

  29. drm removal 17 June 2011 at 1:51 am #

    Digital Rights Management (DRM) is directly promoted by the protection requiremnets of poperty rights

  30. Roman 11 July 2011 at 7:37 pm #

    Hi,
    I followed your advice, I can get the key, but the file “ineptpdf.pyw” cannot be downloaded anymore.
    Could you help me ?
    Thanks.

  31. lance_ 11 July 2011 at 10:18 pm #

    Hi Roman,

    Try apprenticealf.wordpress.com for the latest version of the tools.

  32. remove wmv drm 28 November 2011 at 6:04 am #

    remove wmv drm (DRM) is directly promoted by the protection requiremnets of poperty rights

  33. gking 24 February 2012 at 8:26 am #

    excellent article, thanks a lot. u rock

  34. Tired 20 May 2012 at 10:37 pm #

    What I find so frustrating is that as a self published writer I can’t even publish MY OWN epub files for Kindle, (my own copyright) because I’ve used Indesign to create the epub. I had no problems with version 5, its only version 6, and i’m so annoyed I’ve wasted my money buying Indesign.
    Dumb.

  35. amy 11 December 2012 at 10:49 pm #

    I just find a software it can remove drm from media .
    http://www.dvdvideosoftware.org/aimersoftmediaconverter.html


Leave a Reply