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.

  • Share/Bookmark

65 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.


Leave a Reply