Archive for the ‘linux’ Category

This howto shows how to download eBooks using Adobe’s ADEPT DRM (Digital Rights Management) scheme on Linux and how to decrypt those books so that you can use your eBook viewer of choice to read them and copy them to any device you wish.

  1. To download content protected with ADEPT, we need the Adobe Digital Editions eBook viewer. Sadly there is no Linux version, so we need to run the Windows version with Wine. Get the Windows installer from here.
  2. Go to the folder where you downloaded the installer and run it with the command
    wine setup.exe
    After the installation, run Adobe Digital Editions straight from the installer or with the command
    wine ~/.wine/drive_c/"Program Files/Adobe/Adobe Digital Editions/digitaleditions.exe"
  3. In order to access DRM-protected content, you need to “authorize” your computer using the Adobe ID. You can get the ID by creating an account at the Adobe website here. Then in Adobe Digital Editions select “Authorize computer…” from the Library-menu and enter the ID and password.
  4. Now we can actually download the book. For this we need a file with the .acsm-extension. This file contains the necessary information for Adobe Digital Editions to locate and download the book. You’ll probably get this file by clicking on the download link your eBook vendor provided. Save the file to disk. Now load the file by dragging its icon on the Adobe Digital Editions window. Adobe Digital Editions should now start downloading the book. After the download has finished, quit Adobe Digital Editions.
  5. The DRM-protected pdf- or ePub-file should now be located in the folder ~/My Digital Editions. Next, we decrypt the DRM scheme. For this, we’ll use two Python-scripts: the key retrieval script ineptkey.pyw and the decryption script ineptpdf.pyw or ineptepub.pyw (depending on the file format). Copy the scripts into the same folder with the book. Unfortunately, as these scripts are for Windows and OSX only, we’ll again have to use Wine. To run the scripts, we need the Windows version of Python (get it from here) and the cryptography package PyCrypto (from here). The Python version should be at least 2.6 (I use 2.7 here, newer versions might work as well). Make sure that the PyCrypto version matches the Python one. Run the installers with the commands
    wine msiexec /i python-2.7.2.msi
    wine msiexec /i pycrypto-2.3.win32-py2.7.msi
    Now, go to the folder with the book and the scripts and run the first script with the command
    wine ~/.wine/drive_c/Python27/python.exe ineptkey.pyw
    This will create the file adeptkey.der in the same folder. Now, run the second script with
    wine ~/.wine/drive_c/Python27/python.exe ineptpdf.pyw
    wine ~/.wine/drive_c/Python27/python.exe ineptepub.pyw
    In the dialogue select the book as input file and name the output file what you like. Click on “Decrypt.”
  6. Voila! You should now have the decrypted pdf- or ePub-file in the ~/My Digital Editions folder.

Read Full Post »