How-to: decrypt an ebook

In no way is this article meant to condone piracy. It is simply meant as a method of user empowerment in their private virtual space, and aiming at a longer experience of purchased items. 

Books On Board closed in April 2013 with a two-week notice. Sony’s Reader Store closes in two weeks’ time on March-20, 2014, unlike Books On Board porting users’ book loot toward Kobo Books. With the prospect of bookstores that hold your book collections going out of business, what are your chances as an individual user? Commercial, non-public domain books you purchase are provided with DRM (digital rights management) and come with their set of limitations. If you do not want to end up paying for the same ebook twice, maybe there is something you can do about it. Re-assuming ownership for private use of purchased contents, may, in this case be the solution.

How to strip DRM from an ebook

The official solution from Books On Board for their users’ book collection is stripping DRM from purchased contents in order to further be able to use purchased contents on their various devices. DRM removal is a serious business, and should not be used as a way to infringe anyone’s copyright, and/or disseminate copyrighted material with or without financial gain. Therefore caution is required from behalf of those readers who wish to perform the below operations on their purchased digital content.

2000px-EPUB_logo.svgBelow you have a step-by-step description of the procedure that one should follow. In our example we used an *.epub book and decrypted it on a Mac. Several solutions exist for other book formats, and other operating systems. Even for a non-technical mind, the operations below should prove easy to follow, and the result will be an ebook copy stripped of its DRM.

1. Install Python. Get and mount the disk image from here.

2. Install Pycrypto. Get the *.zip archives from here

Detailed instructions on Python and Pycrypto installation with screenshots can be found here.

3.  Download your ‘Santa helpers’. They are: ineptkey.pyw and ineptepub.pyw. Consider storing them in a folder that’s readily accessible, and at the same time less likely to be deleted.

4. Start Python.

5. Choose File>Open, and navigate toward the location on your disk where ineptkey.pyw is stored.

6. On OK, your adeptkey.der will be downloaded. Consider storing it together with the files under .3, since you are going to need it again.

Steps 4-6 are only necessary once, upon first running the decrypting process. With your second decryption onward, you can jump directly to step 7, and ignore steps 1.-6.

7. Start Python [again].

8. Choose File>Open, and navigate toward the location on your disk where ineptepub.pyw is stored.

How to download your purchased ebook?

Most websites offer you an *.acsm file which you can download from your online library once you purchased the book. This is a secure link containing your personal key, and not the actual book. In order to download for real the ebook, you need to open the respective *.acsm file with a relevant reader app. I recommend Adobe Digital Editions (free download from here), which, unlike Apple’s own iBooks app, will let you manage your library. A default folder with the purchased & downloaded books will be created in Documents>Digital Editions.

9. On OK, lo and behold, Terminal will be prompted for you, and run, until a process window will pop up.

10.  If this is the first time you use, in the Key file field, insert your key. In order to do so, navigate with the … button toward the location on your drive where the adeptkey.der file is stored, and choose it. If no major changes occur in your operation system, this is a one-time process, with future decryptions the setting will still be there.

11. In the Input file field, insert your ebook with DRM. In order to do so, navigate with the … button toward the location on your drive where you downloaded your ebook, and click OK.

12. In the Output file field, insert the new name and location of the DRM-free ebook you wish to create. In order to do so, navigate with the … button toward the location on your drive where you want the ebook to be available, and choose a name for it.

13. On pressing Decrypt, you will be notified about the success of the decryption process directly in the popup window. Your ebook is now DRM-free, and can be used on a variety of devices you own, for an unlimited number of times and uses.

14. Check your ebook on your reader app on your computer, and/or reading devices.

What can go wrong

Despite the price you pay and the assumption that people who sell ebooks know what they are doing, you cannot expect all ebooks to have a valid format. Poorly formatted ebooks will not actually decrypt well, because the source document is not 100% O.K. Images could be missing in your resulting de-DRM-ed ebook, or navigation, or any combination of features you actually thought you had bought.

In order to troubleshoot an ebook that you cannot decrypt, please follow the steps below.

1. Locate your downloaded ebook with DRM. Just to be on the safe side, make a copy of it.

2. Renane the extension of the ebook, from *.epub to *.zip. Confirm your choice.

3. Move the *.zip to an area or new folder where you will not be distracted by other existing items – upon completing no. 3 instead of one file you will have more folders and files and you will need them all.

4. Unarchive the newly created *.zip with a high compression ratio program such as 7zX – you can download it from here.

5. Make a new folder containing the unarchived items resulting from step 3.

6. Re-archive the *.epub using a program such as ePub Zip – you can download it from here.

7. Now you have reassembled your *.epub ebook with higher chances to decrypt it successfully. What you have is still an ebook protected by DRM, but one with which you can actually go back to steps 7-14 from the decrypting procedure with higher chances to succeed.

Why do you need to strip the DRM of your ebooks? As an ebook reader, what do you feel about shops with whom you shopped and close down? What are your favorite shopping venues for ebooks? 

Leave a Reply

Your email address will not be published. Required fields are marked *

This is a personal website. About and how-to's here. || Released under a Creative Commons Attribution-ShareAlike 4.0 International License. More here . || Certain areas of the website are intended for registered users only. Register here.  || Download site app from the AppStore. || Online since 2008.

Octavian Logigan How may I help you?