A WINE Remedy for acsm epub DRM Adobe ADEs

Using WINE in linux, you can turn that DRM laden .acsm file into a readable .epub for your Nook or other device, whether Adobe likes it or not!

You are here because you either bought an ebook or borrowed one from your local library only to be left with a useless .acsm file. You run a free, open source operating system that is not supported by Adobe and all those other tutorials on the internet insist that you succumb to using Windows proprietary software. Never!

Still, you are left wondering, “What is this .acsm file and where the hell is my book?” (If you are sufficiently annoyed and ready to begin, then skip to the tutorial below.)

The bad news: A .acsm file is not a book. It is similar to a .torrent file. In other words, .acsm is a filetype that tells Adobe Digital Editions to download the actual book file, which will be a .epub. Said .epub will contain DRM (Digital Rights Management) that will cause it to self destruct and prevent copying to or reading it on any device which Adobe fails to authorize. If you are running Adobe Digital Editions via WINE on linux, then it will certainly fail to detect and authorize your device. It will also fail to recognize the .acsm file because you’re running it from a nigh-emulator and one does not simply-double click a file and have it opened by the associated program into Mordor! Or, you know… whatever epic tale it is you’re trying to read.

The worse news: This means you will either have to say goodbye to the money you just wasted on a useless file or go through way more effort than is reasonable just to read a document.

The good news: You can, in fact, access the book you paid for and transfer it to other devices. The first time is the most tedious. After that you will be better prepared to strip that nasty DRM from ebooks you buy in the future. That is, assuming you ever spend another dime on an ebook after this.

Note: From here on out, Adobe Digital Editions is referred to as ADEs, pronounced “AIDS”. Because, like the disease, it is a terrible plague that the world would be much better off without. Unlike the disease, DRM is not as easy to protect yourself against and affects a lot more people by infecting otherwise healthy content. There is no safe way to use DRM. For the first time ever, abstinence really is the answer.


Begin Tutorial


Acquire and Prepare Your Tools

Download Digital Editions Stand-Alone Installer:

You will have to go here and make and create an account with Adobe or login if you have a current account. Wow… even this step is more tedious than it should be.

Install ADEs with WINE:

Right click on the .exe you just downloaded (should be something like digitaleditions_172.exe) and select Properties tab. Check the box next to “make the file executable” and click ok. The installation process should begin. Don’t bother opening ADEs yet / close it if it launches.

Download python-2.6.2.msi

Install python-2.6.2.msi

Must be installed using WINE regardless of whether you have python installed on your linux distro. Notice it is a .msi which will download and install the files, but you must enter the following command in your terminal to run a .msi in WINE (Yes, I RTFM). Don’t forget to cd to the directory your .msi is located:
msiexec /i python-2.6.2.msi

Download and Install PyCrypto

Download pycrypto-2.1.0.win32-py2.6.exe. Right-click -> Properties tab -> check box to make executable. Right-click and run with WINE to install.

Create a New Directory and Download Inept Scripts

Make sure you can view hidden directories by pressing ctrl + H.

Create a directory called “inept” in your /home/user/.wine/drive_c/ directory (so WINE can find it when you run it later).

To download the two scripts, Right-click each link and Save link as… Remove “.txt” from the file names and save to the ~/.wine/drive_c/inept/ dir you just created: ineptkey.pyw and ineptepub.pyw

Take a Break

I’m not kidding here. Just getting prepared has been a lot of work. I recommend you walk around for a few minutes, breathe, relax. There is plenty waiting for you when you get back. Even Sherlock Holmes was at his best while puffing his pipe or playing his violin.


Administer the Cure for ADEs

Place booktitle.acsm under your WINE Directory

Move your .acsm file to some place on your faux C: directory, probably located at /home/user/.wine/drive_c/

Run ADEs in WINE via Command Line

cd to the Adobe directory which contains digitaleditions.exe.

For me it accessed with:
cd ~/.wine/drive_c/Program\ Files/Adobe/Adobe\ Digital\ Editions/

Run ADEs on the .acsm file from terminal and it should automatically download the epub. ADEs is supposed to be a Windows program. You must enter the file path to the directory where you just placed the .acsm file using Windows syntax. Notice that every time a “\” or ” ” empty space appears in the file path, it is preceded by a “\”. See here for details.

Example:
wine digitaleditions.exe C:\\acsm\ folder\\filename.acsm

Get Your Readable epub With DRM

This should download a DRM laden epub and open it in the ADEs library. The actual epub is stored at:
/home/user/.wine/drive_c/users/user/My Documents/My Digital Editions

For our faux Windows purposes, remember this Windows version of the same file path. You will need it soon.:
Z:\home\user\My Digital Editions

Run Ineptkey Script

cd to your python.exe directory:

cd ~/.wine/drive_c/Python26

Run inpetkey.pyw using your WINE version of python (will not work if you run the local, linux version of python!):
wine python.exe C:\\inept\\ineptkey.pyw

You should get a message confirming that adeptkey.der was created. It should be in the same folder as ineptkey.pyw, so confirm it exists:
ls ~/.wine/drive_c/inept

Run Ineptepub.exe

Run ineptepub.exe via python.exe via WINE:
wine python.exe C:\\inept\\ineptepub.pyw

The following prompt should pop up with key file, input and output fields:

Key File: Navigate to adeptkey.der (in this case it is in ~/.wine/Drive_c/inept/). If you can’t browse to the hidden .wine directory in this Windows program, then move adeptkey.der to a directory that is not hidden and try again.

Input Path: Browse and select the folder that ADEs has saved the DRM infected epub file(s) to. All files in the folder you choose will be decrypted. Z:\home\user\My Digital Editions

Output Path: Choose any folder to create the new, DRM free .epub file in! Click “Decrypt whole directory” and confirm that your new, DRM free booktitle.epub file(s) has(have) been created. You are now free to copy the file, transfer it to another device, keep it for as long as you want or convert it into another format.

Enjoy finally being able to read the ebook(s) you paid for!

Further advice about purchasing DRM hindered documents:

If you do not want to go through all this trouble then the only alternative for ebooks that are not released in open format is to download the same book for free through one of the many pirate sites on the internets. I probably can not legally advocate doing that, but as I said, this is currently the only alternative that I am aware of. It may in fact be the only way to acquire content without being forced to buy proprietary software.

It may even be considered illegal to remove DRM, whereas it appears to be within fair use rights under DMCA in the USA to download an ebook as long as you don’t distribute more than $1,000 retail value within a six month period.

Granted, I’m not a lawyer, but it appears that it is legal to download a pirated copy of an ebook and share a limited amount, yet it is illegal to remove the DRM that prevents you from sharing. I recommend checking with a legal expert if you are concerned.

If you come to find as myself and Harvard Professor Charlie Nesson did, that downloading does not appear to be illegal, the download your books for free and send donations directly to authors you wish to support. This whole experience has taught me that companies which use non-free, non-standard document formats are not only unnecessary, but they are also a nuisance to society (you and me). I highly recommend that people stop purchasing ebooks that have DRM. Ask your library to only accept documents that are in an open format. Download and share to the maximum extent of the law.

Inept scripts from http://www.softsay.com/ via this tutorial.

This post is mirrored at kat.ph

14 Responses to “A WINE Remedy for acsm epub DRM Adobe ADEs”

  1. [...] normally be very simple to access. In the end, the only civilized way to access the content is to, remove the DRM. In other words, there is no legal way to access the content without breaking the law if you are [...]

  2. Nick says:

    Thanks very much for the info and the drm stripping utility. Didn’t realise I would have so much trouble reading the book I bought on linux. Steering clear of DRM’d files in the future.

  3. Fabio says:

    Your tutorial is really useful, but i just want to ask you a question: isn’t there a simple way for downloading acsm files using firefox (or another browser) and automatically open Digital Editions for downloading epub file? Because like you’ve described i have everytime first download acsm file, second move it to c:\\ directory and after downloading epub file through “wine digitaleditions.exe C:\\…” command. I hope there is a solution. Thanks a lot anyway :-)

  4. glook says:

    yep, it works! thanks for sharing :)

  5. RandomPasserBy says:

    A note regarding the version of PyCrypto:

    With PyCrypto version 2.6 (for both Python 2.6 and 2.7), I got an error. ( traceback posted at http://pastebin.ca/2296835 )
    Using PyCrypto version 2.3 worked.

  6. Micha says:

    It smoothly worked in 5 minutes. Thanks a lot; may RMS bless you.

  7. Maria says:

    Thank you so much. :) I’d been looking for a way to access the books I bought for about half a year and being a total Linux newbie circled the right solution for hours but couldn’t get it to work. Like the poster before me said: then your toturial came along and everything worked in 5 minutes. You totally made my day :)

  8. Tingo says:

    It took some time, and I had to use this: http://askubuntu.com/questions/127848/wine-cant-find-gnome-keyring-pkcs11-so
    but in the end it worked. Thanks!

  9. Jean-Marc says:

    Hi,
    for ADE PDF file, you need to download the Python script ineptpdf.pyw. I have found it here: http://pastebin.com/WfPJP3BX
    It works as ineptepub.pyw with a graphical user interface asking for the Key File, the Input PDF file (and not a path) and the Output PDF file.

  10. Peter Donis says:

    Thanks for this! This is a really useful utility. One question: once you have the DRM-encrypted epub file and the key file, is there any reason the rest of the process has to run on Windows through wine?

    • illunatic says:

      I believe the python scripts were written to run in a Windows environment so this is likely the simplest way to do it without porting the scripts to work in a linux environment.

      • Peter Donis says:

        I have ported the ineptepub script to work on Linux (actually, as far as I can tell, it should work on Linux, Windows, and OS X, with any Python 2 version that PyCrypto supports, but I’ve only tested it on Linux). You still need your key file to make it work, and I haven’t ported the key file script; but the key file only needs to be extracted once.

        My question now is, how can I post my revised script for others to see here?

Leave a Reply