Wednesday, October 21, 2009

iPhone: Reading Adobe/EPUB eBooks

Note: This post has been heavily edited several times, the last time being Feb. 22, 2010. Readers who find errors, inconsistencies, or points of confusion are encouraged to post a comment below so that I can revise the instructions to make them as correct and usable as possible. Thanks!

* * *

Introduction

eBooks come in many forms; see this article in Wikipedia for a list. Most of the common formats can be read on an iPhone, by one app or another — see iPhone as eReader for more.

An eBook format that the iPhone can't deal with, however, is the supposedly "open" EPUB format if, paradoxically, it is copy-protected using the Digital Rights Management methodology created by Adobe Systems. This Adobe/EPUB format, a DRM-protected variety of the open EPUB format, is used by the Adobe Digital Editions (ADE) eBook reader. ADE is intended for personal computers, but not for most mobile devices like an iPhone. The full name of Adobe's DRM methodology is Adobe Digital Editions Protection Technology, or ADEPT. The Adobe/EPUB format can accordingly be called ADEPT/EPUB.

To repeat: Adobe Digital Editions, a.k.a. ADE, is software that runs on Windows and Mac platforms, but there is no ADE for the iPhone. Why not? Maybe because ADE incorporates Adobe Flash as a way of presenting complex graphics, and Flash is not supported on the iPhone. The iPhone, lacking Flash support, cannot read ADEPT/EPUB eBooks. This is so even though there is no Flash content in ADEPT/EPUB eBooks!

If it were possible to bypass or strip off the ADEPT DRM encryption, however, these ADEPT/EPUB eBooks would become plain old EPUB eBooks — downloadable to, and working just fine in, Stanza for the iPhone.

Bypassing ADEPT encryption so that you can read ADEPT/EPUB books on an iPhone is in fact possible. Here is a step-by-step explanation of how.


Step 1:

Before you get started, you'll probably need to download and install the free Adobe Digital Editions software itself.

I know of only one exception to that rule. If you have a Sony Reader, you probably have installed its companion Reader Library (formerly eBook Library) software for the Sony Reader on your Windows PC or Mac. As of version 3.0, this software (current version is 3.1) can stand in lieu of Adobe Digital Editions software, in that it lets you authorize your Sony Reader device (and your computer as well) for Adobe DRM-protected content. If you have already done that, you don't need to install and authorize ADE, and you can skip ahead to Step 2 in these instructions.

What if you are not sure whether your computer is Adobe-authorized?

If you are using Windows XP — I  don't know enough about Windows Vista or Windows 7 to say how to do this on those operating systems — you can check to see whether your computer is already Adobe-authorized by clicking on the start button, selecting Run..., typing regedit.exe in the Open... box and clicking OK, and in the Registry Editor window that appears, selecting Edit:Find.... Then type privateLicenseKey in the Find what: box and click the Find Next button. If your computer is Adobe-authorized, then (after a few seconds of searching) the Registry Editor will show a two-item list in the right side of its window that contains privateLicenseKey as the first data item. (The second item is the actual — albeit encrypted — value of the key.) Voila! You can now close the Registry Editor window and skip ahead to Step 2 of these instructions.

If you are using a Mac, one way you can check to see whether your computer is Adobe-authorized is to look for an activation.dat file in your Home folder hierarchy on your Mac — specifically, in the ~/Library/Application Support/Adobe/Digital Editions/ folder. (~ is shorthand for your Home folder.) If activation.dat is there, you have already authorized your Mac for Adobe-DRM'ed eBooks. You can skip ahead to Step 2 of these instructions. (Note: the ~/Library/Application Support/ folder hierarchy will not show up in a Finder search unless you specifically tell the search to include system files.)

If you didn't skip ahead to Step 2, you need to authorize your computer to read Adobe-DRM'ed eBooks. Click here to install (or simply launch) ADE on either a Mac or a Windows computer. About halfway down the page which comes up you will see a large button saying one of two things:

  1. If you see the word "Launch," then you already have the latest version of Adobe Digital Editions installed on your computer. You should click on the "Launch" button to open ADE. When you do — since you have just checked to see whether ADE is activated and found that it isn't — you should see an ADE Setup Assistant window superimposed over the main Adobe Digital Editions window.
  2. If you instead see the word "Install," click on it to obtain the latest ADE version. A warning appears: "This application can read and write files to your system. Would you like to continue installing?" Click "Install" again. Another warning appears: "Press yes to download and continue the installation of Adobe Digital Editions." Click "yes." After the download has finished, the Adobe Digital Editions app immediately opens on your Windows or Mac computer, displaying an "Adobe Digital Editions Install" window. That window contains a license agreement to which you must click "I Agree." You'll now see the ADE Setup Assistant window superimposed over the main Adobe Digital Editions window.

Whether you just installed or simply launched ADE, you should now see the ADE Setup Assistant, since presumably your computer is not yet ADE-activated. You need to click the Setup Assistant's "Continue" button to see a panel asking you to "Authorize Computer" by filling in your Adobe ID (which is typically your e-mail address) and associated password.

If you do not already have an account with an Adobe ID, you should now click on "get an Adobe ID online," in order to be taken via your Web browser to an online page that will allow you to set up an Adobe account. Once you set up your Adobe account, return to the patiently waiting Adobe Digital Editions Setup Assistant and enter your new Adobe ID and password. Click the "Activate" button.

You have the option instead to choose "Don't Authorize Computer" at this point, instead of "get an Adobe ID online." This is what is referred to as an "anonymous" activation, in that your computer will be "activated" but not "authorized" to use any particular Adobe ID.

As long as the computer you are using is not available to the public, my strong suggestion is that you not choose this option. If you choose it, you will not have the ability to download Adobe-DRM'ed eBooks to, and read them on, any computer but the one you are presently activating. If you authorize your computer using an Adobe ID, you can use the same Adobe ID to authorize up to six computers, total — plus, you will be able to transfer Adobe eBooks to a device such as a Sony Reader or a Barnes & Noble Nook that has been activated with the same Adobe ID.

I have been assured that the following steps in these instructions will work with an anonymous activation that does not specify an Adobe ID. However, if you activate Adobe Digital Editions anonymously and then later do it again with an Adobe ID, at that time all of your earlier ADE e-book purchases will become unusable. So I strongly recommend that you activate Adobe Digital Editions with an Adobe ID right from the outset.

Once you click "Activate," you will see (briefly) a panel saying "Connecting to authorization server," and then, once the authorization is complete, you will see the Setup Assistant's final panel, from which you can, if you like, point your browser at the Adobe Digital Editions Online Library. This, as the title says, is the repository on the Internet where many, but not necessarily all, of the Adobe Digital Editions eBooks you buy will be kept. From the web page which appears in your browser, you can now obtain your first ADE eBooks.

I'll leave it to you to visit this library later on in this set of instructions and explore how this is done.  At this point, you need to click "Finished" to dismiss the Setup Assistant.

Now, if you are on Windows you will have on your C:\ drive a folder, C:\Program Files\Adobe\Adobe Digital Editions, that contains digitaleditions.exe, the ADE application. On a Mac, the Mac version of the Adobe Digital Editions software resides in your Applications folder.


Step 2:

Next, if you are using Windows, you need to obtain Python, a programming/scripting language originally developed for Unix-based computers, and also available for Windows.

If you use Windows you can currently get Python version 2.6, which you can download and install in Windows by going to the Python download page and then clicking on (as of this writing) the hotlink to Python 2.6.4 Windows installer. (There is also a version 3.1, but I can't guarantee it will work with this procedure.) You'll download a file called python-2.6.4.msi which you'll proceed to double-click, and then you'll follow the installer's on-screen prompts that allow you to install the Python 2.6 package in a directory the installer creates, C:\Python26. The actual app within that folder is called python.

For the Mac platform, you do not need to download and install Python at all, as Python 2.5 (which works fine for purposes of these instructions) is automatically installed as part of Mac OS X 10.5 "Leopard." (I believe this is also true of OS X 10.6 "Snow Leopard.") Even though Python 2.5 is part of the Mac OS X software package, you do need to make sure the optionally installed Apple Developer package is installed on your Mac.

If you already, at the outermost root level of your Mac's folder hierarchy, have a folder called Developer, you're fine. If not, you must create it by inserting your OS X 10.5 Install DVD and navigating to and then double-clicking Mac OS X Install DVD:Optional Installs:Xcode Tools:Xcode Tools.mpkg. You will be led by the installer program which opens through the necessary steps to install the Developer Tools package. These tools are necessary in the next stage of this procedure, that of installing and setting up the PyCrypto extensions to Python.


Step 3:

PyCrypto, the Python Cryptography Toolkit, is a package containing various cryptographic tools for the Python programming language. Its modules are going to be required later on in this set of instructions.

Windows users can obtain PyCrypto here (on that page, click on the link to pycrypto-2.0.1.win32-py2.6.exe). After downloading the .exe file, double-click on it to run the Setup Wizard. As long as you have already downloaded and installed Python as detailed above, the Wizard (after you click "Next >" on the introductory panel) will indicate Python 2.6 has been duly found in the Windows Registry, in C:\Python26\. The Wizard will accordingly use the subfolder C:\Python26\Lib\site-packages\ as its installation directory. After you click on "Next >" once more, you will see a "Ready to install" panel. Click "Next >" yet again to actually perform the installation. Then click "Finish" to exit the Wizard. You should now be able to locate a Crypto folder and also a pycrypto-2.0.1-py2.6.egg-info file in C:\Python26\Lib\site-packages\.

Mac users should go here and click on the "Download" button for PyCrypto 2.0.1. The pycrypto-2.0.1.tar.gz file you'll receive will most likely land right on your Desktop (depending on how you have your browser configured for downloads; if it doesn't download right to the Desktop, you can just move it there). Upon being double-clicked, the pycrypto-2.0.1.tar.gz file expands into a pycrypto-2.0.1 folder, also on the Desktop. You may move this folder wherever you like, or leave it right on the Desktop.

Next, Mac users need to click here to download PyCrypto_2.0.1_Installer.app.zip, which, when unzipped, expands into an AppleScript app called PyCrypto_2.0.1_Installer. Double click PyCrypto_2.0.1_Installer to run the installer itself. It will ask you to navigate to and choose your pycrypto-2.0.1 folder, the one you created in the preceding paragraph of these instructions. Once you have clicked "Choose," PyCrypto_2.0.1_Installer will open a window in the Mac's Terminal application and execute some Unix commands in it. The first time you use the PyCrypto_2.0.1_Installer, the Unix commands will produce a large amount of output in the Terminal window, due to the fact that the PyCrypto software is, for the first time on your computer, undergoing a "build." Any subsequent times you use PyCrypto_2.0.1_Installer, an "install" without a preliminary "build" will be done, and you will see less output in the Terminal window. In either case, the final line of the Terminal-window output should say "Writing /Library/Python/2.5/site-packages/pycrypto-2.0.1-py2.5.egg-info".

At this point you can quit Terminal. If you look in Finder — starting at the root-level directory, not at the Home folder for your user account — and navigate to /Library/Python/2.5, you should find a site-packages folder. In it there should now be a Crypto folder and a pycrypto-2.0.1-py2.5.egg-info file.


Step 4:

At this point, you have obtained the Adobe Digital Editions application (or else the Sony Reader Library app) and authorized your computer by activating your Adobe ID and password (or you have activated ADE anonymously); installed Python (on a Windows platform only); made sure you have the Developer Tools installed (on a Mac only); and installed the PyCrypto cryptography tools within Python (on either a Windows PC or a Mac).

You are going to run two Python scripts in order to decrypt Adobe Digital Editions eBooks. I'll discuss the second of these two scripts in Step 6 below. The first Python script is designed to extract cryptographic key information from the Adobe Digital Editions desktop software that you now have installed and authorized on your computer.

For Windows, the script comes in a file called ineptkey_v43.pyw.zip, downloadable here.

For the Mac, the file ineptkeymac_v1.py.zip is downloadable here.

Whichever ZIP file you download, you need to expand it (unless your browser does that automatically for you). The Windows script expands as ineptkey_v43.pyw when you double-click it; the Mac's as ineptkeymac_v1.py. (On a Mac, if you can't get the ZIP file to expand by double-clicking it, then you can expand it manually using either Archive Utility or Stuffit Expander.)

To run the ineptkey_v43.pyw script on a Windows platform, you will open and run the script in the python app created in Step 2. To do that, right-click on ineptkey_v43.pyw and select Open With: python to designate the python.exe app. Or, if you instead select Open With: Choose Program ... , you can check "Always use the selected program to open this kind of file," and then select python and click "OK." From then on, you will be able to double-click any Python script file whose filename extension is .pyw, and it will automatically open in python.exe.

On a Mac, you will initially open ineptkeymac_v1.py in Build Applet. To do that, right-click on ineptkeymac_v1.py and select Open With: Build Applet. An application called ineptkeymac_v1 will appear in the same folder as ineptkeymac_v1.py. Double-click the ineptkeymac_v1 app to actually run the script.

I'll refer to these scripts generically as ineptkey. Having to be run only once, ineptkey derives a decryption key (sometimes called a "security certificate") which can then be used by the second script (see Step 6 below) to decrypt any Adobe Digital Reader eBook that you obtain and download. The decryption key/security certificate is saved by ineptkey in a new file called adeptkey.der. On Windows, adeptkey.der is placed in the folder that contains the ineptkey script itself; after the file has been generated, you can manually rename it if you like and/or move it wherever you like.

On a Mac, a File Save dialog allows you to specify in what folder (and by what name) to save adeptkey.der. You can move the adeptkey.der file (by whatever name) which contains the decryption key/security certificate into any folder you like.

Once you have used ineptkey once to obtain adeptkey.der, you never have to use it again (unless you someday re-authorize ADE on your computer with a different Adobe ID and password).

Notes: The AppleScript-based app ADEPTKey_Generator was formerly used on Macs to do what ineptkeymac_v1.py does, but it no longer works with the latest version of Adobe Digital Editions.

If you have any adeptkey.der files from either ADEPTKey_Generator on a Mac or versions of ineptkey prior to version 4.3 on Windows, you should trash them. They will no longer work in Step 6 below.


Step 5:

At this point, you are done with all the admittedly complex preliminary steps. You are ready to actually obtain and download some eBooks that are protected with Adobe ADEPT DRM-encryption. You can start to do so by visiting the Adobe Digital Editions Online Library. Obtain and download at least one Adobe-DRM'ed eBook that is in the "EPUB eBook" format specifically. (There is a Python script called ineptpdf that can decrypt Adobe-DRM'ed "PDF eBook" editions, but it is beyond the scope of this discussion.)

Note that when you buy an EPUB eBook from the Adobe Digital Editions Online Library, the Adobe Digital Editions software on your computer will open, if it's not already active, and the eBook will be downloaded automatically. The eBook will appear in "Reading View" in the ADE window, ready to read. (This is true if you are using the ADE software. If you are using Sony Reader software, I don't know exactly how all this works.)

With the newly downloaded eBook visible in Reading View, you can click on the READING menu and then on Item Info... . A window will open that shows, among other things, the File path: to where the downloaded eBook is stored on your computer.

On Windows XP, the eBook will normally be in the user's My Documents\My Digital Editions folder, the full path to which is C:\Documents and Settings\\My Documents\My Digital Editions.

On a Mac, the eBook file will normally be in the /Users//Documents/Digital Editions, a.k.a. ~/Documents/Digital Editions, folder.

On both operating systems, the name of the file will typically be (roughly) the same as the book title, usually with each space replaced by an underscore ('_') character. Some eBooks download with more cryptic file names. The filename extension will be .epub.

You should leave the downloaded file exactly where Adobe Digital Editions puts it, under its original name and filename extension. However, there's no law against making a copy of that file, putting it where you wish, and naming it what you wish. (However, it's definitely a good idea to retain the .epub extension.)

Once you have downloaded, located, and optionally duplicated one or more EPUB eBooks that use Adobe DRM encryption, you can move on to the next step.


Step 6:

The adeptkey.der file containing the ADEPT decryption key/security certificate — you generated it earlier in Step 4 in this set of instructions, remember? — can now be used, on either a Windows machine or a Mac, by the ineptepub Python script to decrypt downloaded ADE books.

For either a Windows platform or a Mac — the same script works on both — you can download the ineptepub_v2.pyw.zip file here. After you download it, just unzip the ZIP file to get the file ineptepub_v2.pyw.

Your browser may unzip the ZIP file automatically, so you won't have to. If it doesn't unzip the file automatically, then:

  • On Windows XP (I'm not sure about other Windows versions), you can unzip the .zip file manually by double-clicking it and then clicking "Extract all files" under "Folder Tasks" in the window that opens. Otherwise, you can use the WinZip utility.
  • On a Mac, you can unzip the .zip file manually using either Archive Utility or Stuffit Expander.

On Windows, you will next open and run the ineptepub_v2.pyw script in the python app created in Step 2. To do that, right-click on the ineptepub_v2.pyw script file and select Open With: python to use the python.exe app. If you instead select Open With: Choose Program ... , you can check "Always use the selected program to open this kind of file," and then select python and click "OK." From then on, you will be able to double-click any Python script file whose filename extension is .pyw, and it will automatically open in python.exe.

On a Mac, you should next change the .pyw filename extension to .py in a Get Info window in Finder. Finder will ask you to confirm your intention to change the extension; just click "Use .py." You should then double-click the ineptepub_v2.py script file to (try to) make the ineptepub_v2 app in the same folder. If the double-click method doesn't produce the ineptepub_v2 app file, then probably what has happened is that the script has (briefly) opened in Python Launcher instead. Python Launcher cannot deal with this particular script, so it quits right away. This time, just right-click the ineptepub_v2.py script file and choose Open With: Build Applet.

On Windows, when you open the ineptepub_v2.py script in python, in front of an empty python.exe window you'll see:


As you can see, you'll need to specify three files. The easiest way: click on the "..." button to the right of each file-entry field, then navigate to and select the requisite file for each:

  1. For Key file, you'll select the decryption key/security certificate file created earlier, the one that by default has the name adeptkey.der.
  2. For Input file, you'll select a file containing any previously downloaded Adobe Digital Editions eBook you want to decrypt. In Windows, the downloaded eBook will typically be stored in My Documents\My Digital Editions. It will have the filename extension .epub. (On a Mac, it will be in ~/Documents/Digital Editions, where '~' signifies the Home Directory for your user account. Again, the file will have the filename extension .epub.)
  3. For Output file, you'll select a folder for and give a name to the file that is to contain the decrypted version of the eBook; you can put the decrypted output file anywhere you like in your folder hierarchy. You should make sure to specify the .epub extension for the output filename.

Then click on Decrypt. Within a second or so, the INEPT EPUB Decrypter window should say "File successfully decrypted." The decrypted output file should be right where you said to put it, using the file name and .epub extension you specified. If you double-click its icon, it will open in Adobe Digital Editions (even though it is no longer encrypted!). You can alternatively open it in any other eBook reading application, such as Stanza, that handles EPUBs.

You can now either perform one or more additional INEPT EPUB Decrypter decryptions or click Quit.

On a Mac, using ineptepub is about the same, though visually the user interface looks different. When you double-click on the ineptepub_v2, app, you will see:


It's like the Windows version, but without color. This time, behind the INEPT EPUB Decrypter window there's an empty Console window that you can just ignore, whereas in the Windows version, the window behind the INEPT EPUB Decrypter window is an empty python.exe window. You will (as for the Windows version above) use the "..." buttons to select Key file, Input file, and (the folder location and name of) Output file (don't forget to specify the .epub extension for the output file) then click Decrypt.

Remember, on a Mac, the Input file will normally be in ~/Documents/Digital Editions, where '~' signifies the Home Directory for your user account. This is the folder into which Adobe Digital Editions downloads eBooks. Again, the downloaded file will have the filename extension .epub.

Within seconds after you click Decrypt in the INEPT EPUB Decrypter window, you should see the message File successfully decrypted at the top of the window. You can now do further eBook decryptions, if you like.

After you finish doing eBook decryptions, just click Quit.


Step 7:

Once you have decrypted an eBook, you can open the decrypted eBook file in the free Stanza desktop application. The Mac version of Stanza can be obtained here, the Windows version here, and the iPhone/iPod Touch version here.

Once you have installed one of the desktop versions of Stanza, just open a decrypted eBook file in it. You will be able to read it right on your desktop.

Or, if you want to read it in Stanza for the iPhone/iPod Touch, follow the instructions here to transfer the book to your mobile device. (I find the "Sharing using Stanza Desktop" method works just fine.)


... And You're Done!

If you aren't done, then perhaps you ran into a problem? If so, check out Breaking Adobe DRM — Tips, Tricks, Workarounds for possible help. If you can't find the solution you need there, please post any questions you have as comments, either to this post or to that one.

You can get more details about the ineptkey and ineptepub Python scripts at Circumventing Adobe ADEPT DRM for EPUB.

143 comments:

Unknown said...

Thanks for a clear and detailed guide! However, I still get an error when I'm trying to decrypt my DRM'ed ePub file.

Error: problem decrypting session key

I have asked for help in Mobileread forums and i<3cabbages blog but with no luck so far. Maybe someone reads this and knows the answer :) Anyway, a great guide!

Unknown said...

Neither ADEPTKey Generator 1.1.app nor PyCrypto_2.0.1_Installer.app work on my Snow Leopard. When double clicked, neither does anything. Are they for Leopard only?

eric said...

tepesa,

Sorry it has taken me so long to realize you asked for help. I should have had e-mail notification turned on for comments in this blog, but didn't. It's now on.

You were getting

Error: problem decrypting session key

when you were using the ineptepub.pyw script. I can't be sure, but I think you are running into a known problem that can be solved by (on a Mac) unzipping and rezipping the e-book, then using ineptepub.pyw on the rezipped version:

1. Make a copy on the Desktop of your downloaded .epub file. Then change the file name's .epub extension to .zip. To do that, in Finder select the file on the Desktop and do a Command-I, or choose Get Info from the File menu, and change the extension from the file name box in the Get Info window. When asked whether you really want to change .epub to .zip, say "Use .zip".

2. Double click the .zip file so that Archive Utility in the Mac OS unzips it into a folder on your Desktop. (If double clicking the .zip file doesn't start the Archive Utility, you may have to manually open Archive Utility from /System/Library/CoreServices/Archive Utility.app and choose Expand Library from the Archive Utility's File menu, then navigate to and select the .zip file in the File Open dialog.)

3. Download and unzip ePub Zip 1.0.2.app.zip. Double click it to expand it to ePub Zip 1.0.2. Double click this expanded script app (you may have to tell the Mac that's it's OK to run this newly downloaded app), causing it to run an AppleScript. You may have to click the running script's icon in your dock to bring it to the front. Then use the Find File dialog box it presents to select the folder produced in step 2. After you receive a "successfully completed" dialog confirming that the script worked, you'll have a new .epub file on your Desktop. This one will (probably) work fine with the ineptepub.pyw script. Internally, it is actually a .zip file, by the way, but it (like all EPUB eBooks) bears the .epub file name extension.

eric said...

why asked:

Neither ADEPTKey Generator 1.1.app nor PyCrypto_2.0.1_Installer.app work on my Snow Leopard. When double clicked, neither does anything. Are they for Leopard only?

The updated version, ADEPTKey Generator 1.1a.app.zip, fixes the problem on Snow Leopard!

eric said...

tepesa,

I have thought some more about your

Error: problem decrypting session key

when using ineptepub.pyw. I looked at the source code for ineptepub.pyw and was able to determine that just possibly the book you are trying to decrypt was not originally purchased and downloaded under the same Adobe account as was used when you did the "Authorize Computer ... " in your copy of Adobe Digital Editions (ADE). It is that authorization/activation that gets reflected in the adeptkey.der file created by either ineptkey.pyw or ADEPTKey Generator, depending on what type of computer platform you have.

Another possibility is that you have more than one computer platform (or more than one log-in account on a single computer platform) and you are trying to decrypt the book on a different platform/log-in account than the one originally used to download the book.

The rule is: you must always download a book in ADE using the same authorized Adobe account as was authorized in ADE at the time you ran ineptkey.pyw or ADEPTKey Generator, on the same computer, using the same log-in account on that computer.

For example, if your spouse has one Adobe account and you another, or if your spouse has a different computer or log-in account, the two of you cannot trade downloaded but still encrypted ADE e-books and then expect the decryption instructions given in the main post above to work!

Anonymous said...

Thank you so much for posting this! I was very confused about what to do on a Mac. Thanks to your wonderful instructions, I can read my books on any device I want. Much appreciated!

eric said...

Hi, Anonymous,

You wrote:

Thank you so much for posting this! I was very confused about what to do on a Mac. Thanks to your wonderful instructions, I can read my books on any device I want. Much appreciated!

Thanks for your gratitude and appreciation. Happy e-reading!

Eric

Anonymous said...

Eric, thank you for your clear instructions, i encounter the same problem about decrypting session key, i used the zip/unzip routine and have still the same problem, maybe this is because i bought the book with a cc based key from B&N and my adobe de implementations uses a diufferent username password combination, can this be the reason it doesn't work?

eric said...

Anonymous,

You said:

Eric, thank you for your clear instructions, i encounter the same problem about decrypting session key, i used the zip/unzip routine and have still the same problem, maybe this is because i bought the book with a cc based key from B&N and my adobe de implementations uses a diufferent username password combination, can this be the reason it doesn't work?

First, I suggest you try my new update, ADEPTKey Generator 2.0.app.zip. This version handles ADEPT key activations more generally than the earlier ones. Some users found that they had activation.dat files that didn't work with the earlier versions.

Then, once you use the new version to generate your adeptkey.der file all over again, if you still have a problem using that adeptkey.der file to decrypt a particular book in ineptepub.pyw, and if the unzip/rezip trick doesn't fix it, read the following:

My thinking is that, if you bought your e-book from Barnes & Noble, it possibly does not use Adobe DRM at all. See the Supported File Types on this B&N page. It suggests that EPUB e-books using Adobe DRM come only from "Other Sources"! I.e., B&N itself doesn't sell Adobe-DRM e-books!

That, in fact, confirms my previous understanding about the types of e-books B&N sells.

So if you bought the problematic e-book with a credit card-based key from B&N, I'm assuming you bought the book from B&N or one of its subsidiaries, and that it may not use Adobe DRM at all!

It does use DRM, that is, but not the type of DRM that my original post covers. My original post covered the ADEPT DRM from Adobe which, if not stripped off, prevents use of e-books on an iPod or iPhone. You may have a different reason for stripping DRM, but I personally am not privy to how you might do it, assuming your e-book is not ADEPT-encoded.

If all this doesn't help you, please post another comment here and I will try to give you further assistance.

Best of luck!

Eric

Adullday said...

Hi Eric and Anonymous,

I<3Cabbages has saved the day again!

http://i-u2665-cabbages.blogspot.com/2009/12/circumventing-barnes-noble-drm-for-epub.html

This only works with B&N epubs. Some of their books are using the antiquated eReader format (you can identify them by the .pdb file extensions). DRM removal software is available for eReader books if you do a little hunting.

Dave

eric said...

Dave,

i♥cabbages does indeed do good work!

I am going to respond to your valuable comment more fully later, but it will have to wait until I explore the new Nook which arrived on my doorstep today from Barnes & Noble!

Cheers,

Eric

Adullday said...

You lucky dog! Mine (a Christmas gift from my wife and older daughter) is arriving on Jan. 15. I think I'm going to take the day off and sit next to the mailbox until it shows up. :)

eric said...

Dave,

My Nook was supposedly due to arrive on Jan. 4 but showed up on Dec. 31, so be aware that yours might show up early, too.

I haven't had time yet to play with mine. The instructions that come with it require you to charge it up before using it. Though you can use it while it's charging, that wasn't convenient for me. Fully charging it took several hours, and I seemed to have to disconnect it and reconnect it to my computer's USB port to get it to top off the charge at the end. (Also supplied is an AC adapter for the included USB cable, but I haven't tried that yet.) In the end, I let it charge overnight and woke up to a properly topped off Nook. But I've been so busy, I won't actually start using it until later today.

I can say that some of the gestures one uses to put the Nook through its paces seem a bit counterintuitive to me, since I've grown accustomed to using the iPhone with its quirks and eccentricities. I have to keep reminding myself that I can't tap the reading screen to turn pages or get something else to happen. The reading screen is not touch-sensitive.

The color touchscreen below the reading screen is touch-enabled, yet page turning is mainly done with physical buttons at the sides of the Nook that you actually have to press down to use(!).

The e-Ink screen is nice to look at, and it's much larger that the iPhone's screen. But it's not in color, not backlit, and not able to form a new page image terribly quickly. That will be another thing for me to get used to.

The color touchscreen below the reading screen is what techies call highly "modal": the controls it presents to the user are quite context-sensitive. Sometimes the touchscreen shows you a "home" screen from which to choose which of 5 specific contexts you want to avail yourself of next. At other times it offers you a scrollable list of menu selections. At yet other times it becomes a keyboard for text entry. Finally, it can show you a "view by cover" array of your books from which to choose a specific book to read.

Also, when the touchscreen turns itself off after a few seconds of not being used, you can then turn pages by using finger gestures on the touchscreen. It's all a bit daunting to figure out, but I suppose the iPhone is equally daunting to beginners.

I hope I'm not sounding too negative here. Clearly, the design of the Nook is intended to have a very different set of strengths and weaknesses than the iPhone has when used as a book reader. Once you design in an e-Ink reading screen that will draw from the battery only when forming a new page image, you already have a different "animal" from the iPhone, which pretty much has to be charged (at least) daily.

Anonymous said...

I have succesfully used this guide to decrypt my first online bought ebook. Thanks!

I did NOT make an adobe account. And I dod NOT authorize my computer. It was still possible to decrypt the ePub and use it as a non-drm version.

I really like that because I don't like ik one bit that an adobe registration is necessary to read a book which I paid for.

I had a small problem because the original ebook had an error in one of the filenames. I unzipped it manually, repaired that and put it in a zip again which I renamed to epub. It then isn't a valid epub file anymore (Digital Editions won't read it) But the ineptepub script CAN still read it and will create a valid drm-less epub out of it.

eric said...

Anonymous,

You wrote:

I have succesfully used this guide to decrypt my first online bought ebook. Thanks!

I did NOT make an adobe account. And I dod NOT authorize my computer. It was still possible to decrypt the ePub and use it as a non-drm version.

I really like that because I don't like ik one bit that an adobe registration is necessary to read a book which I paid for.

I had a small problem because the original ebook had an error in one of the filenames. I unzipped it manually, repaired that and put it in a zip again which I renamed to epub. It then isn't a valid epub file anymore (Digital Editions won't read it) But the ineptepub script CAN still read it and will create a valid drm-less epub out of it.



Congratulations!

I am confused, though. My understanding is that you have to create an Adobe account with an Adobe ID (your e-mail address) and a password. But you say you did not!

My belief has up to now been that either Adobe Digital Editions (ADE, which is what I have) or Reader Library software for the Sony Reader (formerly eBook Library) must be used to authorize one's computer to use his or her Adobe ID/password combination, which is the pair of data items that are used in buying any given Adobe-DRM'ed eBook.

ADE guides the user through the authorization process at the time it is initially activated (i.e., when it is used for the first time). I'm not sure how Reader Library/eBook Library works, but apparently the latest version, 3.0, unlike earlier versions, does not require ADE to be installed and activated to perform the authorization process — see this page. I gather that it performs the authorization process all by itself.

If you used the ineptepub.pyw script on either a Windows PC or a Mac — would you tell me which it was? — I believe your computer must have been authorized, which means it must have an activation.dat Registry entry (Windows) or activation.dat activation.dat file (Mac). Otherwise, you could not have used the ineptkey.pyw script (Windows) or the ADEPTKey Generator script (Mac)!

I'd like to hear back from you as to whether you have an activation.dat on your computer ...

Later,
Eric

Flash_Bios said...

Eric,

Thanks for posting this info. I was able to get everything working great on my PC. I am running 10.6.2 on my Mac and everything seems to work except I can't launch the ineptepub.pyw.app. It starts to launch then quits before any console window or dialog is presented. Is there any log file I can look at the troubleshoot? Have you seen this issue under Snow Leopard? Thanks again.

flash_bios said...

Eric,

Found this in the console ...
1/12/10 11:52:22 AM [0x0-0xbb0bb].ineptepub.pyw[3633] FSSType = Carbon.File.FSSpecType
1/12/10 11:52:22 AM [0x0-0xbb0bb].ineptepub.pyw[3633] AttributeError: 'module' object has no attribute 'FSSpecType'
1/12/10 11:52:22 AM com.apple.launchd.peruser.501[201] ([0x0-0xbb0bb].ineptepub.pyw[3633]) Exited with exit code: 1

Adullday said...

You can authorize Digital Editions on a computer without using an Adobe account. Here's the problem: any books downloaded using this anonymous account are only readable on that computer, and nowhere else. That's fine (and kind of nice) if you are using Digital Editions to take out library ebooks, but not so nice if you have commercial books that you'll end up losing if you buy a new computer or reinstall your operating system.

You can create a user id for an anonymous account (or possibly attach an existing account, but I'm not sure) to extend the life of your purchases.

Of course you could just keep using an anonymous account and strip the DRM, but if Adobe re-obfuscates the key on its next version, you'll be stuck with a key that only works on that one computer.

eric said...

Adullday,

You wrote:

You can authorize Digital Editions on a computer without using an Adobe account. Here's the problem: any books downloaded using this anonymous account are only readable on that computer, and nowhere else. That's fine (and kind of nice) if you are using Digital Editions to take out library ebooks, but not so nice if you have commercial books that you'll end up losing if you buy a new computer or reinstall your operating system.

You can create a user id for an anonymous account (or possibly attach an existing account, but I'm not sure) to extend the life of your purchases.

Of course you could just keep using an anonymous account and strip the DRM, but if Adobe re-obfuscates the key on its next version, you'll be stuck with a key that only works on that one computer.



You made a very helpful point! Now that you mention it, I realize it is possible to activate one's computer for using Adobe-DRM'ed content in Adobe Digital Editions without specifying an Adobe ID — i.e., anonymously. The instructions I gave in my post above do work (I gather) with anonymously obtained Adobe eBooks. I have changed the text of my instructions to reflect this fact.

According to the instructions (available here) for the Maryland Digital eLibrary Consortium:

You can decide to activate using an Adobe ID at any time. However, if you activate Adobe Digital Editions with an Adobe ID which has already been used to activate Adobe Digital Editions on another computer, the Adobe eBooks you originally downloaded when using anonymous activation will no longer work.

My interpretation: the usability of your Adobe/EPUB eBooks can go bye-bye if you change from an anonymous to an Adobe ID-based activation on a given computer, if that same Adobe ID is "activated to" any other computer that you own!

Pending further investigation, the above limitation applies as well, I believe, to using multiple user accounts (say, husband's and wife's, or parents' and children's) on a single computer.

Of course, all the limitations vanish if one unlocks/decrypts an Adobe/EPUB using the procedure in the post above.

eric said...

Flash_Bios,

You said ...

Thanks for posting this info. I was able to get everything working great on my PC. I am running 10.6.2 on my Mac and everything seems to work except I can't launch the ineptepub.pyw.app. It starts to launch then quits before any console window or dialog is presented. Is there any log file I can look at the troubleshoot? Have you seen this issue under Snow Leopard?

and then ...

Found this in the console ...
1/12/10 11:52:22 AM [0x0-0xbb0bb].ineptepub.pyw[3633] FSSType = Carbon.File.FSSpecType
1/12/10 11:52:22 AM [0x0-0xbb0bb].ineptepub.pyw[3633] AttributeError: 'module' object has no attribute 'FSSpecType'
1/12/10 11:52:22 AM com.apple.launchd.peruser.501[201] ([0x0-0xbb0bb].ineptepub.pyw[3633]) Exited with exit code: 1


I don't have a clue, Flash!

I can tell you that it's unlikely to be a problem with the cryptography aspect of it, i. e., PyCrypto. PyCrypto gets called only after the dialog is presented.

I assume you were able to build PyCrypto OK?

True, it's just possible that in the ineptepub script there is an initialization phase for PyCrypto as such and the initialization isn't working for some reason, but I'd look elsewhere first.

I feel we can rule out anything having to do with your eBook itself, since you never got to the point where you specify the eBook file. Likewise, you never pointed to your adeptkey.der file, so it can't really be a problem with that.

Try asking at the ePub & PDF decryption on Mac OSX forum thread here. I'm a participant there, with user name epstewart. You can PM me there if you like.

It could well be a compatibility problem with Snow Leopard; I'm using Leopard.

Also, just to cover all bases: you were able to use ADEPTKey Generator to produce the adeptkey.der file OK?

If you go into Terminal and just enter 'python' (without the quotes), what version number appears? (Type control-Z to get out of Python.) I have version 2.5.1. If you have 2.6.x or higher, I can't guarantee ineptepub works with it.

Did you generate ineptepub.pyw.app by double-clicking on ineptepub.pyw.py and letting Build Applet produce the application file? Did you get ineptepub.pyw.py by unzipping the downloaded ineptepub.pyw.zip file?

Other than those questions and suggestions, I'm drawing a blank ... I really suggest asking in the forum thread I mentioned. And please don't hesitate to respond to this comment with any further information and thoughts that you may have.

Best of luck,
Eric

Anonymous said...

Hi there,

First of all, thanks for your very good post!

My first problem was:

"Error: problem decrypting session key"

But this was solved easy by rezipping it, but now if got a new problem: When I run the ineptepub.pyw script the little window says "Decrypting ..." That sounds nice, but nothing happens! So I had a look in the CMD-Windows which says:

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Programme\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "C:\Dokumente und Einstellungen\XYZ\pastie-751362.
py", line 318, in decrypt
self.status['text'] = 'Error: ' + str(e)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 101
: ordinal not in range(128)

Well, that does not sound that good ... anyone know what could be the problem?

Thandks in advanced

eric said...

Anonymous,

You asked:

When I run the ineptepub.pyw script the little window says "Decrypting ..." That sounds nice, but nothing happens! So I had a look in the CMD-Windows which says:

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Programme\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "C:\Dokumente und Einstellungen\XYZ\pastie-751362.
py", line 318, in decrypt
self.status['text'] = 'Error: ' + str(e)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 101
: ordinal not in range(128)

Well, that does not sound that good ... anyone know what could be the problem?


It is hard to say what the problem is.

The best I can tell from trying to decipher the code in ineptepub.py in terms of the error messages you received, a function called directly or indirectly by the ineptepub.py Python script encountered a hexadecimal character, E4, that it couldn't deal with. E4 is binary 11100100 and has its highest-order bit set (the first 1 in 11100100). The next bit is also set, but the first 1-bit is (I believe) not allowed for ASCII character conversions from hex. The highest decimal value in ASCII coding is 127, and hex E4 is 228.

Unfortunately, I couldn't tell whether the problem happened while ineptepub.py was decrypting the individual files that make up your eBook, or whether the problem happened at an earlier stage when it was trying to decrypt the "session key."

When it's decrypting the session key, it expects to see a string in a certain file within the eBook that adheres to "base64" encoding, which is even stricter than ASCII encoding, in that the highest value expected is 1 less than 64, i.e., 63 ... not 127, as with ASCII.

But if we assume it got past the session key decryption, then there may be erroneous data in one of the other files of the eBook.

I wonder if you would send the original book and the rezipped book to me as e-mail attachments, at epstewart2004@yahoo.com? I might be able to tell more.

Optional: Also attach your adeptkey.der file. Don't do that unless you trust me, though. If I were unscrupulous (and smarter than I am) I might be able to figure out your Adobe ID and password from it.

Eric

Anonymous said...

Hi Eric, thanks for your very nice suggestion!

Well, but it seems that my problem is a few steps earlier, since I can't find the "activation.dat" within the Registry of WinXP. That confuses me, since ADE says that my Computer is authorized for my E-Mail-Adress. Could it be, that Adobe found a way to prevent the use of the firt python-Script?


My ADE-Version is: 1.7.2.1311

Also, I figured out that I did the rezipping wrong, since I zipped the directory which contains the "minetype" Files and the other stuff. So, since I did the rezipping hopefully right I get again the same Error as in the beginning:

Error: problem decrypting session key

Uff, thats frustrating ...

eric said...

Anonymous,

You said:

Well, but it seems that my problem is a few steps earlier, since I can't find the "activation.dat" within the Registry of WinXP. That confuses me, since ADE says that my Computer is authorized for my E-Mail-Adress. Could it be, that Adobe found a way to prevent the use of the firt python-Script?


My ADE-Version is: 1.7.2.1311

Also, I figured out that I did the rezipping wrong, since I zipped the directory which contains the "minetype" Files and the other stuff. So, since I did the rezipping hopefully right I get again the same Error as in the beginning:

Error: problem decrypting session key

Uff, thats frustrating ...



(1) You seem to have been able to use the ineptkey.pyw Python script to generate the adeptkey.der file, which means you must actually have activation.dat in your Windows XP Registry (or did at the time you generated adeptkey.der). This observation is consistent with the fact that ADE says your computer is authorized.

(2) The "problem decrypting session key" error that ineptepub.pyw reports basically says that ineptepub.pyw couldn't find and properly use encryptedKey ... /encryptedKey tag pair the rights.xml file, in the META-INF folder, in the zipped eBook.

These tags are enclosed in less than and greater than signs, which don't work properly in the text I am entering here as a comment.

encryptedKey ... /encryptedKey contains a suitably encrypted, base64-encoded key which has to be base64-decoded and then decrypted using adeptkey.der. Once it is decoded and decrypted, it can be turned into the "book key" or "session key" that will be used to decrypt the book itself. But if it is somehow not decoded/decrypted correctly, the byte referred to in the script as "bookkey[-17]" will turn out to be some value other than hex 00, and a "problem decrypting session key" error is generated.

(3) I would like to encourage you to send me as an attachment to e-mail (send it to epstewart2004@yahoo.com) at least the original eBook. I'd like to be able to tell you more about what is going on. If you want, also send me your re-zipped book. Optionally, send your adeptkey.der file, though you may feel unwilling to share a file from which I might be able to work backwards to get your Adobe ID and password. (I don't actually know how to do that, but I wouldn't blame you if you wanted to be careful about this.)

Somebody I am in touch with via the ePub & PDF decryption on Mac OSX thread here has sent me some software that does what ineptepub does, but does it better (if more slowly). I'd like to try your book with it. He has not authorized me to share this software with anyone else, so I can't send it to you ... sorry.

Anonymous said...

My guess is he/she messed up when they rezipped the epub and it can't find the encrypted info file which along with mimetype should not be compressed when creating the zip.

I would recommend simply unzipping, checking what that the properly xml encryption description file is there and then properly zipping it back up without compress on the right peices.

My guess it will then work like a charm.

Entropy said...

I've also had the "problem decrypting session key". I've tried a couple of items, and have unzipped/rezipped with no success. I'm using python 2.6.1 on Snow Leopard.

~ Kiran

Carrie said...

Many, many thanks for this. I had to downgrade to ADE 1.7.1 temporarily to generate the key, but everything else worked perfectly, and I was able to load my bought and paid for books onto my e-reader (Elonex 511EB) which I was unable to authorise through ADE as my iMac couldn't see it. Lovely job! Using Snow Leopard and Python 2.6.1 btw.

eric said...

As of about Feb. 1, 2010, some users, such as Entropy and others who have posted comments above, started getting "Problem decrypting session key" when running the INEPT EPUB Decrypter on Windows. This typically came as a result of downloading (or upgrading to) Adobe Digital Editions version 1.7.2, though many users did not draw the connection. For a discussion of what to do in this situation, see Decrypting Adobe Digital Editions 1.7.2 eBooks on Windows.

I have placed a note at the appropriate point in the text of my original post to guide users to the same discussion.

eric said...

Whoops, I didn't notice when I posted my last comment that Entropy uses a Mac, not Windows. As far as I know, there is not as yet a smooth solution to "Problem decrypting session key" for Mac users when it arises due to Adobe Digital Editions version 1.7.2. Some Mac users (such as myself) are not getting the problem. The best I can tell, that's because they upgraded from ADE 1.7.1 to 1.7.2, rather than starting off with 1.7.2 right away. An oddity of how the upgrade affects the crucial activation.dat file allows the procedure described in my main post to continue to work.

A workaround for new 1.7.2 users:

•Quit ADE 1.7.2 if it is open, but leave the ADE 1.7.2 application in your Applications folder.

•Trash your ~/Library/Application Support/Adobe/Digital Editions/activation.dat file.

•Download, to your Desktop, ADE 1.7.1 from here.

•Unzip it as folder Adobe Digital Editions 1.7.1.

•Double click the Adobe Digital Editions 1.7.1 application in that folder. ADE 1.7.1 will start up.

•If at any point you see a dialog box urging you to update to the new version of ADE, click on the button that allows you to update later.

•If you see a Setup Assistant allowing you to authorize or activate your computer, follow the instructions and enter your Adobe ID and password. At that point you should have a new activation.dat file in ~/Library/Application Support/Adobe/Digital Editions/. (If you don't see a Setup Assistant, use the "Authorize Computer ... " menu item in Library View in ADE to accomplish the same thing.)

•Quit ADE 1.7.1.

•Run the ADEPTKey Generator AppleScript discussed in the main blog post above to generate an adeptkey.der file.

•Open ADE 1.7.2, the version that is (typically) in your Applications folder from before. In Library View, use the "About Adobe Digital Editions" menu item to confirm which ADE version you are using.

•You should be able to use ADE 1.7.2 completely normally now. Any existing eBooks you have should show up in it. Any new Adobe eBooks you buy should be able to be downloaded normally by it.

•Use the new adeptkey.der file, the one you just generated, from now on to decrypt (new or old) Adobe eBooks, using the ineptepub Python script.

eric said...

Carrie,

You said:

Many, many thanks for this. I had to downgrade to ADE 1.7.1 temporarily to generate the key, but everything else worked perfectly, and I was able to load my bought and paid for books onto my e-reader (Elonex 511EB) which I was unable to authorise through ADE as my iMac couldn't see it. Lovely job! Using Snow Leopard and Python 2.6.1 btw.

You are very welcome. Enjoy!

Eric

hellokittyispretty said...

Hi Eric,
Thank you so much for these great instructions. They are by far the most user friendly, imo. I'm stuck on Step 3 when I run the Pycrypto installer. Here's what I get:

running install
running build
running build_py
running build_ext
building 'Crypto.Hash.MD2' extension
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk
Please check your Xcode installation
gcc-4.0 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.6/src/MD2.o -o build/lib.macosx-10.3-fat-2.6/Crypto/Hash/MD2.so
ld: library not found for -lbundle1.o
ld: library not found for -lbundle1.o
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/cE/cE33bxGpHO8BRMJBOtFoPU+++TM/-Tmp-//ccfrJzob.out (No such file or directory)
error: command 'gcc-4.0' failed with exit status 1

So based on this I reinstalled the xcode.mpkg from the dvd but I still get this error.

Any ideas? Thank you so much!

hk

eric said...

hellokittyispretty,

You asked about a problem running the PyCrypto installer. You tried reinstalling the Xcode tools from the Mac OS X installer DVD, but that didn't help.

First, check to see if /Developer/SDKs/MacOSX10.4u.sdk is present on your system, as its absence seems to have been the main complaint of gcc-4.0. That Software Developer Kit (SDK) has to be present for all this to work.

If it's not there, then try, this time, doing a Custom Install of Xcode Tools.mpkg from the OS X Installer DVD, providing yourself with the ability to make sure all possible items are check-marked.

No help? Then try manually deleting the whole /Developer folder from your system and redoing the Xcode Tools.mpkg Custom Install.

Still no help? Then you may have to re-install the entire Mac OS X release from the DVD, and then Xcode Tools.mpkg all over again. This will "wipe the slate clean," which I have found helpful in my own early attempts to get all this working. (At some point, you will then have to use Software Update to get everything back to the latest release, but you don't have to do that right away.)

Once you have a clean slate, make sure Adobe Digital Editions still works, then pick up the procedure in my main post from Step 3 on. That's the step in which you are installing PyCrypto, which should work fine after a clean-slate OS X install.

Good luck,
Eric

eric said...

Readers,

I have revised my original post (yet again!) because there is now (see Step 4) a new version of the ineptkey Python script for Windows users and also a brand new ineptkeymac script for Mac users.

Either the latest version (v.4.3) of the ineptkey Python script or the new ineptkeymac v.1 script for Mac users will produce an adeptkey.der output file that can (once again) be input to version 2 of the ineptepub script. v.2 has been the "standard" ineptepub version for a long time now, and it is again. Windows or Mac users can also use ineptepub_auto_version3.pyw (v.3 of ineptepub) or aineptepub.pyw (v.4.1 of ineptepub, which is different from v.4), both of which decrypt whole folders/directories rather than just a single Adobe/EPUB file.

Version 4 of ineptepub does not work with ineptkey v.4.3, the latest ineptkey version, but only with ineptkey v.4.2, which is now already obsolete ... and so ineptepub v.4 is likewise already obsolete.

While ineptkey v.4.2 was current, it generated an adeptkey4.der (not adeptkey.der) file in a different internal format than adeptkey.der. That file was intended for ineptepub v.4. When ineptkey v.4.3 came out, I mistakenly told readers to input its output file to ineptepub v.4, which led to "index out of range" errors. I have corrected my post to tell users to use ineptepub v.2. (Sorry for the confusion!)

Any adeptkey.der file that was generated prior to ADE version 1.7.2 is no longer usable with eBooks downloaded with ADE 1.7.2. Even though it's the right format for ineptepub v.2, it will produce a "problem decrypting session key" error when used with ADE 1.7.2-downloaded books. It will work only with books downloaded with ADE 1.7.1 or earlier.

Users that have an old adeptkey.der file that was generated while ADE 1.7.1 was active can, if they wish, hold onto it and use it to decrypt books that they downloaded before the ADE 1.7.2 update. Or they can re-download those books in ADE 1.7.2 and use a newly generated adeptkey.der file, from ineptkey v.4.3 or ineptkeymac v.1, to decrypt the newly downloaded books in any version of ineptepub other than v.4. I recommend the latter course, as it avoids having to keep track of which books were downloaded with which ADE versions.

Cheers,
Eric

Anonymous said...

I have downloade dbooks from my library via Overdrive. They go into Adobe Digital. I want to download from there to my Kindle 2, which I couldn't because of DRM.

I then downloaded the python software and calibre and got through the python which said the book had been decrypted...but when I asked caliber to covert it from an epub to a mobi to download to Kindle, it said it was DRM protected. So, my question...is the python software procedure not good for what i want it. Thanks for any help.

Anonymous said...

I solved the above problem and all is working.

Ron said...

Eric,

Terrific guide... I'm a complete novice to all this stuff, but I have a question/problem:

Some files seem to decrypt fine, but at least one gives me errors that read:

Error: File name in directory "OEBPS/BookTitle_chap-8n

...and then the rest of the error message (if there is any) is cut off. The file names are NOT file paths that exist on my Mac (at least not in the visible file structure). What's going on? Is there a way to turn on some kind of console so I can see if there is a longer error message? Any idea what's up?

Thanks again for a great guide!

eric said...

Ron,

You said:

Some files seem to decrypt fine, but at least one gives me errors that read:

Error: File name in directory "OEBPS/BookTitle_chap-8n

...and then the rest of the error message (if there is any) is cut off. The file names are NOT file paths that exist on my Mac (at least not in the visible file structure). What's going on? Is there a way to turn on some kind of console so I can see if there is a longer error message? Any idea what's up?


Thanks for the praise about my post...

EPUB files (regardless of whether they are Adobe-encrypted) are actually zipped folders containing multiple files, and some of these EPUB folders have been zipped incorrectly. ineptepub needs to unzip them in order to decrypt them, and incorrect zipping throws it for a loop.

You probably need to unzip and rezip the e-book, which will fix the incorrect-zipping problem, then use ineptepub.pyw on the rezipped version. I don't know how to do that on Windows platforms, but if you have a Mac:

1. Make a copy on the Desktop of your downloaded .epub file. Then change the file name's .epub extension to .zip. To do that, in Finder select the file on the Desktop and do a Command-I, or choose Get Info from the File menu, and change the extension from the file name box in the Get Info window. When asked whether you really want to change .epub to .zip, say "Use .zip".

2. Double click the .zip file so that Archive Utility in the Mac OS unzips it into a folder on your Desktop. (If double clicking the .zip file doesn't start the Archive Utility, you may have to manually open Archive Utility from /System/Library/CoreServices/Archive Utility.app and choose Expand Library from the Archive Utility's File menu, then navigate to and select the .zip file in the File Open dialog.)

3. Download and unzip ePub Zip 1.0.2.app.zip. Double click it to expand it to ePub Zip 1.0.2. Double click this expanded script app (you may have to tell the Mac that's it's OK to run this newly downloaded app), causing it to run an AppleScript. You may have to click the running script's icon in your dock to bring it to the front. Then use the Find File dialog box it presents to select the folder produced in step 2. After you receive a "successfully completed" dialog confirming that the script worked, you'll have a new .epub file on your Desktop. This one will (probably) work fine with the ineptepub.pyw script. Internally, it is actually a .zip file again, but it (like all EPUB eBooks) bears the .epub file name extension.

If you use Windows, I imagine something like WinZip might offer the ability to do the same unzip/rezip trick. Sorry I can't give you detailed instructions about that.

Best of luck ....

Evan said...

Hello Eric,

When I rightclick and select python.exe to run your ineptkey_v43.pyw I run into an error that says,

"The program can't start because python26.dll is missing from your computer. Try reinstalling the program to fix this problem."

I run Windows 7 64bit, and the file is actually there at "C:\Windows\SysWOW64".

When I try to just run the .pyw, I recieve a multiline error message:

"Traceback (most recent call last):
File "C:\Users\Name\Desktop\ineptkey_v43.pyw", line 230, in main
retrieve_key(keypath)
File "C:\Users\Name\Desktop\ineptkey_v43.pyw", line 149, in retrieve_key
vendor = cpuid0()
File "C:\Users\Name\Desktop\ineptkey_v43.pyw", line 112, in cpuid0
cpuid0__(buffer)
WindowsError: exception: access violation writing 0x01DD0A60"


Any ideas? You've done some great work here and I really appreciate all that you've done.

Evan said...

After more deliberation and tinkering, I got past the python26.dll error and am now running into the following,

"Python.exe - Application Error

The application was unable to start correctly (0xc000007b). Click OK to close the application."

While I suppose this is a step in the right direction, the possibilities as to what this error might mean are endless thanks to Google. I'm running virus scans right now, but do you have any suggestions past that? Your work is fantastic and I really do appreciate the help.

With Glowing Hearts,
Evan

eric said...

Evan, you said:

After more deliberation and tinkering, I got past the python26.dll error and am now running into the following,

"Python.exe - Application Error

The application was unable to start correctly (0xc000007b). Click OK to close the application."

While I suppose this is a step in the right direction, the possibilities as to what this error might mean are endless thanks to Google. I'm running virus scans right now, but do you have any suggestions past that? Your work is fantastic and I really do appreciate the help.


I'm way over my head here, as I'm a Mac user who also occasionally uses Windows XP by virtue of Parallels software emulation for the Mac.

My guess is that there is an incompatibility among any or all of (a) the ineptkey_v43.pyw script, (b) Windows 7, (c) the version of Python you are using, and (d) your computer's 64-bit processor.

But you already knew that, I'm sure.

I'd like to know exactly which version of Python you have. When I wrote my post, v. 2.6.4 was current, and the link I provided to it still works. But maybe 2.6.4 is incompatible with your system, so if that's the version you obtained, you could try the latest Windows version of Python 2.6, namely 2.6.5, downloaded from here.

That's not a 64-bit version, which can instead be accessed here.

But a little hunting around in Google shows me that some people are having trouble with 64-bit Python 2.6 in Windows 7 (for example, see here).

I would also like to know what you did to cure the python26.dll error. I wonder if that isn't a clue ...

Is it possible that you have residue from multiple Python installs/versions?

Best of luck,
Eric

Mac Girlie said...

You, Sir, are awesome! Thank you so much for your ultra-comprehensive guide. Thanks to it and your responses to questions, I was able to import my Sony books to my iPad (I sold the Sony to defray the iPad).

An odd thing I noticed: the free books I d/l'ed from Sony (ePub) decrypted right away with ineptpub. The ones that I paid for (that had a price) required rezipping/unzipping & the application of the ePub Zip script in order to decrypt. Interesting.

Do you by chance have instructions for doing the same to Kindle ePub books?

I'm really glad this is out there. Companies need to realise that some of us just want to be able to move books to other devices and not have to rebuy the title. I would no more photocopy a paper book than I would share the digital files: the whole point is to have versatility in where & how you read what you've purchased.

Thanks again!

eric said...

Mac Girlie,

You said:

You, Sir, are awesome! Thank you so much for your ultra-comprehensive guide. Thanks to it and your responses to questions, I was able to import my Sony books to my iPad (I sold the Sony to defray the iPad).

An odd thing I noticed: the free books I d/l'ed from Sony (ePub) decrypted right away with ineptpub. The ones that I paid for (that had a price) required rezipping/unzipping & the application of the ePub Zip script in order to decrypt. Interesting.

Do you by chance have instructions for doing the same to Kindle ePub books?

I'm really glad this is out there. Companies need to realise that some of us just want to be able to move books to other devices and not have to rebuy the title. I would no more photocopy a paper book than I would share the digital files: the whole point is to have versatility in where & how you read what you've purchased.

Thanks again!



You're welcome. We aim to please ...

Interesting, that the eBooks with a price required unzipping/rezipping, but not the free eBooks.

You may wan to check out this forum post for a way to do the unzip/rezip trick on a Mac using the Terminal command-line interface.

All of us fans of eBooks need to read this hugely interesting article that appeared recently in The New Yorker magazine. It discusses the iPad and its rivalry with Amazon's Kindle and also with Google's efforts to put books online. The economics of book publishing may surprise some readers.

No, sorry. I don't know of a way to decrypt Kindle eBooks so they can be moved to other reading devices. But keep in mind that we can already move them to the free Kindle app on iPods/iPhones. I haven't heard specifically whether that app or a similar one exists yet for the iPad, but I would be surprised if one isn't either here already or on the way.

Cheers, Mac Girlie!

Anton said...

Eric, I use a Mac, and up to the point where I compile ineptepub_v2 everything is fine. I actually have 2 build options in the context menu: Open With Build Applet 2.6.0 and 2.5.4. Well, apps build with 2.6.0 just silently quit, ineptepub_v2 built with 2.5.4 says that I have to install PyCrypto first (which I already did with no errors). What should I do?

Anonymous said...

Eric,

Thanks for the guidelines. I was able to move 70 percent of my library over to my new iPad. Fantastic.

I use a Mac, and occasionally I get a error message such as:

"File name in directory "OEBPS/Drood_Chap-8.h"

Am I doing something incorrect when this occurs, or is it just a peculiarity in a file?

Thanks again.

eric said...

Anonymous,

You asked:

I use a Mac, and occasionally I get a error message such as:

"File name in directory "OEBPS/Drood_Chap-8.h"

Am I doing something incorrect when this occurs, or is it just a peculiarity in a file?


You need to do the unzip/rezip trick. To find out how, see my answer to a similar question from Ron, dated April 25, 2010, in the list of comments above. Also see my response to Mac Girlie on April 30, 2010.

Cheers,
Eric

eric said...

Anton,

You asked:

I use a Mac, and up to the point where I compile ineptepub_v2 everything is fine. I actually have 2 build options in the context menu: Open With Build Applet 2.6.0 and 2.5.4. Well, apps build with 2.6.0 just silently quit, ineptepub_v2 built with 2.5.4 says that I have to install PyCrypto first (which I already did with no errors). What should I do?

Based on my own experience with a similar problem, I think your problem stems from having two versions of Python on your Mac. To fix my own problem I had to do a clean install of Mac OS X, using the original install DVD. I also re-installed the Developer tools at the same time. Once I had done that, I had just Python 2.5.x on my Mac, and version 2.6 was gone.

I then re-did all the steps in my post above, starting with Step 3. (Of course, I didn't have to do Step 5, in which I obtained eBooks, since I already had those.)

At that point, everything worked as advertised.

Later on, I allowed Software Update to update my system software to the most recent release, but that made no difference to my ability to use Python and PyCrypto as advertised.

Best of luck ...

Eric

Anonymous said...

I was so PO that I could not read a book I bought from Sony on my Iphone or Ipad due the the DRM code. I a have a mac and followed you great step by step instruction and am now enjoying the book using the stanza app. thanks so much ,

eric said...

Anonymous, you said,

I was so PO that I could not read a book I bought from Sony on my Iphone or Ipad due the the DRM code. I a have a mac and followed you great step by step instruction and am now enjoying the book using the stanza app. thanks so much

Happy to help!

Cheers,
Eric

tuneZfull said...

Everything works gr8 for PDFs so I know everything is installed correctly. But, I get an error MSG for epubs: Error: File name in directory “O
Mac OSX 10.5.8, Python 2.6, PyCrypto 2.1.0, ineptepub_v2.py [I noticed you just appended the py after pyw...]
I tried the zip trick, the files were readable - someone said not to rezip the mimetype file...?
This is the 1st x trying epub. I DLed it from the Northern CA digital library.
Gr8 info you’ve provided. I bought an iPad and couldn’t wait to read books on it. DRM is so nonsensical - I can buy a hard cover, read it, gift it, and not expect the gestapo to kick down my door but buy a digital book and I can’t even share it to my iPad!!

denise said...

I just wanted to let you know your clear and thorough steps worked for me. I'm running 10.6.3 and have DE 1.7.2. I did have to complete a couple of extra steps (that you documented) for this to work):
1. I have a couple of different Build Applets available (2.6.0, 2.5.4, and 2.5.alpha0). For the ineptkeymac_v1 script I had to use build 2.5.4 (when I used 2.6.0 it simply wouldn't open). With ineptepub_v2 I had to use the 2.5.alpha0. I basically kept rebuilding until I had an app that would launch.
2. I did have to complete the epub to zip back to epub steps.
Your site was the first I found that clearly outlined the necessary steps for epub on a Mac. Thank you!

Anonymous said...

Denise,

You wrote:

I just wanted to let you know your clear and thorough steps worked for me. ... Your site was the first I found that clearly outlined the necessary steps for epub on a Mac. Thank you!

You're welcome!

... I have a couple of different Build Applets available (2.6.0, 2.5.4, and 2.5.alpha0). For the ineptkeymac_v1 script I had to use build 2.5.4 (when I used 2.6.0 it simply wouldn't open). With ineptepub_v2 I had to use the 2.5.alpha0. I basically kept rebuilding until I had an app that would launch.

That information may be very helpful to others. Thanks.

I did have to complete the epub to zip back to epub steps.

The unzip/rezip trick, which is spelled out in earlier comments to this post, seems to be a necessary extra step for a whole lot of Adobe-DRM EPUB books.

Cheers,
Eric

Unknown said...

Your instructions are wonderful. Thank you so much!

eric said...

Tina,

You said:

Your instructions are wonderful. Thank you so much!

You're welcome! Enjoy your eBooks!

Eric

Anonymous said...

Your information is absolutely amazing. I have just about all of the above situations going on (i.e. bought some books on spouse's system, some bought on my old Windows system, some on my new Mac system, files that need zip and unzip - some were the free books, some paid, etc.) I have about 200 books that are in the DRM eReader files that need to be decrypted so that I can read them on my new iPad. Is there a way to do that en masse - or do I need to continue solve each one individually? (Which was a fun puzzle for a while, but I still have 150 books to go. :-) THANK YOU!!!

eric said...

Anonymous,

You said:

Your information is absolutely amazing. I have just about all of the above situations going on (i.e. bought some books on spouse's system, some bought on my old Windows system, some on my new Mac system, files that need zip and unzip - some were the free books, some paid, etc.) I have about 200 books that are in the DRM eReader files that need to be decrypted so that I can read them on my new iPad. Is there a way to do that en masse - or do I need to continue solve each one individually? (Which was a fun puzzle for a while, but I still have 150 books to go. :-) THANK YOU!!!

You're very welcome!

Sorry, but I know of no way to batch-process the 150 books you have left. Especially because so many Adobe EPUB books need the unzip/rezip trick, the complexity of the sequence of events you have to use to decrypt a given book is high. Automating it to do X number of books at a time would, I think, be a major undertaking for a software developer.

Your question made me think of possibly using AppleScript on a Mac to automate the task, but I doubt that approach could be made to work, because the crucial ineptepub script is non-AppleScript compatible and can't even be run indirectly by AppleScript as a Unix command-line routine.

Of course, even if AppleScript would do the trick on a Mac, it would be of no use on Windows PCs.

So I'm sorry, but it looks like you'll just have to do each book individually.

You might consider first doing the unzip/rezip trick on every book you have, as it can't hurt, and it involves a repetitive set of steps that you can almost do in your sleep. Then you can use ineptepub repetitively to decrypt each book in its turn. If you have all the input books in a single folder, you can select them one by one with relative ease. Copying each book's title to the clipboard will give you a leg up in specifying the output filename.

Other than things like that which can speed things up just a little bit, I don't know what else to tell you ...

You didn't mention whether your computer is a Mac, but if it is you can ask for more advice at the ePub & PDF decryption on Mac OSX forum thread.

Otherwise, try Adobe ADEPT DRM for EPUB circumvented.

novelnelle said...

Thank you for such a detailed guide :) I seem to be having a problem getting pycrypto to install. When I run the program I get the following error

copying build/lib.macosx-10.3-fat-2.6/Crypto/Cipher/AES.so -> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Crypto/Cipher
error: could not delete '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Crypto/Cipher/AES.so': Permission denied

Do you have any idea how I might get around this?

eric said...

Novelnelle, you said:

Thank you for such a detailed guide :) I seem to be having a problem getting pycrypto to install. When I run the program I get the following error

copying build/lib.macosx-10.3-fat-2.6/Crypto/Cipher/AES.so -> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Crypto/Cipher
error: could not delete '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Crypto/Cipher/AES.so': Permission denied

Do you have any idea how I might get around this?


You are very welcome!

I gather you are using a Mac. If so, then I'm wondering if you may not have accidentally grabbed the PyCrypto intended for Windows. The one you want for the Mac is here.

With a Mac running Mac OS X 10.5.x Leopard the Python that installs from the Mac OS X installer DVD is version 2.5, not 2.6, so any software which looks for

/Library/Frameworks/Python.framework/Versions/2.6/ ...

won't find it.

It is possible that the link above will get you a PyCrypto that installs fine, be also it is possible that the attempt to install the other PyCrypto messed things up. If you still have problems after getting the right PyCrypto, you may have to do a Custom Re-install of Xcode Tools.mpkg from the OS X Installer DVD.

Still no help? Then you may have to do a "clean" install of the entire Mac OS X release from the DVD, and then Xcode Tools.mpkg all over again. This will "wipe the slate clean," which I found helpful in my own early attempts to get all this working.

If you do re-install the Mac OS release from the DVD, then at some point you will want to use Software Update to update to the latest Leopard version, and also to update the various other items of Apple software.

Good luck,
Eric

nualaorourke said...

Thank you so much. Your instructions are so clear and easy to follow.

I have managed to import all my Adobe DRM books into the Books app on my iPad.

Thank you again - you are brilliant.

eric said...

nualaorourke said...

Thank you so much. Your instructions are so clear and easy to follow.

I have managed to import all my Adobe DRM books into the Books app on my iPad.

Thank you again - you are brilliant.


Thanks, nuala, for you praise. I stood on the shoulders of the giants who figured out how to do this and wrote the Python scripts, etc. I just wanted the ADEPT decryption process to be accessible to one and all.

Cheers,
Eric

hirte_7 said...

Hi Eric,

As al tho others I am impressed about your instructions. Unfortunately I got stuck somewhere but do not really know where. I am on Snow Leopard 10.6.3 and freshly installed ADE 1.7.2
I ran the PyCrypto Installer and the Side Package was installed into /library/Frameworks/Python.frameworks/versions/2.6/lib/python2.6/site-packages and not into /library/Python/2.6 as I believe you described in the instructions. Not sure if this is a problem?

Now when I run ineptkeymac_v1 nothing happens. The script starts and ends within a second. The same happens with ineptepub_v2.

By the way it looks like I am having python 2.3 2.5 and 2.6 on the system...

thanks for any suggestion you might have.

hirte_7 said...

Just one addition- I just re-ran both py files - this time with Build Applet 2.5.4. Now both apps start as you describe. BUT ineptepub v2 says that Pycrypto is not installed. That I do not understand, as the installer I believe worked?

Marko said...

Thank you, thank you, thank you! Your step by step instructions are fantastic! I looked all over the web trying to figure out how to decrypt my books and your blog was my last hope. I followed your clear instructions and it all works so easy. Thanks for all the work, it's appreciated.

eric said...

Marko, you said:

Thank you, thank you, thank you! Your step by step instructions are fantastic! I looked all over the web trying to figure out how to decrypt my books and your blog was my last hope. I followed your clear instructions and it all works so easy. Thanks for all the work, it's appreciated.

You're welcome! Read in good health!

Eric

eric said...

hirte_7, you said:

hirte_7 said...
Hi Eric,

As al tho others I am impressed about your instructions. Unfortunately I got stuck somewhere but do not really know where. I am on Snow Leopard 10.6.3 and freshly installed ADE 1.7.2
I ran the PyCrypto Installer and the Side Package was installed into /library/Frameworks/Python.frameworks/versions/2.6/lib/python2.6/site-packages and not into /library/Python/2.6 as I believe you described in the instructions. Not sure if this is a problem?

Now when I run ineptkeymac_v1 nothing happens. The script starts and ends within a second. The same happens with ineptepub_v2.

By the way it looks like I am having python 2.3 2.5 and 2.6 on the system...


Just one addition- I just re-ran both py files - this time with Build Applet 2.5.4. Now both apps start as you describe. BUT ineptepub v2 says that Pycrypto is not installed. That I do not understand, as the installer I believe worked?


I'm concerned about the part where you reported that "I ran the PyCrypto Installer and the Side Package was installed into /library/Frameworks/Python.frameworks/versions/2.6/lib/python2.6/site-packages and not into /library/Python/2.6 as I believe you described in the instructions. Not sure if this is a problem?"

I'm not on my own computer right now, so I can't do a lot of checking. But I believe you need to make sure the PyCrypto install uses the specific directory I indicated in the main instructions. If the PyCrypto software goes into a different directory, the Python script which uses it will report that PyCrypto is not installed.

You might try copying the installed version of PyCrypto into the directory I mentioned ... but be sure you save a copy of the unmodified directory so you can back out of the change if necessary.

I'll look further into this when I get home and report back anything that may be helpful ...

eric said...

hirte_7,

To add to what I said before: I'm now at my regular computer at home, a Mac running OS X 10.5.8. My PyCrypto installation was definitely into the /Library/Python/2.5/site-packages/ folder. Your PyCrypto installation went into /Library/Frameworks/Python.frameworks/versions/2.6/lib/python2.6/site-packages, and that's wrong.

I hope you didn't get a Windows version! You needed to go here and click on the "Download" button to obtain PyCrypto 2.0.1, then go here to download PyCrypto_2.0.1_Installer.app.zip, which, when unzipped, expands into an AppleScript app called PyCrypto_2.0.1_Installer. Then you should have run that AppleScript and pointed it at the PyCrypto 2.0.1 folder that you downloaded.

Dr. C. Jeffrey Terrell said...

Unbelievably helpful...and I would've never figured it out otherwise!! Thanks so much.

hirte_7 said...

Hi Eric,

I copied the Folder from the "wrong" place to the Correct one, regenerated the adeptkey, and now it works! Thanks for your help and all you terrific work on this topic. Gorgeous.

eric said...

Dr. C. Jeffrey Terrell said...

Unbelievably helpful...and I would've never figured it out otherwise!! Thanks so much.

You're welcome! Enjoy your books!

Cheers,
Eric

eric said...

Anonymous said...

Thank You!

You're welcome!

eric said...

hirte_7 said...

Hi Eric,

I copied the Folder from the "wrong" place to the Correct one, regenerated the adeptkey, and now it works! Thanks for your help and all you terrific work on this topic. Gorgeous.


Glad everything is working!

For the benefit of anyone else who runs into the same problem, hirte_7's PyCrypto install went into the "wrong" folder, for uncertain reasons, so when the ineptepub Python script tried to use it, it was not found. Solution: after installing PyCrypto in Step 3 above, copy the contents of the

/Library/Frameworks/Python.frameworks/versions/2.6/lib/python2.6/site-packages/

folder to

/Library/Python/2.5/site-packages/

This applies to a Mac, by the way, and does not apply to Windows computers.

hirte_7 had both Python version 2.5 and version 2.6 installed on his/her Mac. The instructions in the main post above assumed only version 2.5 exists on the Mac being used. I don't know for sure, but Python version 2.6 (which doesn't work with these instructions) may have shown up for hirte_7 because hirte_7 is using Mac OS X 10.6.x 'Snow Leopard" and I am using 10.5.x "Leopard." Anyway, many people who have Python 2.6 on their Mac seem to have problems with this set of instructions, but I'm not sure how to avoid them. Hence the need for using a workaround such as copying the contents of Python's "site-packages" folder after a PyCrypto install.

Also, It isn't really necessary to regenerate the adeptkey.der file after using the workaround just described, since the ineptkey script that does so does not use PyCrypto.

James said...
This comment has been removed by the author.
Anonymous said...

I have tried the steps above, everything works right up until the end when I get the error "Ciphertext is too large" What is happening here? It was a book downloaded from the local library in epub format.

eric said...

Anonymous,

You said:

I have tried the steps above, everything works right up until the end when I get the error "Ciphertext is too large" What is happening here? It was a book downloaded from the local library in epub format.

Hmm ... never seen that one before!

The first thing to try is to use the unzip/rezip trick detailed above in some earlier comments to my original post. It may be that the eBook was improperly turned into a ZIP file.

All Adobe eBooks are really EPUBs, which are ZIP files. The Adobe DRM is applied to the ZIP file, and if the ZIP file is poorly constructed, maybe this "Ciphertext is too large" error can happen as a result

Then again, maybe not. If the unzip/rezip trick doesn't help, please either tell me so with another comment posted here, or send email to me at the email address at the top of the blog page. I'll work with you to solve the problem if at all possible.

Anonymous said...

Eric,

I have used your method quite successfully, but found a new epub file not cooperating. I change it to .zip, but when I go to extract it, it becomes a .zip.cpgz file, not a folder.

Any ideas?

eric said...

OK, I can't explain why this happened:

I got email saying that "Anonymous" had left a comment ...

Eric,

I have used your method quite successfully, but found a new epub file not cooperating. I change it to .zip, but when I go to extract it, it becomes a .zip.cpgz file, not a folder.

Any ideas?


... but I don't see the actual comment here!

Anyway, if you're still with me, Anonymous, I'd like to ask what kind of platform you have, Windows or Mac? What method did you try to use to extract the ZIP file?

It looks like the method you tried to use assumed your intention was to compress the file, not extract it, and furthermore, to compress it as a compressed UNIX CPIO Archive file, which is an alternative way to compress a computer file ... even an already compressed ZIP file!

That, of course, is not what you need to do. You need to find the correct way to extract the zipped file; then (I assume) you want to find the way to rezip it so that ineptepub will decrypt it successfully.

In earlier comments above, I've talked about ways to do those things on Windows and Mac platforms. Check them out ... and if you still have questions, post another comment here or contact me at the email address at the top of the original post.

Good luck!

Andrew McD said...

Hi Eric

Do you know if anyone has had success with this in Windows Vista? When running ineptepub_v2.pyw and attempting decryption I simply get a message saying "Error: problem decrypting session key."

Thanks

Andrew

Andrew McD said...

Hi Eric

Just another comment - I have computers running Windows Vista, Windows 7, Mac OSX 10.4 and Mac OXS 10.6 Snow Leopard(just about everything except what I need it seems). Obviously I am also willing to try the method on any of these if you think it is worth trying.

Thanks

Andrew

Anonymous said...

Hi, You mention that this will work on iod touch, Will it work on ipad? I'm tring to get a librarly book from my mac to my ipad. Thanks. Linda

eric said...

Anonymous (Linda) said:

Hi, You mention that this will work on iod touch, Will it work on ipad? I'm tring to get a librarly book from my mac to my ipad. Thanks. Linda

No guarantees, since I don't yet have an iPad. But if the free iBooks app from Apple works the same on an iPad as it does on my iPhone — and I believe it does, except I'm not sure to what extent you'll be able to take advantage of the larger screen or the standard assortment of fonts with the "open" EPUB books you derive from Adobe DRM'ed e-books — you're in luck.

If you follow the instructions in my main blog entry above (and, if need be, the problem-solving workarounds detailed in some of the comments) then for each Adobe e-book you decrypt, you will wind up with an open EPUB file that is not locked into the Adobe Reader world.

Add that file (it will have an .epub filename extension) to your iTunes library. On a Mac, you can just drag the file's Finder icon to either the iTunes icon in the Dock or to the Books icon on the left side of the main iTunes window. On Windows, you can use, I believe, similar shortcuts.

Once the file shows up in iTunes' Books section, you can, in iTunes, just sync your iPad, and then you can read the book in the iBooks app on the iPad!

I find that the Adobe-derived open EPUBs I have tried so far in iBooks work about the same as books from the iBookstore.

What's not to like!

eric said...

Anonymous (Linda) asked in an earlier comment whether the open EPUBs she decrypts from Adobe DRM'ed e-books will work on an iPad. I told her, basically, yes, if the iPad version of the free iBooks app is sufficiently like the version I'm using on my iPhone.

I'd now like to add to that:

I have found that some but not all of the e-books I have treated in the way I described do not show up as having a pretty cover, either in iTunes or in the iBooks app. Some have no cover at all. Here's how to fix that:

In your web browser, bring up Google and click on the Images tab at upper left. In the search box enter the name of the book and, to make sure Google knows exactly what you're looking for, the author's name, both in quotation marks. For example:

"an echo in the bone" "diana gabaldon"

Click Search Images. Most of the results you see will be images of the actual book's cover. Click on an thumbnail image you like — the larger the dimensions in pixels of the actual image, the better. At the top of the page that comes up, click on "See full size image." Then left-click on the image that comes up and select "Copy Image." (This works on a Mac using Safari. If you are on Windows, or using another browser, you may have to make adjustments.)

You now have a copy of the image on your Clipboard. In iTunes, click on Books on the left side of the main window, then select the book the cover goes with and choose the Get Info menu item. (Mac shortcut: Command-I.) Click on the Artwork tab, then click in the (typically blank) artwork box. Paste the Clipboard's contents there, and click OK.

In a few seconds you will see the new cover artwork show up in the main iTunes window. Now sync your iPad in iTunes. Once you do that, the new cover artwork will likewise show up on your iBooks library's bookshelf!

eric said...

Andrew McD asked:

Do you know if anyone has had success with this in Windows Vista? When running ineptepub_v2.pyw and attempting decryption I simply get a message saying "Error: problem decrypting session key."

and then added:

I have computers running Windows Vista, Windows 7, Mac OSX 10.4 and Mac OXS 10.6 Snow Leopard(just about everything except what I need it seems). Obviously I am also willing to try the method on any of these if you think it is worth trying.

Andrew,

You may need to try the unzip/rezip trick detailed in some of the earlier comments. Many Adobe e-books (which are, like all EPUBs, ZIP files) have an incorrect internal format, and unzipping and then rezipping them fixes that.

Here's how, using Mac OS X Leopard 10.5:

1. Make a copy on the Desktop of your downloaded .epub file. Then change the file name's .epub extension to .zip. To do that, in Finder select the file on the Desktop and do a Command-I, or choose Get Info from the File menu, and change the extension from the file name box in the Get Info window. When asked whether you really want to change .epub to .zip, say "Use .zip".

2. Double click the .zip file so that Archive Utility in the Mac OS unzips it into a folder on your Desktop. (If double clicking the .zip file doesn't start the Archive Utility, you may have to manually open Archive Utility from /System/Library/CoreServices/Archive Utility.app and choose Expand Library from the Archive Utility's File menu, then navigate to and select the .zip file in the File Open dialog.)

3. Download and unzip ePub Zip 1.0.2.app.zip. Double click it to expand it to ePub Zip 1.0.2. Double click this expanded script app (you may have to tell the Mac that's it's OK to run this newly downloaded app), causing it to run an AppleScript. You may have to click the running script's icon in your dock to bring it to the front. Then use the Find File dialog box it presents to select the folder produced in step 2. After you receive a "successfully completed" dialog confirming that the script worked, you'll have a new .epub file on your Desktop. This one will (probably) work fine with the ineptepub.pyw script.

You are not running 10.5 Leopard, so you may have to make adjustments.

If that doesn't solve your problem, try another possible workaround: use aineptepub.pyw, version 4.1 in place of the ineptepub version you are now using. I have heard that it can avoid certain problems of the type you are experiencing. You use it as you are currently using ineptepub, except that its input and output fields point to paths to whole folders, not to individual files. The input folder contains one or more DRM-encrypted Adobe Digital Edition e-books. The output folder will contain the decrypted EPUB e-books.

Best of luck!

Andrew McD said...

Hi Eric

After I left the comment I actually found a post of someone who got it to work on Snow Leopard - with an extra instruction you left on the post (moving pycrypto from the Python 2.6 to the Python 2.5 folder). Got it to work on SL after a couple of tries - so thank you thank you thank you! My grandmother who is suffering from Macular Degeneration will now be able to enjoy the ebooks she requested on her brand new iPad.

All the best

Andrew

eric said...

Andrew McD said:

After I left the comment I actually found a post of someone who got it to work on Snow Leopard - with an extra instruction you left on the post (moving pycrypto from the Python 2.6 to the Python 2.5 folder). Got it to work on SL after a couple of tries - so thank you thank you thank you! My grandmother who is suffering from Macular Degeneration will now be able to enjoy the ebooks she requested on her brand new iPad.

I'm glad you got it working on Snow Leopard. Also, that your grandmother with macular degeneration can now use her brand new iPad to enjoy her e-books. (My mother was a victim of macular degeneration, so your story resonates with me.)

I am going to try to put together a new blog entry that details some of the workarounds and fixes that have shown up in this list of comments, so that users can more readily find them. I myself have lost track of some of them. I should have mentioned the one to you about moving pyCrypto ....

up till 5am trying to figure this out said...

Thanks for the detailed instructions. I wish I had started with this page instead of fooling around with other instructions on the web.

Like some other readers, I am also having trouble installing pycrypto. I have Mac 10.5.8 and tonight I foolishly installed and subsequently deleted (because I didn't know how to properly uninstall) python 2.6 and 2.7.

I was initially following another thread on the net, which led me to downlad 2.6 and 2.7, and then when the installation of pycrypto according to your instructions here failed, I figured out that it was referring to 2.6 instead of 2.5, which is why i hastily deleted 2.6 and 2.7. I know you're never supposed to just deleted apps but I was impatient after following various instruction for hours and hours... I later found the follow up questions and work-arounds in the comments and tried to restore 2.6 and 2.7, as well as the folders under "Python.Framework/Versions", but it didn't work.

This is the latest error message I get when trying to install pycrypto, and I think it's actually worse than when I had deleted 2.6, because it again refers to 2.6.

python setup.py install
running install
running build
running build_py
running build_ext
building 'Crypto.Hash.MD2' extension
gcc-4.0 -arch ppc -arch i386 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -Isrc/ -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/MD2.c -o build/temp.macosx-10.3-fat-2.6/src/MD2.o
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1

At this point I think it's a jumbled mess and I fear I have to reset something, which is difficult because I have a MacBook Air (no dvd slot). I wish I can install 2.5 afresh or something but it seems it's no longer a supported version so there's no easy installation option for newbies like me.

Thanks...

eric said...

up till 5am trying to figure this out said...

Like some other readers, I am also having trouble installing pycrypto. I have Mac 10.5.8 and tonight I foolishly installed and subsequently deleted (because I didn't know how to properly uninstall) python 2.6 and 2.7.

I was initially following another thread on the net, which led me to downlad 2.6 and 2.7, and then when the installation of pycrypto according to your instructions here failed, I figured out that it was referring to 2.6 instead of 2.5, which is why i hastily deleted 2.6 and 2.7. I know you're never supposed to just deleted apps but I was impatient after following various instruction for hours and hours... I later found the follow up questions and work-arounds in the comments and tried to restore 2.6 and 2.7, as well as the folders under "Python.Framework/Versions", but it didn't work.

This is the latest error message I get when trying to install pycrypto, and I think it's actually worse than when I had deleted 2.6, because it again refers to 2.6.

... (snip) ...

At this point I think it's a jumbled mess and I fear I have to reset something, which is difficult because I have a MacBook Air (no dvd slot). I wish I can install 2.5 afresh or something but it seems it's no longer a supported version so there's no easy installation option for newbies like me.


Up Till,

There's a chance this might work: Copy the contents of the

/Library/Frameworks/Python.frameworks/versions/2.6/lib/python2.6/site-packages/

folder to

/Library/Python/2.5/site-packages/

Assuming both of those .../site-packages/ folders exist and the former has contents at all, there should be a Crypto folder and some other stuff in there. Copy all of those contents to /Library/Python/2.5/site-packages/. You may then be able to run the ineptepub script successfully.

If

/Library/Frameworks/Python.frameworks/versions/2.6/lib/python2.6/site-packages/

doesn't exist, then do a Finder search on site-packages as a file (actually, folder) name. You will have to expand the search to use the "System files ... include" option. If you find a site-packages folder that contains a Crypto folder, then copy all of the contents of that site-packages folder to

/Library/Python/2.5/site-packages/

and try to run ineptepub.

If none of that works, you will have to do a clean install of Mac OS X 10.5.x. See "Complete Steps to Perform a Clean OS X Reinstall on Your MacBook Air" for a how-to on that.

After doing the clean install, you will need to re-install the Xcode Developer Tools, among which are Python 2.5. Using your OS X 10.5.n Install DVD — the instructions I just mentioned give you two options for how to access it from your MacBook Air — navigate to and then double-click Mac OS X Install DVD:Optional Installs:Xcode Tools:Xcode Tools.mpkg. You will be led by the installer program which opens through the necessary steps to install the Developer Tools package.

Once all of that is done, follow all of the instructions in the main blog entry above.

Best of luck!

Zevs said...

Hi!

Thanks for the good insturctions, had to use ineptkey v5 though and then ineptpub v5.2 in order to get this to work.

Is there any way to do the decrypting in batch mode, e.g. doing more than one book at a time?

eric said...

Zevs said...

Hi!

Thanks for the good insturctions, had to use ineptkey v5 though and then ineptpub v5.2 in order to get this to work.


Thanks!

For others' benefit: ineptkey v5 can be obtained here. ineptpub v5.2, here. They are mainly for Windows but can ostensibly be used on a Mac, but I find the instructions contained in the scripts themselves as comments for OS X users don't work for me, so watch out, Mac users!

I did get the scripts to work on my Mac by opening them in Build Applet and making an app out of each. My ineptkey v5 app generated a correct adeptkey.der file, though putting it inconveniently at the root level of my Mac's directory structure (with no File Open dialog to put it elsewehre). ineptpub v5.2 then worked as advertised to decrypt an e-book I tested it with.

Is there any way to do the decrypting in batch mode, e.g. doing more than one book at a time?

AFAIK, there is no way to batch these decryptions. Sorry.

Unknown said...

Dear Eric,

Your suggestions are very promising. Yet I am not successful with the last (final) action. Once I try to run the script "ineptepub_v2 ' the following error message is shown:" IDLE's subprocess did not make connection. Either IDLE can not launch a subprocess or personal firewall software is blocking the connection. " I have no Firewall blocking active. Do you have any suggestion how to solve this problem?

Many thanks, Erik

eric said...

Erik said...

... I am not successful with the last (final) action. Once I try to run the script "ineptepub_v2 ' the following error message is shown:" IDLE's subprocess did not make connection. Either IDLE can not launch a subprocess or personal firewall software is blocking the connection. " I have no Firewall blocking active. Do you have any suggestion how to solve this problem?

This is a new problem that I have never heard of before, Erik. I Googled "IDLE's subprocess did not make connection" and got a number of hits. It looks as if IDLE, says Wikipdia ...

... is an integrated development environment for Python, which is bundled in each release of the programming tool since 2.3. It is not included in the python package included with many Linux distributions.

I don't seem to have IDLE on my Mac OS X platform, which is Linux-like.

Anyway, your problem would seem to be related to the Python environment on your system. You don't say which version of Python and which version of Windows you are using, and those may make a difference.

According to this web page, it can in fact be a problem with how Windows firewall software is being used. Are you absolutely certain you have no firewall blocking active?

Does the problem persist after a system restart? I suppose it's not impossible that some transient state that keeps things from working for you would be cleared by a restart.

If that doesn't work, then I suggest you Google "IDLE's subprocess did not make connection" and sort through the hits you get. I did that but found most of them over my head.

I did glean that it is possible to run IDLE from the command line, i.e., cmd.exe. There are several hits that indicate a file named idle.py (or idle.pyw) exists somewhere on your PC and when run from the command line, sets up a process which proceeds to create a subprocess. The latter and the former then try to communicate with one another using an interface that firewalls can interfere with. Using the -n option when executing idle.py from the command line can apparently avoid the use of the subprocess entirely. You might want to try that, but I make no guarantees that it willl help.

Beyone that, I am afraid I can offer no more assistance.

Good luck in tracking down your problem!

Eric

Unknown said...

Dear Eric,

I have reboot my Apple (OX 10.5.8). There is a Python 2.5 on my computer. The remarkable thing is that now nothing happens when I double click on 'ineptepub_v2'!?

Unknown said...

New details, after trying and dubbelclick on 'ineptepub_v2' a message appears 'This script requiers PyCrypto, which must be installed separately.'

Any suggestions?

eric said...

Erik said...

I have reboot my Apple (OX 10.5.8). There is a Python 2.5 on my computer. The remarkable thing is that now nothing happens when I double click on 'ineptepub_v2'!?

... and then ...

New details, after trying and dubbelclick on 'ineptepub_v2' a message appears 'This script requiers PyCrypto, which must be installed separately.'

Any suggestions?


OK, Erik, now we're dealing with a problem I've seen before ... ineptepub doesn't find your PyCrypto installation where it expects it to be.

I have some suggestions:

(1) Read Breaking Adobe DRM — Tips, Tricks, Workarounds and pay special attention to Doing a Clean Install of Mac OS X 10.5.n as you may have to do that (if nothing else I'm about to mention works).

(2) Also pay attention to Installing PyCrypto on Snow Leopard. Though you are on Leopard, your Mac is behaving in roughly the same way as a Snow Leopard Mac on which there is no /Library/Python/2.5/site-packages/ folder, due to it having been installed into a different place in the folder hierarchy. See if you can do a Finder Search on site-packages. You need to say to search "This Mac" for "File Name" and also click on the + at top-right of the window and select "System files" "include".

(3) If you find a site-packages folder anywhere, see if it contains a Crypto folder and a file called pycrypto-2.0.1-py2.5.egg-info. If so, copy all of the contents of that site-packages folder to /Library/Python/2.5/site-packages/. (You may have to create that folder manually.)

(4) If you have no appropriate site-packages folder and/or setting up /Library/Python/2.5/site-packages/ manually doesn't help, then you might want to try doing Step 3 in the main post above all over again, as it's the one in which PyCrypto is installed. If that step ends with the Terminal-window output Writing /Library/Python/2.5/site-packages/pycrypto-2.0.1-py2.5.egg-info, you should be able to run ineptepub. Notice that the characters '2.5' have to be in that message, indicating that the PyCrypto installer was using the Python 2.5 environment, specifically, on you Mac. Check to see whether the /Library/Python/2.5/site-packages/ folder now exists and contains aCrypto folder and a file called pycrypto-2.0.1-py2.5.egg-info. If it does, you're "good to go."

(5) If you're still unable to run ineptepub, then I'd recommend a clean install of Mac OS X 10.5 from your install DVD. Follow the tips in Doing a Clean Install of Mac OS X 10.5.n in Breaking Adobe DRM — Tips, Tricks, Workarounds. This is not something to be done lightly, though, as you will lose some of the system behavior you are accustomed to taking for granted, until you set things up again the way you like them.

I wish you good luck and I expect at least one of my suggestions to work for you ...

Eric

SonomaLass said...

Thanks so much Eric! Your help over on the MobileRead forum was just what I needed, and I appreciate you taking the time to post such clear guidelines and links.

For those wrestling with Snow Leopard on the Mac, this link might be useful:
http://dearauthor.com/wordpress/2010/02/21/how-to-install-python-and-pycrypto/

I run Leopard, so there were some things that were different. Your site made the difference.

I thank you, and my iPad thanks you!

Unknown said...

Hi Eric, thank you so much for this information....truly thank you!

Can you point me to a downloadable, and packaged version of ineptpdf similar to the ineptepub that is downloadable form this discussion? I have a DRM PDF that I want to de-encrypt.

You mentioned that this was beyond the scope of this particular discussion - can you point me to a thread that deals with ineptepub?

Thanks a ton!

Jetlagadam

eric said...

InterUnited said...

Can you point me to a downloadable, and packaged version of ineptpdf similar to the ineptepub that is downloadable form this discussion? I have a DRM PDF that I want to de-encrypt.

You can get ineptpdf version 7.4 here. Click on the download link on that page and download the text file qqWJCRX6.txt to your Desktop. Rename it ineptkey.py on a Mac, ineptkey.pyw (with a 'w' at the end) on a PC. Then treat it just as you would treat the ineptepub script file in Step 6 above.

The inept___ Python scripts are generally available at http://pastebin.com/. Enter the script name, e.g., ineptkey, in the search box and check out the various hits you get. Typically, there are multiple versions of each script. Generally, you should try to find the most recent one.

But be aware that sometimes the more recent versions depend on your having downloaded and made available on your computer various additional library modules (and/or later versions of Python).

For example, there are several ineptpdf versions after version 7.4. They begin with version 8 and go up through (currently) at least 8.4.30. These seem to need Python 2.7 (not 2.6 on Windows, 2.5 on a Mac) and also the "PyWin Extension Win32API module." I am pretty sure they would not work on a Mac at all, and on a Windows platform they would require a lot more setup effort than my procedure in the main post above requires.

You mentioned that this was beyond the scope of this particular discussion - can you point me to a thread that deals with ineptepub?

Did you mean to say, " ... a thread that deals with ineptpdf"?

Anyway, I've just found this blog post which is helpful concerning all three of the inept___ Python scripts.

Anonymous said...

Hi,

I've been giving myself a headache trying to resolve my ebook problems and am really grateful for the help your guide has given me.

Would you be able to confirm something for me though? Am I right in assuming that books purchased on an unauthorised ADE can't be decrypted if that machine has since been authorised?

I bought a new laptop (Windows7) and couldn't open the copied files. Adobe Support wiped my ability to see them on my old PC when they told me to authorise it. My old laptop deleted last week's back up so I can't roll back the PC to resolve it either.

On following your guide (on my new laptop now) I get the error others have had "Error: problem decrypting session key" is this because the books were downloaded unauthorised?

Thanks,
Jo

eric said...

Jo said,

I've been giving myself a headache trying to resolve my ebook problems and am really grateful for the help your guide has given me.

Would you be able to confirm something for me though? Am I right in assuming that books purchased on an unauthorised ADE can't be decrypted if that machine has since been authorised?

I bought a new laptop (Windows7) and couldn't open the copied files. Adobe Support wiped my ability to see them on my old PC when they told me to authorise it. My old laptop deleted last week's back up so I can't roll back the PC to resolve it either.

On following your guide (on my new laptop now) I get the error others have had "Error: problem decrypting session key" is this because the books were downloaded unauthorised?


Jo,

I am definitely unsure about this, so take this with a grain of salt!

My best guess is that you are out of luck. You purchased some Adobe-DRM e-books on a computer that was activated anonymously — i.e., not "authorized" using an Adobe ID. Then you belatedly authorized that same computer, using your new Adobe ID.

Once you did that, you changed the contents of your activation.dat file, the basis for extracting the adeptkey.der file, when you use the ineptkey script. Result: now you have an adeptkey.der file that won't work with the e-books you purchased earlier. Plus: the previous activation.dat file is gone.

Only two possible workarounds come to mind:

(1) If you could get back the previous activation.dat file somehow, perhaps from a backup, then it just might be possible, using some fancy footwork, to contrive to use it in ineptkey to produce an adeptkey.der file that would work with your "legacy" e-books.

(2) Or, if you bought the e-books from a company that maintains an online archive of your purchases, you might be able to delete them from your computer (backing them up first) and then re-download them. When they are re-downloaded, they should be re-encrypted in accordance with the activation.dat file you currently have — which ineptkey can turn into an adeptkey.der file that works in ineptepub to decrypt the re-downloaded e-books.

If you lack a copy of the old activation.dat file and your legacy e-books are not sitting in an online archive for potential re-downloading, then I don't see any hope at all. Sorry 'bout that!

Best,
Eric

Anonymous said...

Thanks Eric,

I wish Adobe Support Portal were as honest. Just for a laugh really, I'm continuing to follow their instructions, just waiting for them to say "Sorry, there's no way we resolve the issue".

I'm out of luck with the vendor too - they have a list but won't allow me to redownload because 'Licence registered to another user'. Also, no backups remain.

The bad luck is that I had over 120 books on my machine, one of which I hadn't even read. I guess my last ditch option is a complaint/begging letter to the vendor customer service with old fashined parchment and ink...

I appreciate your help :-)

Jo.

eric said...

Jo said:

I wish Adobe Support Portal were as honest. Just for a laugh really, I'm continuing to follow their instructions, just waiting for them to say "Sorry, there's no way we resolve the issue".

I'm out of luck with the vendor too - they have a list but won't allow me to redownload because 'Licence registered to another user'. Also, no backups remain.

The bad luck is that I had over 120 books on my machine, one of which I hadn't even read. I guess my last ditch option is a complaint/begging letter to the vendor customer service with old fashined parchment and ink...


Jo,

I'm wondering what would be the drawback to de-authorizing your computer and then re-activating it in the anonymous mode.

You would first save all the files of e-books (if any) that you currently have in your Adobe Digital Editions library, the idea being that later on you will re-authorize your computer with your current Adobe ID and password, after which your current e-books should work fine once again. Of course, you would also decrypt those e-books into open EPUBs. so you wouldn't really care if they never worked again in ADE.

Then you would de-authorize ADE by typing ctrl-shift-D (on a PC; command-shift-D on a Mac) and confirming that you really want to do that.

Next you would invoke the Authorize Computer menu item in ADE, but you would activate ADE anonymously, as you originally did.

At that point, I am assuming — and here's where I could be dead wrong — that you culd successfully add any of your 120+ "legacy" e-books to the ADE library by invoking the Add Item to Library menu item. If all anonymous activations are created equal, which I'm not at all sure of, you could be back in business.

I imagine you would need to do this on your old PC, not your new laptop, by the way, because I think ADE activations are tied to the physical machine (and also to the identity of the user account on that machine). If you use the same machine and the same user account, though, you shoud be OK.

There is one joker in this deck that I can't be sure about: if any of your legacy e-books were downloaded prior to about February, 2010, when Adobe went to a different mode of encryption, then I'm not certain the version of ineptkey you currently use will do the trick. You might have to use a different version of ineptkey to extract adeptkey.der for those pre-February legacy e-books. If that turns out to be the case, I think I can help you find the older version you need.

Let me know what you decide ...

Best,
Eric

Anonymous said...

Hi Eric,

I think the key words there are "If all anonymous activations are created equal" which I don't think they are.

After authorising my old machine so that I could transfer the files I found that all my ebooks were "Licenced to another user account" and deauthorising didn't change that. After doing a bit of web research I found that the only resolution was a system restore to 'roll back' my machine which worked a treat.

At that point I was relieved at the close shave; I created a new restore point and copied my Digital Editions folder onto a USB drive. Unfortunately, I then authorised the PC so I could complete Adobe's instructions, confident I could roll it back. After a week with no resolution, I went to restore the old settings but the PC had deleted my backup, probably due to lack of disk space (hence my buying a new laptop in the first place).

As far as I can tell, each anonymous activation on the same laptop will create a new unique Anonymous ID. Which I think is an important point for people to be aware of so they can avoid making the same mistake. Devastatingly, it looks like I've lost nearly £400 worth of books due to this software problem.

Grateful for your help though, I just hope no one else comes across the same.

Jo :o)

eric said...

Jo said:

I think the key words there are "If all anonymous activations are created equal" which I don't think they are.

After authorising my old machine so that I could transfer the files I found that all my ebooks were "Licenced to another user account" and deauthorising didn't change that. After doing a bit of web research I found that the only resolution was a system restore to 'roll back' my machine which worked a treat.

At that point I was relieved at the close shave; I created a new restore point and copied my Digital Editions folder onto a USB drive. Unfortunately, I then authorised the PC so I could complete Adobe's instructions, confident I could roll it back. After a week with no resolution, I went to restore the old settings but the PC had deleted my backup, probably due to lack of disk space (hence my buying a new laptop in the first place).

As far as I can tell, each anonymous activation on the same laptop will create a new unique Anonymous ID. Which I think is an important point for people to be aware of so they can avoid making the same mistake. Devastatingly, it looks like I've lost nearly £400 worth of books due to this software problem.


Jo,

I feel your pain!

I will edit my main post to tell people not to activate Adobe Digital Editions anonymously and then later do it again with an Adobe ID, after which time all prior Adobe-DRM'ed e-book purchases will become unusable.

Best,
Eric

Anonymous said...

Thanks Eric,
Here's Adobe's final say on the matter:

"Your eBook license has to be reset for you to be able to gain access to eBooks on your old machine. This process is carried out by the eBook vendor. Also, only the eBook vendor can tell which eBook is licensed to which
ID. So, please get in touch with them and your issue would get resolved."

Good luck to anyone else with this issue and Eric, thanks for all your help.

Jo.

eric said...

Jo said,

Here's Adobe's final say on the matter:

"Your eBook license has to be reset for you to be able to gain access to eBooks on your old machine. This process is carried out by the eBook vendor. Also, only the eBook vendor can tell which eBook is licensed to which
ID. So, please get in touch with them and your issue would get resolved."


Jo,

This is good, old-fashioned buck-passing, I'd say ...

Some questions:

Did you purchase any or all of your books using an Adobe ID? (I assume you did.)

Was it the same Adobe ID in all cases? Or, different ones at different times?

Roughly how many different vendors did you buy your books from?

Have you approached any of them for help in furnishing new copies of the books you bought?

Have any or all of them turned you down flat? (I would say that if they did, they would bear as much blame as does Adobe. I find it hard to accept that none of them offers you the benefit of any sort of archival backup, assuming you can demonstrate that you are in fact the original purchaser of the books.)

If you are just too disgusted at this point to rattle any vendors' cages, though, I fully understand ...

Best,
Eric

Anonymous said...

Have tried for a week to get this done and it worked in 5 minutes! Thanks

Anonymous said...

INEPT EPUB Decrypter has worked fine for me for a while but today I encountered a problem with one file where the Decrypter returns the following message: Error: File name in directory"OEB

Any idea what that means?

eric said...

Anonymous said...

Have tried for a week to get this done and it worked in 5 minutes! Thanks

Anon,

You are very welcome ... Happy e-reading!

Eric

eric said...

Anonymous said...

INEPT EPUB Decrypter has worked fine for me for a while but today I encountered a problem with one file where the Decrypter returns the following message: Error: File name in directory"OEB

Any idea what that means?


Anon,

Yes ... look under "The Unzip/Rezip Trick" in Breaking Adobe DRM — Tips, Tricks, Workarounds for a solution.

Best,
Eric

Anonymous said...

Eric!
Thanks a million for your help with

"Error: File name in directory"OEB"

Your suggested solution solved my problem, I am very impressed and grateful : )

eric said...

Anonymous said...

Eric!
Thanks a million for your help with

"Error: File name in directory"OEB"

Your suggested solution solved my problem, I am very impressed and grateful : )


Anon,

I'm glad it worked! Happy e-reading!!!

Eric

Inquiring Minds said...

Eric:

I have Snow Leopard. When running the installer script, I get the following error:

running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
creating build/temp.macosx-10.6-universal-2.6
creating build/temp.macosx-10.6-universal-2.6/src
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/MD2.c -o build/temp.macosx-10.6-universal-2.6/src/MD2.o
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1
imac:pycrypto-2.3 2 cmason$

Not sure what is missing, and why I am getting this gcc-4.2 error.

Any advice

Inquiring Minds said...

Hmm, nevermind. I searched for gcc-4.2, but could not find it, only gcc-4.01. Confirmed gcc-4.2 shipped in Xcode in Snow Leopard, so reinstalled Xcode, and that seemed to do the trick

eric said...

Inquiring Minds said...

I have Snow Leopard. When running the installer script, I get the following error:

running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
creating build/temp.macosx-10.6-universal-2.6
creating build/temp.macosx-10.6-universal-2.6/src
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/MD2.c -o build/temp.macosx-10.6-universal-2.6/src/MD2.o
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1
imac:pycrypto-2.3 2 cmason$

Not sure what is missing, and why I am getting this gcc-4.2 error.

Any advice


And then:

Hmm, nevermind. I searched for gcc-4.2, but could not find it, only gcc-4.01. Confirmed gcc-4.2 shipped in Xcode in Snow Leopard, so reinstalled Xcode, and that seemed to do the trick

I.M.:

Good work!

GCC is the GNU Compiler Collection, which is basically an assortment of compilers for programs and software libraries in various languages that people use to write do-it-themselves, non-commerical software. I gather that the PyCrypto install depends on it somehow.

Xcode or "Xcode Tools" is all of the stuff that gets installed in the /Developer/ folder at the root folder level on Mac OS X, as long as the user, using the OS X Install DVD, navigates to and then double-clicks Mac OS X Install DVD:Optional Installs:Xcode Tools:Xcode Tools.mpkg on the DVD. The user will be led, by the installer program which opens, through the necessary steps to install the Xcode Developer Tools package that includes GCC in various versions.

Leopard and Snow Leopard apparently differ as to how many GCC versions there are. I have Leopard and only GCC 4.0.1 is included. You have Snow Leopard, and it looks like GCC 4.2 is also available on the install DVD. Don't ask me how, but apparently the PyCrypto "build" sequence somehow "knew" that you needed to install GCC 4.2 and not just GCC 4.0.1. SO that's what you did, and everything worked ...

Happy e-reading,
Eric

Unknown said...

Hi,

When I try to do: Open with... I can't select Build applet!

Why??

Thanks!

eric said...

Ivan asked ...

When I try to do: Open with... I can't select Build applet!

Why??


Ivan,

I'm not sure which Python script you're trying to use Build Applet with at the point where the problem arises.

Is it possible that you are trying to use a script file with a filename extension of .pyw instead of .py? That extra w on the end can get in the way. You can manually edit the filename extension in Finder by clicking once on the file to select it, then clicking again on the filename itself to allow it to be edited. Hold down the Right Arrow key to move the cursor all the way to the end, past the w in .pyw, then press Delete and then Return. Now see if the Open With > Build Applet choice is available.

If it isn't, then I suggest that you check to see whether Build Applet is actually present on your Mac. For me, running Mac OS X 10.5.8 "Leopard," it's at /Developer/Applications/Utilities/MacPython 2.5/Build Applet.app. If you don't see it at that location, use a Finder search to find it on your Mac (you may have to tell the search to include system files). Once you find it, you can go back to the script file in question and, in its Get Info window — type Command-I with the file selected — use Open with: Other ... to bring up a file selection dialog.

Then navigate to /Developer/Applications/Utilities/MacPython 2.5/Build Applet.app (or whatever alternate location your own Build Applet is in. Select it, and click the Add button. You can optionally then click the Change All ... in the Get Info window to tell your Mac to use Build Applet by default to open every file with the same filename extension.

Hope this helps ...

Eric

Anonymous said...

Eric, first let me thank you for your most valuable, helpful and detail work, truly brilliant.

I have one question, if my wife purchase & downloaded her ePub books,since I have Python and all the other files needed, to remove the DRM loaded on my MAC. Can I somehow use my MAC and help her to remove the DRM, so she too can load her books on her iPad for Traveling.

Thanks

eric said...

Anonymous said...

I have one question, if my wife purchase & downloaded her ePub books,since I have Python and all the other files needed, to remove the DRM loaded on my MAC. Can I somehow use my MAC and help her to remove the DRM, so she too can load her books on her iPad for Traveling.

You can remove the DRM from your wife's books on your Mac. In addition to the procedure given in my main post:

(1) Have your Mac authorized with her Adobe ID/password.

(2) Have copies of her DRM-encrypted books on your Mac.


Authorizing your Mac with your wife's Adobe ID/password is easy if you do not want to authorize that same Mac with your own Adobe ID/password. Just do Step 1 of my procedure, but when you, as you are working in Adobe Digital Editions Setup Assistant, are told to enter your Adobe ID and password, enter your wife's Adobe ID and password instead. Then click the "Activate" button.

You can use the same Adobe ID (your wife's) to authorize up to six computers, so the fact that you have authorized her Adobe ID on your Mac should not inconvenience her.

If you want to have your Mac authorized to use your own Adobe ID/password in addition to your wife's, just set up an extra user account on your Mac that you can authorize with her Adobe ID/password. To do that, open Accounts Preferences on your Mac, click on the lock icon at the bottom left of the panel so that you can make changes, enter your own password as Adminiistrator when prompted to do so, and click on the + symbol at bottom left of the panel to add an account. Create a Standard account and name after your wife, and give it a password. I'll assume your wife is named Maria.

Once you create the "Maria" account, you should see it in the Accounts drop-down menu at upper right of your Mac's screen. Select it from that menu and when prompted, enter the password you gave it. You will be switched to the "Maria" account.

Now, perform the procedure given in the main blog post to remove DRM from her books. When you get to Step 5, do the procedure described in the following comment instead.

eric said...

This is a continuation of the previous comment, in answer to a question about how a husband can use his Mac to remove Adobe DRM from his wife's e-books: In that comment, I talked about how the anonymous questioner could authorize his Mac with his wife's Adobe ID/password. Now it's time to actually remove the DRM from her e-books.

Getting copies of her e-books onto your Mac is not too hard, Anonymous, using a home wireless network.

I assume your wife has a Windows PC, not anoher Mac.

If you created an extra "Maria" user account in the comment I posted above, you should first switch to it on your Mac.

Your wife should ideally, on her Windows PC, be logged into the user account that she normally uses when she downloads an e-book in Adobe Digital Editions.

To share files from her Windows computer to your Mac, you will basically use the procedure described in File Sharing With OS X: Share Windows XP Files With OS X 10.5.

I will assume that you and she both are using a default "workgroup" and do not need to follow the instructions on pages 2 and 3 of 7 of that procedure.

On page 4 of that procedure, you will need to set up her Windows XP computer to share her My Documents\My Digital Editions folder, the full path to which is C:\Documents and Settings\\My Documents\My Digital Editions.

I recommend that you skip page 5 of the procedure, coming back to it only if the steps on page 6 don't work for you. The steps on page 6 tell you how to easilyuse, on your Mac, a Finder window's sidebar to access the shared files on your wife's Windows PC.

Once you can see, in your Finder window, a file residing on your wife's PC that represents an Adobe Digital Editions book from which you want to remove DRM, while you are working in the "Maria" account on your Mac, copy that file (using standard Finder copying methods) to the Desktop. This will ensure that you are not working with the original file on your wife's PC.

You are now done using the File Sharing With OS X: Share Windows XP Files With OS X 10.5 procedure.

Next, while working in the "Maria" user account on your Mac, proceed with Step 6 of the procedure I gave in my original blog post above. You will use as the Input file for the ineptepub_v2.py script — i.e., the INEPT EPUB Decrypter — the copy of the original Adobe Digital Editions book that you put on the Desktop.

Once you do Step 6 on your Mac, you will have a DRM-free output file in the EPUB format that your wife can put on her iPad.

To allow that to happen, first use the procedure in File Sharing With OS X 10.5 - Share Mac Files with Windows XP to move the decrypted EPUB to her Windows computer.

Next, she can use the Windows version of Stanza for the Desktop to open the EPUB, as mentioned in Step 7 of my original procedure.

She can then use How do I transfer books from my computer to my iPhone or iPod Touch? to transfer the EPUB from Stanza on her PC into iTunes, and then she can sync her iPad to iTunes.

I realize this is quite an elaborate procedure ... so in closing let me ask you, Is there any reason not to use my original procedure in the blog post above on her Windows PC directly, rather than fooling around with moving her e-books back and forth between her Windows computer and your Mac?

Anonymous said...

Eric,

This is brilliant; and thanks. Now she can read on those TransAtlantic trips, when she cannot sleep, without worring about her Laptop battery,has no juice before she lands.

Her traveling PC is Company provided, and the guys in IT helped her put the books on,so she can read during the trips. They do not want the Python scripts on the PC. Nothing goes on that PC unless you have Administrator rights.

Thanks Eric

eric said...

Anonymous said...

This is brilliant; and thanks. Now she can read on those TransAtlantic trips, when she cannot sleep, without worring about her Laptop battery,has no juice before she lands.

Her traveling PC is Company provided, and the guys in IT helped her put the books on,so she can read during the trips. They do not want the Python scripts on the PC. Nothing goes on that PC unless you have Administrator rights.

Thanks Eric


Anon,

I wish your wife happy e-reading on those long flights!

Cheers,
Eric

Mac said...

When I try to run the Pycrypto installer and point to the pycrypto folder, I receive the following error:


running install
running build
running build_py
running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -O3 -fomit-frame-pointer -Isrc/ -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/MD2.c -o build/temp.macosx-10.3-fat-2.5/src/MD2.o
cc1: error: unrecognized command line option "-Wno-long-double"
cc1: error: unrecognized command line option "-Wno-long-double"
lipo: can't figure out the architecture type of: /var/folders/Ut/Utn9QclIGnC7voaLZiuEtk+++TI/-Tmp-//cc0MH1PD.out
error: command 'gcc' failed with exit status 1

Any thoughts would be helpful.

eric said...

Mac said...

When I try to run the Pycrypto installer and point to the pycrypto folder, I receive the following error:


running install
running build
running build_py
running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -O3 -fomit-frame-pointer -Isrc/ -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/MD2.c -o build/temp.macosx-10.3-fat-2.5/src/MD2.o
cc1: error: unrecognized command line option "-Wno-long-double"
cc1: error: unrecognized command line option "-Wno-long-double"
lipo: can't figure out the architecture type of: /var/folders/Ut/Utn9QclIGnC7voaLZiuEtk+++TI/-Tmp-//cc0MH1PD.out
error: command 'gcc' failed with exit status 1

Any thoughts would be helpful.


Mac,

I am not sure about this, but if you are running Snow Leopard (Mac OS X 10.6) you may need to manually install (or re-install) GCC, which is the GNU Compiler Collection and is basically an assortment of compilers for programs and software libraries in various languages that people use to write do-it-themselves, non-commerical software. The PyCrypto install depends on it somehow.

Using the Mac OS X 10.6 Install DVD, navigate to and then double-click Mac OS X Install DVD:Optional Installs:Xcode Tools:Xcode Tools.mpkg on the DVD. You will be led, by the installer program which opens, through the necessary steps to install the Xcode Developer Tools package that includes GCC in its various versions.

Leopard and Snow Leopard apparently differ as to how many GCC versions there are. I have Leopard and only GCC 4.0.1 is included. I'm guessing you have Snow Leopard, and it looks like GCC 4.2 is available on the install DVD, in addition to GCC 4.0.1. Don't ask me how, but apparently the PyCrypto "build" sequence somehow "knew" that you need to install GCC 4.2 and not just GCC 4.0.1. So this time when you install the Xcode Developer Tools package, make doubly sure that GCC 4.2 is included. Then try using the PyCrypto install procedure again.

Best of luck,
Eric

Mac said...

Thanks for the tip Eric. I am running SL. Unfortunately, I think I already have gcc 4.2 on my computer. When I look in the following location:

Developer>usr>bin

I find gcc-4.0 followed by gcc-4.2. Doesn't that imply I have GCC 4.2 installed?

eric said...

Mac said...

Thanks for the tip Eric. I am running SL. Unfortunately, I think I already have gcc 4.2 on my computer. When I look in the following location:

Developer>usr>bin

I find gcc-4.0 followed by gcc-4.2. Doesn't that imply I have GCC 4.2 installed?


Mac,

Try manually deleting the whole /Developer folder from your system and redoing the Xcode Tools.mpkg Custom Install.

I am not sure what's going on here. I'm inclined to wonder whether having both GCC 4.0 and GCC 4.2 installed might be confusing the PyCrypto installer. This time, if you can, try just installing the 4.2 version.

No help? Then there's a possible alternative. I haven't tried it yet and cannot vouch for it, but there's a new "DeDRM AppleScript for Mac OS X 10.5, 10.6." You can access it via a post at Apprentice Alf's Blog here. It appears to be an all-purpose AppleScript that will remove DRM from Mobipocket, Kindle for Mac, eReader, Barnes & Noble ePub and ... ta-DA! ... Adobe ePub e-books. This DeDRM 1.0 package can be accessed directly here. If you try it, I'd like to hear back from you as to whether it solved your problem!

Eric

Anonymous said...

Finally it is possible to read library books on your iOS device. This is one of the features I have been looking for for a long time. Please see the CNET link below.

http://reviews.cnet.com/8301-19512_7-20023016-233.html

I have tested it and it is actually easy to get library books onto the iphone. You can just email the .acsm file to your iphone and then say open in .. Bluefire Reader and it will download the file.

The formatting is not ideal on the iphone. It leaves too much space around the edges and I wish the page turn would be slow as a move so that I can finish the last words on a page while already seeing the next word on the upcoming page. But those are little issues that can be resolved in the future. It definitely makes the ipad and iphone the most versatile reader now.

Additionally together with txtr this is the second app that empowers international readers to purchase epub books and read them on their iOS device. txtr does not read library books though.

eric said...

Anonymous said...

Finally it is possible to read library books on your iOS device. This is one of the features I have been looking for for a long time. Please see the CNET link below.

http://reviews.cnet.com/8301-19512_7-20023016-233.html

I have tested it and it is actually easy to get library books onto the iphone. You can just email the .acsm file to your iphone and then say open in .. Bluefire Reader and it will download the file.

The formatting is not ideal on the iphone. It leaves too much space around the edges ...


Thanks, Anonymous ...

... for the tip about the Bluefire Reader app for the iPad, iPhone, ans iPod Touch as iOS 4 devices. I have tried Bluefire as a result and found it to be a way to get e-books borrowed online from my library onto my iPhone.

The CNET link is here. It links to this help page, which users definitely need to read, about "Using Library Books in Bluefire Reader."

That page tells how to borrow e-books from the Seattle Public Library. I use the somewhat different procedure of the Maryland Digital eLibrary Consortium. Its page for obtaining Adobe EPUBs contains an Advanced Search link which can be used to locate specific e-books. After you find one you want, you place it in your basket and then check out. The result is that a file with an .acsm filename extension is downloaded to my desktop, which a double-click on causes the book to appear in Adobe Digital Editions (which gets automatically launched).

The .acsm file is not — repeat, not — the book itself! The book itself gets put by ADE in

~/Documents/Digital Editions/The_Lacuna_0001.epub

(since I borrowed The Lacuna by Barbara Kingsolver).

When I installed and initialized Bluefire on my iPhone, I told it the e-mail address/password combo I had used to activate ADE (the e-mail address is the same as the "Adobe ID") ... except that I specified a different e-mail address than the one actually used for ADE. So when I followed the procedure I am about to detail to move the e-book to my iPhone, it would not open in Bluefire on the iPhone! To remedy that, I had to look in ADE on my Mac to find the correct Adobe ID. Once I deauthorized the wrong one in Bluefire and authorized the right one, I followed this procedure (for a second time) to get the book on the iPhone:

(1) Open iTunes on my Mac.

(2) Connect the iPhone to my Mac via USB cable. Wait for the usual syncing operation to get finished.

(3) Find my iPhone's name on the left side of the main iTunes window, under Devices. Click on the iPhone's name to select it.

(4) Click on the Apps tab in the list of tabs at the top of the iTunes window.

(5) Scroll down to the Apps panel under File Sharing in the iTunes window. Select the Bluefire app in that panel.

(5) Under the Documents panel to the right of the Apps panel, click on Add... to bring up a file selection dialog. In that dialog, navigate to and select the file ~/Documents/Digital Editions/The_Lacuna_0001.epub in my Home directory.

At that point — I didn't need to re-sync my iPhone — the new book was moved to the Bluefire app on the iPhone. I could open it and read it (again, once I had authorized Bluefire with the correct Adobe ID).

As you say, Anonymous, the result is a book that appears in Bluefire with much wider margins than is really acceptable. None of the various settings in Bluefire would fix that. Bluefire comes with Treasure Island pre-installed, and that book's margins are fine. The margins of The Lacuna are fine in ADE on my Mac. Why they are too wide on the iPhone is a mystery!

Anyway ... the book is still readable ... so, thanks for a useful tip, Anonymous!

Eric

tuneZfull said...

In Bluefire the margins can be changed in the settings

eric said...

tuneZfull said...

In Bluefire the margins can be changed in the settings

Yes, tuneZfull, there are five choices in Bluefire's Settings for margin size. For Treasure Island and Bluefire Reader User Guide (which are the two books that come with Bluefire) the margin settings have their full effect.

But with The Lacuna (the Adobe EPUB that I borrowed from my library) the five choices have only a small effect. WIth the margin setting chosen that supposedly gives the smallest margins, the margins I see are still extremely wide. With the margin setting that supposedly gives the widest margins, the margins I see are wider still!

No matter what margin setting I use, the amount of actual text I see per page is small. I conclude therefore that at least some Adobe EPUBs confuse the Bluefire app and cause it to give extremely wide margins on the sides of the page and at the top and bottom.

There is also an on/off switch in Settings for "Use Publisher's Formatting." Neither position of this switch cures the problem of too-wide margins.

tuneZfull said...

Hmm... I used an ePub titled My Soul to Take A Novel of Iceland by Yrsa Sigurdardottir. It wasn't from a library and wasn't drm.

eric said...

tuneZfull said...

Hmm... I used an ePub titled My Soul to Take A Novel of Iceland by Yrsa Sigurdardottir. It wasn't from a library and wasn't drm.

tuneZfull,

I just ran an experiment. I stripped DRM from my library copy of The Lacuna, doing so using Apprentice Alf's new DeDRM script. That gave me a plain EPUB file.

I then put that plain EPUB file in my iTunes e-book library and synced my iPhone to it. In the iBooks app on the iPhone, the book showed up with normal margins.

I next added that same plain EPUB file to the list of files that the Bluefire app on the iPhone can read, by means of the procedure I gave four comments previously to this comment. The Bluefire app reproduces the plain EPUB with oversized margins, the same as it reproduces the book in its original form, encrypted with Adobe DRM.

That means the oversized margins are not directly caused by DRM encryption.

I suspect the oversized margins must come from improper interpretation by Bluefire of the formatting information in the book itself. Since the iBooks app doesn't have the same problem, I expect the creators of Bluefire may want to look into the matter.

Thanks, tuneZfull, for your comments. Enjoy reading your book in Bluefire ....

Eric

Anonymous said...

hello
excellent instructions. thankyou
I am stuck at installing pycrypto_2.0.1_installer.app

I am on Mac 10.6x
I have downloaded it successfully
double clicked
terminal window is open (minimised)
and I get error message
can't make <<class psxf" libray/python/2.5/site-packages/setup.py" of applicat "finder" into string

2: Also the point for Mac to check developer directory. I am not sure i did 100%

I went to Macintosh HD
Library/Developer/Shared

3: Also early point you asked us to check if authorised ADE for pc. I had done that. But I went and check anyway. And I don't have a folder under Librabry/Adobe/Digital Editions

but the application ADE works.

thankyou for your help

eric said...

Anonymous said...

I am stuck at installing pycrypto_2.0.1_installer.app

I am on Mac 10.6x
I have downloaded it successfully
double clicked
terminal window is open (minimised)
and I get error message
can't make class psxf" libray/python/2.5/site-packages/setup.py" of applicat "finder" into string

2: Also the point for Mac to check developer directory. I am not sure i did 100%

I went to Macintosh HD
Library/Developer/Shared

3: Also early point you asked us to check if authorised ADE for pc. I had done that. But I went and check anyway. And I don't have a folder under Librabry/Adobe/Digital Editions

but the application ADE works.


Anonymous,

Thanks for posting your problem. It sounds like a tough one to figure out, so before we try to do so, I am going to ask you to do this:

Go to my recent post "Apprentice Alf's DeDRM AppleScript for Mac OS X 10.5, 10.6" and read it without actually downloading DeDRM 1.1 from the link I give there. Instead, follow this link to go to "DeDRM AppleScript for Mac OS X 10.5, 10.6" at Apprentice Alf's Blog.

Read the introductory information in the original post there, and then scroll down to where it says "Get DeDRM 1.2 from http://www.mediafire.com/?ew1v2ugc34vbb1z." Click on the link to be taken to a MediaFire page from which you can click on a "Click here to start download.." button that will initiate a download of the DeDRM 1.2 AppleScript.

If your browser does not automatically expand the ZIP file that you receive from the download, you should use Archive Utility to expand it into a DeDRM 1.2 AppleScript droplet application.

Then follow the instructions I give in "Apprentice Alf's DeDRM AppleScript for Mac OS X 10.5, 10.6". Other than the fact that they refer to DeDRM version 1.1 and you will be using DeDRM 1.2, they will guide you to a successful result!

In fact, you will very likely be able to skip the Optional Setup section in my post and go right to the Using DeDRM section to decrypt your Adobe Digital Editions EPUB e-book.

If you still have a problem after trying this, please post another comment, and I will try to help you further.

Good luck!

Eric

Anonymous said...

Its Anoymous from post above - I read all the posts.

I can confirm
1) I downloaded by ebook using ADE 1.7.2
... so I now have downloaded ADE 1.7.1
.... both are in my applications folder

2) Your STEP 2: I could not find Python 2.5 application even though in step 3 I had folder. So I downloaded 2.5. It was called MacPython
... you say
For the Mac platform, you do not need to download and install Python at all, as Python 2.5 (which works fine for purposes of these instructions) is automatically installed as part of Mac OS X 10.5 "Leopard." (I believe this is also true of OS X 10.6 "Snow Leopard.") Even though Python 2.5 is part of the Mac OS X software package, you do need to make sure the optionally installed Apple Developer package is installed on your Mac.

cont...

Anonymous said...

cont...

3) Your STEP 2:
this is the step that confuses me. Also I dodn't remember getting a DVD install with my macbook. I got it in june this year and the guy at shop did most for me. I do have the folder Developer. But in your later posts you talk about SDK... I have nothing like that... name under Developer.

... you say
If you already, at the outermost root level of your Mac's folder hierarchy, have a folder called Developer, you're fine. If not, you must create it by inserting your OS X 10.5 Install DVD and navigating to and then double-clicking Mac OS X Install DVD:Optional Installs:Xcode Tools:Xcode Tools.mpkg. You will be led by the installer program which opens through the necessary steps to install the Developer Tools package. These tools are necessary in the next stage of this procedure, that of installing and setting up the PyCrypto extensions to Python.


4) Your STEP 3: I had a look in /Library/Python/2.5, you should find a site-packages folder. In it there should now be a Crypto folder and a pycrypto-2.0.1-py2.5.egg-info file. (before I ran installer) and it already had these folder and file.

I had downloaded pkg for pycrypto. So I thought this was wrong one, so why I checked the folder and saw crypto folder and egg file there.

But when I click on installer,
you have clicked "Choose,"
--- I choose under library/Python/2.5/site-packages

PyCrypto_2.0.1_Installer will open a window in the Mac's Terminal application and execute some Unix commands in it.
---- I now get the error message I wrote in above post
---- BUT before I started messing, the terminal window opens (down reduced on bar) but no unix commands.

there still is the crypto folder and the egg file in the 2.5 directory

Anonymous said...

cont...

5)Your Step 4:
I have run the pyw file and successfully got the adeptkey.der

6) Your step 5:
I am running a little different script to your post
ineptpdf_v2.pyw
my ADE is pdf not epub
(Icannot remember where I got it from as I have confused myself. Is tarted at another blog and didnt realise it was for windows. then I found yours. which is much much better!!)

when I double click on this (the shell opens, I click run module from menu bar) (exactly like for running the adeptkey.der), and I get that error message again.

6: then I read later in your reply that it will not work as I had downloaded for ADE 1.7.2. Or am I getting muddled? If not muddled, how do i revert back to 1.7.2. I left orginal 1.7.2 in my applications folder.

thankyou for your help
cheers

Anonymous said...

hello again:

I did as you asked.

1: Downloaded alf's little app (very nice!!)
version 1.2

2: Did the setup, linked to the key.

3: then dragged my e-book file's icon over app icon

4: app asked me to select the pdf.pyw file. I did and same error message (but in short form language this time)

I check tommorrow back as very late where I am.
thanks so much

eric said...

Anonymous,

This is in response to the series of comments you have recently given me in which you are having trouble removing DRM encryption from a PDF-format Adobe e-book.

I do not have a quick solution for you, I am very sorry to say. Here are some relevant considerations though:

First of all, my post to which you have added your comments gives a procedure for removing DRM encryption for, specifically, EPUB-format Adobe e-books ... not PDF-format. I have very little experience with PDF e-books.

Next, it would be helpful if you would try to remove DRM from a different PDF-format Adobe e-book than the one that is giving you problems. Occasionally, the Python scripts give odd results with specific e-books that thankfully do not appear with other e-books of the same general type. If you can decrypt other PDF e-books that have Adobe DRM, then you can assume that just the one e-book is problematic. If that is the case, then you might try re-downloading the problematic e-book, if you can do so without paying for it again. Sometimes that helps. Plus, trying to re-download the e-book may alert you to the (possible) fact that the Adobe ID/password combination and/or the credit card information that you are using for that particular e-book do not match the ones you are (or were) using for other e-books ...

Next, it is hard for me to tell exactly what is going on for you. You have tried several things, throwing the "kitchen sink" at the problem ... which is exactly what I might have done in your situation! However, at this point I can't tell what that situation really is, in terms of what you have installed on your Mac and how you went about installing it.

So ... first I think you need to carefully read and follow all relevant instructions in my post "Breaking Adobe DRM — Tips, Tricks, Workarounds."

In particular, I think you need to start by (I hate to have to say it) doing a "clean install" of Mac OS X. You can read my section on "Doing a Clean Install of Mac OS X 10.5.n" for some tips, but since you are using 1.6.n "Snow Leopard" (and I am not), the actual instructions may be a little (or a lot) different for you.

You definitely need to go ahead and install the Xcode Developer Tools, as well as Mac OS X per se.

You have said that you are not aware of having a Mac OS X 10.6 Install DVD. That is odd! As far as I know, all Macs sold (not used, but new) by Apple come with Install DVDs. You are, I think, not from the U.S., but still ... you should have an Install DVD. I encourage you to, at the dealer that you bought your Mac from, ask why no Install DVD?

You may have to buy one here ...

Under no circumstances do I encourage you to try to obtain a third-party Python installer for your Mac, other then the Python versions that come on the Install DVD! There are many versions of Python out there, and it is hard to be sure you are getting one that works with the Python scripts you are using.

Once you have done a clean install of Mac OS X to get rid of the things you have tried to use without success and have installed the Xcode Developer Tools, you need to do Step 3 above to install PyCrypto.

Then, follow the instructions I gave in "Breaking Adobe DRM — Tips, Tricks, Workarounds" for "Installing PyCrypto on Snow Leopard." That will make sure that PyCrypto has been installed in the correct folder.

You should next make sure you can still locate your copy of the ineptpdf7.6.pyw script.

Now, try using Apprentice Alf's DeDRM script again, and see whether it works for you ...

Good luck!

Eric

Anonymous said...

hello
deDRM successfully
print button in ADE is activated

when I print
-- Adobe DRM epub ... it is actually creating images versus TRUE PDF printing
-- Adobe DRM PDF ... all OK. printing normal PDF

so if I print epub to PDF, then I loose OCR.

anyway around this?

many thanks

eric said...

Anonymous said...

hello
deDRM successfully
print button in ADE is activated

when I print
-- Adobe DRM epub ... it is actually creating images versus TRUE PDF printing
-- Adobe DRM PDF ... all OK. printing normal PDF

so if I print epub to PDF, then I loose OCR.

anyway around this?

many thanks


Hello, Anonymous,

I must admit I'm not sure what you are asking about. I am assuming you are the same "Anonymous" who posted the last few comments under that name.

In your previous comments you indicated that you were having no success with the instructions I gave in the original post above. I gave a link to the DeDRM AppleScript, which you seem to have obtained and used successfully.

(An aside:) DeDRM AppleScript version 2.0 is now available as part of tools v3.2, which can be downloaded here. Apprentice Alf, who wrote DeDRM, has gone into retirement, and his original blog post about it has been modified and no longer links to the DeDRM 2.0 download per se. You can instead download the entire tools v3.2 ZIP file from the link given above and expand it to get a tools folder. In that tools folder are several subfolders, one of which is DeDRM_for_Mac_and_Win. In DeDRM_for_Mac_and_Win there is the ZIP file called DeDRM_2.0.app.zip that can be expanded to obtain the DeDRM 2.0 AppleScript application "droplet." If it's not on your desktop at this point, I suggest that you move or copy it there. You can then drag the icons of e-book files that you want decrypted and drop the icons on the DeDRM 2.0 droplet to have the e-books decrypted. (End of aside.)

Now for your question: What I don't understand is that you seem to be trying to remove DRM from an e-book in the Adobe EPUB format, correct? But then you still want to read it using the Adobe Digital Editions (ADE) application. I don't see why you would want to do that, since ADE ought to be able to read the e-book even if you don't remove DRM from it!

Your question seems to be about printing from ADE and having two options, one of which is "true PDF" and one of which isn't. The former, you say, causes you to "lose OCR." (OCR = optical character recognition).

I have no idea why you are concerned about OCR. My assumption: your original e-book is in the Adobe EPUB format, and you want to strip DRM from it to get it into the "open" EPUB format. Both of these EPUB formats are (once they have been expanded from the ZIP files they are packaged as) just strings of characters. Optical character recognition is totally unnecessary!

Nor are those formats in any way related to PDF formats!

You are trying to print pages of your DeDRM'ed e-book from the ADE application, I gather. I'm not sure why you'd really want to do that, but it is true that on the Mac the Print dialog gives you an option to print as a PDF file. In my (hasty) testing I couldn't get this to produce an output file from ADE that Adobe Reader could actually open.

OK, Anonymous, so if you want more help than I have been able to give here in this reply, please post another comment in which you give a vast amount of detail as to what you are trying to do, and why!

Cheers,
Eric

Stefan tc said...

Many thx for your clear and easy to follow guideline. After following your steps I successfully decrypted the eBook I bought today.

eric said...

Stefan tc said...

Many thx for your clear and easy to follow guideline. After following your steps I successfully decrypted the eBook I bought today.

Stefan,

Glad to help. Cheers!

Eric

Anonymous said...

If I may suggest a way easier method? I didnt even try to do this as it looked verry complicated.
http://www.ebook-converter.com/122-remove-drm-acsm.htm
(First do this)
than, open calibre, find the unlocked ebook and convert from epub to epub. Than you can just transfer it to itunes and it shows up in iBooks!!
Hope that helps someone :)

eric said...

Anonymous said...

If I may suggest a way easier method? I didnt even try to do this as it looked verry complicated.

http://www.ebook-converter.com/122-remove-drm-acsm.htm

(First do this)
than, open calibre, find the unlocked ebook and convert from epub to epub. Than you can just transfer it to itunes and it shows up in iBooks!!

Hope that helps someone :)


Anonymous,

Thanks, that's a big help.

The link you provided

How to remove DRM from .acsm file

leads to a page that in turn leads to

http://www.ebook-converter.com/download/pdfdrmsetup.exe

which is that actual way to download a free conversion utility that works on Windows (not on a Mac) to convert the Adobe e-book you borrow from a library to .epub format. The .acsm file that you get first from the library is normally used by Adobe Digital Editions to download an Adobe .epub file that ADE alone can read. That converted .epub file won't work if you move it to iBooks. But if you use this conversion utility on the .epub file that ADE downloads, you can then input the conversion utility's output .epub file to Calibre and get an .epub file that iBooks can use.

On the same web site, there are other conversion utilities for DRM-encrypted e-books as well. Some are for Windows and others are for Macs. I tried

PDF ePub DRM Removal (Mac)

and found it seems to work successfully to remove DRM from Adobe .epub files. But this one turns out to be a trial version that is crippled and will not show all pages of the converted e-book. To be able to see all the pages after the conversion is done, you need to shell out $34.95 for the full version of the utility.

Unknown said...

Thanks a lot for sharing important information. You can download Adobe Reader XI Professional for free by clicking on Adobe Reader XI Professional v11.0.3 Multilanguage Retail iSO-DVD Free Download