Wednesday, February 18, 2009

By way of a concrete reverse-engineering contribution, I have successfully circumvented Adobe's ADEPT DRM scheme for EPUB files. The same circumvention probably also allows decryption of ADEPT-encrypted PDF files, although I haven't looked into it yet.

ADEPT is pretty close to faultless as a crypto system -- a per-user RSA key encrypts a per-book AES key which encrypts the content. It uses AES in CBC mode with a random IV. It uses RSA with PKCS#1 v1.5 padding, which is perfectly adequate for this case. Unfortunately for Adobe, this isn't a crypto system, but a DRM system. DRM systems ultimately depend not on the strength of their cryptography, but the complexity of their obfuscation. There is very little obfuscation in how Adobe Digital Editions hides and encrypts the per-user RSA key, allowing fairly simple duplication of exactly the same process Digital Editions uses to retrieve it.

In practical terms, this breaks ADEPT circumvention into two components: key retrieval and decryption. Key retrieval depends only on the details of Digital Editions and can change seamlessly with an update to the same. Decryption however is a property of the architecture of the system as a whole. Preventing circumventing decryption with previously retrieved keys would require changes to both DE and Adobe Content Server and would take quite some time to propagate to all ACS customers. The upshot being that if you want to decrypt ADEPT books in the future, grab your key now -- no garauntees that you'll be able to do so in the future, but a previously-retrieved key should keep on working.

Here are the scripts:

Key-retrieval script: ineptkey (version 5)

Decryption script: ineptepub (version 5.2)

To use, install Python 2.6 (and on Windows PyCrypto), run the key-retrieval script, then run the decryption script using the retrieved key.

And on a preachy note, please don't be a jerk with these. DRM is bad, but piracy is wrong kids, and only validates the opinions of those who think they need DRM in the first place.

Edit:
script links will change reflect dropped pastebins and new versions.

1. This is very cool. What needs to be done to get it to work with encrypted PDF files as well? That would be awesome.

2. More interesting discussion on this at:

3. Thank you! Excellent work.
Especiallyfor releasing Python code and not some worrysome .exe (which I would never run).

4. I have a fairly long email address and I am sick to death of typing it in to view encrypted e-books that I have legitimately purchased.
Here's hoping this will free me from that burden. Going to give your scripts a try.

5. I understand that this does/may also work for ADEPT-encrypted PDF files. But Adobe also encrypt pdf files using Adobe Policy Server - Is that the same system and does this therfore also work for them?

6. Any suggestions on how to use these scripts under Mac OS X? :)

7. I have used your scripts with great success. I recently ran into two library books that it didn't decrypt. I was able to decrypt books by the same publisher. Any idea what this could be?

8. This comment has been removed by the author.

9. This comment has been removed by the author.

10. Dude, you're my hero!!!!!

11. I wanted to use this for an epub-Book that I had bought and couldn't convert to .prc for my Kindle 2. I followed the instructions but get an error running the .pyw file. Where did I make a mistake?

Traceback (most recent call last):
File "C:\Users\HGS\Desktop\DRM key\ineptkey.pyw", line 198, in main
retrieve_key(keypath)
File "C:\Users\HGS\Desktop\DRM key\ineptkey.pyw", line 140, in retrieve_key
vendor = cpuid0()
File "C:\Users\HGS\Desktop\DRM key\ineptkey.pyw", line 103, in cpuid0
cpuid0__(buffer)
WindowsError: exception: access violation writing 0x01B37F08

12. I encountered the same problem as Hans did when running the ineptkey script:

Traceback (most recent call last):
File "C:\Python26\ineptkey.pyw", line 198, in main
retrieve_key(keypath)
File "C:\Python26\ineptkey.pyw", line 140, in retrieve_key
vendor = cpuid0()
File "C:\Python26\ineptkey.pyw", line 103, in cpuid0
cpuid0__(buffer)
WindowsError: exception: access violation writing 0x0197B400

13. Anybody reading / editing this blog?

14. I had similar errors and via debugging realized that this python script is generating a short chunk of 32-bit x86 assembly code and executing it to call the cpuid opcode of the processor. I was running python AMD64 version, so I switched to the 32-bit python and it worked.

Don

15. I must confess that goes over my head.
I have a Pentium DualCore D805. But that is all I know, I just followed the instructions.

16. 1. Uninstall whatever version of python you have instealled.

3. Install it.

4. Now try running the script.

5. Report back the results.

17. Same thing. I assume the book with the DRM should be in the same directory as the ineptkey.pyw. Or doesn't it matter?

Traceback (most recent call last):
File "C:\Users\HGS\Desktop\Kindle\DRM key\ineptkey.pyw", line 198, in main
retrieve_key(keypath)
File "C:\Users\HGS\Desktop\Kindle\DRM key\ineptkey.pyw", line 140, in retrieve_key
vendor = cpuid0()
File "C:\Users\HGS\Desktop\Kindle\DRM key\ineptkey.pyw", line 103, in cpuid0
cpuid0__(buffer)
WindowsError: exception: access violation writing 0x01BF7F08

18. I have an adobe digital editions encrypted PDF file that this is not working on. It says "Error: it is not a zip file" and then crashes out.

HELP!!!

19. Hi! Wanted to give this a try so I could then convert my epub book to pdf but the scripts seem to be down...

20. They are up for me. Have to copy the second script, not the one with the numbers on the lines.

I have some PDF ebooks that I cant read now because of I have formatted my laptop, and when I try to activate, it says that I could never do that, ever!

22. Any help with OS X users?

23. Thanks, you just made my life easier. The drm-free book works perfectly on my ereader now.

24. clear instructions, installed, but when experimenting with a freebie from the Adobe Digital Editions (v1.7.1) Library - it returns... "not an ADEPT EPUB"
-
does this mean that the arms race continues?

25. Thank you for this, I appreciate it greatly!

26. I would also like to get a word on possible command-line usage under Mac OS X.

Thanks you, you made my month.

28. I have exported the key and am getting an error when I attempt to decrypt the file.
"Error: File is not a zip file"... any ideas?
I am trying to decrypt an Adobe Digital Editions file so that I can move it from my old computer to my new one...

29. Hi there - any chance of altering the links to the scripts or re-posting etc as the pastebin links are now inactive?

Andy

30. I agree with Andy. Where can we now find the scripts? Hopefully they're still available. Jim A.

31. update if anyone's interested the scripts are now here after this site recieved a takedown notice:

32. Like Nexus I also got the message "not an ADEPT EPUB". The reason is in my case that the ePub archive no longer contains the file "rights.xml". But since I have no other ePub that contains a "rights.xml" file, I don't know how to proceed. Is there anyone who has a "rights.xml" file ?

33. "error unexpected eof" is the message I get when I try to run the ineptpdf decryptor on an epub document...I have the keys generated am I using the correct script for an epub file....clueless

34. Same error as Dreamweaver :
1) I get the key with ineptkey.pyw
2) Then I try to remove the DRM from the epub file with ineptpdf.pyw
3) And it fails with the error : "Error : Unexpected EOF"

The script only proposes to list PDF files, not the epub ones. Is this the normal behavior ?

35. Additional information on the error :
The ebook is 970.691 bytes long.
The message occurs on nextline() function with linepos variable value 970630
I hope it can help discovering what is going wrong ...

Some informations on the ebook :
- I bought it 2 days ago from a French retailer
- and I can read it both on my PC and on my MAC with ADE 1.7.1
- I don't want to activate my ebook device, so I can't read it on the device

36. The answer is to use the ineptepub.pyw (v2) instead of the ineptpdf.pyw (v2)

To find the script, just look for ineptepub.pyw on Google

37. Scripts work great, i decrypted some ebooks and it works great, the DRM is REMOVED!!

Thou the script fail to decrypt some ebooks, the decrypted ebook seems to be corrupted when i try to open it in my reader.

38. i've dl-ed all necessary software (plus numerous others before i came across this piece), but i'm not sure i'm even half successful. >.< this is driving me insane!

please advise, is there a new script arn or am i doing this wrong? i've to confess that although i read each word dutifully, all the tech terms and discussion passes through me like water -__-

i run Python (command line) and type in the script as available on this post.. and it comes up "SyntaxError: invalid syntax"

any help will be much appreciated.

39. Does anybody know of a solution for OS X users please?

40. Works great for most books, thanks!

Last book I tried didn't work though: I got a "root object missing" error when I tried to open it. Is there any solution for this?

41. Rumor has it that the privateLicense key on OS X is not obfuscated, but lives in a file called activation.dat in base64 format. In theory, openssl could be used to convert it to der format for use with the python scripts.

In theory, of course.

42. THIS. IS. GREAT!

1. Installed Adobe Digital Editions and registered the machine.
2. Installed Python and PyCrypto (links above)
4. Ran ineptkey.pyw.
Key was fetched and saved.
Hooray. No problems in the future with DRM anymore.
Fuzzy warm feelings inside...

6. Ran ineptepub.pyw.
epub was decrypted and saved.
Testes with Stanza and works *just great* on iPhone.

You guys are the best!!!!

43. Hey there. Sorry to be such a dork, but how do I operate all those tools? Is there a command string? How do I "run" ineptkey??

44. > How do I "run" ineptkey??
You double click on it???

45. I've made myself a little manual.

46. well, nothing happens when I do that

47. I mean, I copy all the files (the Crypto folder, the two scripts, and the PDF) into the Python folder on my C drive (we're talking windows XP now). I doubleclick ineptkey - and nothing happens - the script is apparently hyper-quickly run in the background, but no adeptkey file appears.

48. Dude thank you for this, you are an absolute life saver.

49. Scripts are no longer available at pastebin.com and rapidshare is requiring a premium membership to access them there. Can somebody point me in another...preferrably free direction to obtain them?

50. http://www.gorissen.info/Pierre/item/2009/8/26/maak-een-backup-van-je-bol-com-boeken

This is a website in the Dutch language.

Look under "Stap 6)" and hit "deze scripts"

Good luck

51. The scripts work awesome!

52. I receive an error when decrypting DRM'ed ePub file:

Error: problem decrypting session key

Where might be the problem?

53. Awesome!! Works like a breeze. Thanks a ton.

Anurag

For the convenience of those who are having difficulties on the PDF-DRM removal procedure:

Steps:

2. Unzip this file and you would get two files: f26972321.txt and f1cb3663c.txt

3. Rename f26972321.txt to ineptkey.pyw

4. Rename f1cb3663c.txt to ineptpdf.pyw

5. Double-click on ineptkey.pyw to execute it. This would create a file adeptkey.der. This is the key that removes the DRM protection.

6. Double-click on ineptpdf.pyw - this would open up a window which will ask for:

a) adeptkey.der (generated in step 5)

b) Location of the DRM-protected PDF file, from which you want to remove the DRM protection

c) Location of the DRM-free PDF file that you want to generate.

7. Mention the above details and click on Decrypt. You have the DRM-free PDF file at the specified location . It's that simple!

Happy DR-e-M-oving.... ;-)

54. Hello,
Is this working with epub format?

55. @ Muriel
There is a script for Epub and a script for Pdf files.

56. I got the scripts to work great on my previous computer (Windows XP SP3) but I recently migrated to a new box running Windows 7. I installed Python 2.6.4 and PyCrypto 2.0.1, the latest version of Adobe Digital Edition (1.7.1), registered my computer with Adobe, ran the keyGen script (ineptkey_v3.pyw) and got a adeptkey.der file. I was able to run the ineptpdf_v2.pyw script with no problem and it generated a pdf file fine. But when I open the pdf file in Adobe Acrobat Reader (latest version) I get the following error dialog: "There was an error opening this document. The root object is missing or invalid".

Any idea what I am doing wrong?

57. This is awesome. Thanks you guys.

58. Has anyone had any success getting this to work with BN ereader epub books?

In order to get the keygen to work, i had to install adobe digital editions. But after that i found i cannot read this book in the digital editions reader, and running the ineptepub.pyw returns a "Error: problem decrypting session key".

59. I could not download the scripts? pastebin said "Unknown post id, it may have expired or been deleted". Could you repost them?

60. I got the same program as thisisacompleterandomname got. Any ideas about why?

61. Just wanted to say thank you to Sacco Vanzetti in the comments for the Dutch scripts! They worked great and to WIP in the comments for the specific instructions.

62. I'm having the same problem with Barnes & Noble new epubs as "zarantha".

In order to get the keygen to work, i had to install adobe digital editions. But after that i found i cannot read this book in the digital editions reader, and running the ineptepub.pyw returns a "Error: problem decrypting session key".

63. Brilliant - worked an absolute treat.

64. Any chance for a Mac OS X solution?

65. A thousand times thank you !

Michael: I used Virtual Box and a Windows XP image on a Mac and decrypted my first epub. I felt liberated !

66. YOU ARE THE MAN!!! FANTASTIC JOB

67. This helped me a lot.
Gave my girlfriend a iRiver Story as a christmas gift and found out that it did not support ePub files with Adobe DRM...
Now she can read the books that could not be opened earlier.

Many, many thanks!
Where can put a donation?

68. I got the files, ran ineptkey.pyw and ran the adeptkey.der program. I tried to decrypt a book I borrowed from the library, which has an .acsm extension, though it is an epub book. The program says: "Error. Not a .zip file." What to do now?

69. Ignore my last post. I read maelcum's manual and found out how to locate the .epub file itself. Thanks to Iheartcabbages and maelcum--now to try this file on my Droid!

70. To those who can't read the book in Adobe Digital Editions after decrypting: you need to save it with a different name or it will overwrite your original.

71. Wahoo!!! I can read the library book on the Droid!

72. That is AMAZING!!!!!! THANS a lot!!!!!

73. I am sorry. But I got the error message "error: ciphertext too large". What can I do?

Kind regards

Kai

74. I get an error message that "file is not a zip file"

What am I missing? :(

75. I am attempting to follow your instructions above for ridding my b&n e-book of the drm but I guess I am a bit inept of downloading your software and to retrieving the key script-- what exactly do I click on to execute the series of commands to make my book compatible with calibre?
many thanks for any assistance--

76. @Robert W. Smith

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

77. OK got this to work fine for an epub. Now tried two pdfs. First pdf worked fine but the second would not work. First tried version V2 and all appeared to work but book would not open. So tried the v5 script and it gives an error that says: "Dict required 1804" Anyone have a clue what that means and how does one correct it?

78. help! i followed all the steps and got
error: problem decrypting session key

79. I really appreciate these scripts!

Would it be possible to make a Calibre plugin for these scripts? That would be so helpful!

80. http://rapid.org/board/showthread.php?p=1403763 heres are thread that shows how to de-DRM PDFs as well with a PYW script. It takes info from here but had both EPUB and PDF scripts.

81. Thank You!

I bought 2 books unaware they were DRM crippled, I now have them on my phone and readable. I resent having to do this for books I bought and paid for, but thank you for making the process easy.

82. I'm using Adobe Digital Editions 1.7.2, 32 bit Windows XP SP3, with Python 2.6 and "pycrypto-2.0.1.win32-py2.6.exe". I first ran ineptkey version 3, and it successfully extracted the "adeptkey.der" file. I then attempted to use IneptEPUB.pyw version 2 on my recently bought epub. However, when running the ineptEpub script, I got an error: "problem decrypting session key".
This was all within Sandboxie.

I then tried it outside of Sandboxie and I installed Adobe DE within windows normally, following all the same steps, and I got a different error message: "Ciphertext too large"

83. I then tried redownloading it (as well as rerunning the ineptkey script), and this time, I got the error "Problem decrypting session key"

84. There is a new update to Adobe Digital Editions that may be causing problems. They started pushing it out today, and someone on another board updated, then could not remove DRM.

85. I just tested it on another computer. I updated to 1.7.2, removed the old adeptkey. Re-ran ineptkey, then tested it and got "Error: Problem decrypting session key."

Cabbages, any ideas?

Stew

86. Is it possible perhaps to go back to a previous version? Does anyone have the offline installer for a version < 1.7.2 ?

87. I found a slightly older version (1.7) and tried installing it, but got even stranger results - it wouldn't download the ebook and let me view it even. The files should be clean, but I personally didn't bother testing them (since I ran them all sandboxed).

http://rapidshare.com/files/345640622/digitaleditions1_7_setup.exe

88. The update messed up my Windows 7 Ultimate computer, but worked fine on my Vista laptop. I am going to wait to do the last computer until others give more feedback. I know someone with Windows 7 Pro that didn't have any problems either. So it isn't affecting everyone.

89. The problem is that ADE 1.7.2 changed how the key information is stored. So all of you people who had it working and deleted your adeptkey.der file, you screwed yourselves over.

The program get generate adeptkey.der needs to be rewritten for 1.7.2. But if you have a valid adeptkey.der from 1.7.1, it will STILL work.

90. Just uninstall the new version, delete the ADEPT folder in the Registry.

Delete the My Digital Editions folder in My Documents. Reboot computer. Re-install the old version provided in the link below. Reactivate ADE.

Run the Ineptkey again to obtain the Adeptkey.der.

Then you should be good to go. I even tried the update again, and I was still able to remove DRM.

http://drop.io/a1bdxlq

91. there is a easy way to remove drm from ebook,
try Digital Editions Converter

http://www.ebook-converter.com/cat/ebook-drm-remover

epub drm removal

92. http://www.ebook-converter.com/cat/ebook-drm-remover

Wow, somebody created a Frontend program with a GUI and they want to charge for something that is already easy to do and free.

The scripts here are easy, already have a GUI, and are free.

Oh yeah, that must be spam. :)

93. I think I have a solution for the "Error: problem decrypting session key" problem - please can someone else give this a go and report back on whether it works or not ?

3) When I ran the old version for the first time, it carped about needing to update in 44 days, I assume that you'll just be able to reinstall later ?

4) Hold down Shift-Ctrl-D to de-authorize your PC. Digital Editions should close, but if it doesn't then restart.

5) Re-authorize your PC as per usual

..now try running the ineptkey and ineptepub scripts again - this worked for me !

Hope this helps someone out there - took me ages to fix this on my PC..

94. Just an update to the above post...

Digital Editions will not download any new eBooks while it knows there is a newer version of itself available.

It is probably possible to work around this by figuring out what the update server is and block it by updating the hosts file or using a firewall etc etc, but I'm travelling in Brazil at the moment and my wife is staring DAGGERS at me as I type this as it is..

..so to cut a long story short, I updated Digital Edition back to 1.7.2 but kept a copy of the key I grabbed from the 1.7.1 version and it still allows decrypting.

Hope that helps someone.

95. Allan, Stewball: Thanks for all the help, I haven't tried this yet, but you wrote it quite well. Thanks again.

96. My copy of 1.7.1 allows me to download books. When the message comes up telling me I have 44 days to update, or download now, choose the Will Expire in 44 Days button.

But like Allen said, if you do not recreate the adeptkey.der after updating, it will still work.

97. i can confirm that stewball is correct with the following:

Just uninstall the new version, delete the ADEPT folder in the Registry.

Delete the My Digital Editions folder in My Documents. Reboot computer. Re-install the old version provided in the link below. Reactivate ADE.

Run the Ineptkey again to obtain the Adeptkey.der.

Then you should be good to go. I even tried the update again, and I was still able to remove DRM.

http://drop.io/a1bdxlq

****************

98. Use

http://pastebin.com/f79e6b858

for 1.7.2

99. John, ineptkey.pyw version 4 did not work on my Windows 7 that has 1.7.2 upgraded from 1.7.1.

Same error as trying version 3 with 1.7.2.

100. Try this one

http://pastebin.com/m2b8d1067

101. Nope, still doesn't work. In fact, I get the following error messages...

Traceback (most recent call last):
File "G:\MP\Adobe\ineptkey04.pyw", line 219, in main
retrieve_key(keypath)
File "G:\MP\Adobe\ineptkey04.pyw", line 187, in retrieve_key
pkcs = pkcs.decode('base64')
AttributeError: decode

102. JSWolf,

Are you running ineptkey.pyw via command prompt, or just double-clicking it?

Your error message seems like a command window. All you should do is double click ineptkey.pyw.

If all else fails do what I posted above.

Just uninstall the new version, delete the ADEPT folder in the Registry.

Delete the My Digital Editions folder in My Documents. Reboot computer. Re-install the old version provided in the link below. Reactivate ADE.

Run the Ineptkey (version 3) again to obtain the Adeptkey.der.

Then you should be good to go. I even tried the update again, and I was still able to remove DRM.

http://drop.io/a1bdxlq

103. I have a good key file from 1.7.1. I'm just trying to make sure we have a way to get the key from 1.7.2. And as doe the original version 4 linked here, I did fix it so it works on my system to get a valid adept.der file.

104. you might try:

http://pastebin.com/fb41179d

http://pastebin.com/f54c4a7ca

you need both scripts ...

105. @John
the key create by ineptkey.pyw, version 4.2 does not work for pdf format when I applied with
ineptpdf.pyw, version 5
Where can I find newer version ineptpdf that works with ADE 1.7.2?

106. okay another update for ineptkey and ineptepub

http://pastebin.com/f4a58e1d6

http://pastebin.com/f5c0ce06b

try it out - error messages please in this forum

@hhtu2007 - the ineptpdf script isn't adjusted (for adeptkey4.der) as long as the epub version doesn't work perfectly ... ;)

107. Thanks Stew - your very helpful instructions were clear and they WORKED - I have now stored a copy of the key in a separate hard disk in case it happens again. maureen

108. Thank John,
I have tried ineptpdf.pyw, version 6 posted
http://pastebin.com/f66b47828
and tested with adeptkey4, but did not work for me. Error:"problem decrypting session key"

109. This comment has been removed by the author.

110. There was a small logical bug in the script sotry this one

http://pastebin.com/f7066f63a

(and of course use ineptkey4 (adeptkey4.der) for it).

111. Thank John so much,

112. John, This worked on a couple of pdf books but I also got a Error:Dict required on a couple of other books. Any ideas?

113. If you use the automated version (ainept) you are not allowed to have noncrypted pdfs in the same source directory.

The script has some problems with pdf 1.7 features like xtreamdirectories - a problem which isn't solved yet (it's a pdf construction and not a decryption problem).

114. Ok last update - backward compatibility to adeptkey.der regained

http://pastebin.com/f6ffa029

http://pastebin.com/f6cbfb494

btw. - Marc do you get the error in the script or in your pdf viewer?

http://pastebin.com/f178f8d2
does not work with Error:"list assignment index out of range"
Is there another version to solve it?

116. Use this one with the two links above

http://pastebin.com/f35f732a9

117. John, I get the Dict Required error in the script.

119. I Just tried with the 2 new scripts and the aineptpdf v6.3 and it worked perfect!!!! Thanks John!!!!

120. worked perfectly! thank you!!

121. ineptepub + adeptkey4 are working great for epub
but,
ineptpdf 6.1 + aineptpdf 6.3 aren't working with pdfs :-(

here ist the screen with the error:
http://img121.imageshack.us/img121/9445/02192010222211.png

122. pleeeaaase help me, what can i do? :-(

123. get the key with the new ineptkey again and use INEPT PDF Decrypter V6.1

124. ..first thanks john for your help,
but still, it doesnt't work with pdf :-(

my steps:

1) http://pastebin.com/f4a58e1d6
to generate: ineptkey.pyw, version 4.2

2) http://pastebin.com/f6cbfb494
to generate: ineptpdf.pyw, version 6.1

--

3) i generated the adeptkey4.der by klicking on the ineptkey.pyw

here is the screenshot of my folder after creating the files:
http://img715.imageshack.us/img715/2654/02202010030859.png

im still getting the error message as i posted three posts above..:-(
what can i do ?? thanks..

125. use the

ineptkey.pyw, version 4.3

with the new

ineptpdf.pyw, version 6.1

the adeptkey4.der was only a short quickfix - you can create adeptkey.der with the new ineptkey again ..

126. This comment has been removed by the author.

127. I'm seeing the same problem as marcspirit1980. It probably is a problem with the format of the pdfs? None of the ineptpdf.pyw I tried was able to decrypt theses pdf that all come from the same source for me.

Here's what I get when I run it on the command line:

Traceback (most recent call last):
File "ineptpdf.61.pyw", line 1763, in
sys.exit(cli_main())
File "ineptpdf.61.pyw", line 1644, in cli_main
serializer = PDFSerializer(inf, keypath)
File "ineptpdf.61.pyw", line 1495, in __init__
doc.initialize(keypath)
File "ineptpdf.61.pyw", line 1170, in initialize
raise PDFEncryptionError('Unknown filter: param=%r' % param)
__main__.PDFEncryptionError: Unknown filter: param={'PDRLPol': 'XNRrJ4Hr5hpYnf0K
80F/aRWWmL1dGk43+Iplyzr7gGyMNQRwn3oFb4ZGZ0qkw3xKG2c7Llpcw0c2JtMwyBn5iKg7y+BGr5yl
...
jhNNnVBaTMrR1VhRlM3d1llRkNFYWJNakEvaUVyS2FYYmJqRU8yOWVXTGFuOEpLTUs3ZEJ0UnFOeUlWV
GpZek9xTE01VDJYUjB3OENmTHFYbGZtcTlOUFFPdDQ9Cgo=', 'StrF': /DefaultCryptFilter, '
CF': {'DefaultCryptFilter': {'Length': 128, 'CFM': /AESV2}}, 'PDRLLic': 'PD94bWw
...
K', 'Filter': /Adobe#2eAPS, 'R': 65537, 'V': 4, 'StmF': /DefaultCryptFilter, 'Su

Any hope for decrypting these files?

128. now i tried: ineptkey.pyw, version 4.3
but still getting the same error :-(

anyone can send me a working pack through mail ?
(for 1.72 and PDFs - epub version is working well!) -> pdf-drm@get-global.de
would be so great..

129. Are you double clicking ineptepub.pyw, or trying to run it via command line. You should be double clicking the script to start up the GUI interface.

130. At first if you generated a adeptkey4.der file they are no longer valid with the new scripts. You need to create an actual adeptkey.der with the new ineptkey. Don't use the adeptkey4.der anymore - the new scripts won't get the key out of it!

Mac users have to use the ineptkeymac.py, version 1 from

http://pastebin.com/f1182324a

the other scripts are the same for pc and mac

131. This comment has been removed by the author.

132. @Marcus - your pdf seems to have a format which isn't supported yet. if I should dig deeper into it give me a way to contact you

133. Ok, i went a huge step forward..
My mistake was:
-I tried to convert a kind of pdf, which is protected with "Adobe Policy Server" and NOT by "Adobe Digital Editions".

-When i try to open the pdfs in ADE there comes a message:
This Version of Digital Editions is not supporting documents, which are protected with "Adobe Policy Server". So these PDFs i can just and only open in Adobe Reader. So for these pfds, the convertation doesnt work.

- But now, when i open PDFS which are protected by ADE ( and openable by ADE) it WORKS with the script perfectly !!!
THANKS

But now my question... how can i convert these kind of PDFs which aren't using ADE ?? (and instead the Adobe Policy Server)
????

134. John: You can drop me line at c6em2i8c8silc9w@jetable.net. I really appreciate your help!

135. the ineptpdf 7 solves problems some pdfs had ...

137. This comment has been removed by the author.

138. I'm having trouble installing Pycrypto. The installer tells me it can't find the registry for Python 2.6, but it is installed in the root as C:/Python26. The installer won't let me browse to the path or type it in manually. I have installed and used Pycrypto on another machine with the same installation of Python, which I installed on both using the OpenRPG installer.

The machine I have everything working on is a Mac running Windows XP in Parallels. The one I can't get Pycrypto to install on is a Mac running Windows 7 in BootCamp. It will run .pyw scripts that don't require Pycrypto successfully, and I have also been able to run scripts through a command window.

Any suggestions to fix the problem would be appreciated.

139. Is your Win7 64 bits ? if so, you need to uninstall pyhton x64 and install the 32 bits version so pycrypto will recognize it.

140. Thank you very much, Blak4dr. That was the problem. I did as you suggested, and all is working perfectly now. As you could tell from my original post, I am not a habitual Windows user :-).

141. A minor bugfix:

Ineptpdf 7.1 is released

142. @silicon: You're welcome.

143. I'd really love a Mac/OSX fix.... I can't download my books from ADE to my husband's new Nook.... if I had hard copies I'd just give them to him. DRM is such a nuisance.

144. Works with the mac - use ineptkeymac for it

145. Hi.. problem here..

Running OSX 10.5.6. Python frameworks 10.3.6 installed and both Python and Pycrypt 2.6 installed. Latest and greatest versions of ineptky.pyw, ineptepub.pyw and ineptkeymac.py downloaded.

I run ineptkeymac.py, and a key appears to be created. Next, I run ineptepub.pyw, specify the key file, the epub file and the target output file. Upon clicking on Decrypt in the Python GUI, an error appears above the decrypt applet box (within the GUI) saying: "Error: List assignment index out of range".

Not sure where the error lies. Any ideas on where to look and how to troubleshoot this?

Thanks very much!

146. I can confirm versions 4.3 and 7.3 work fine with current ADE DRM. Thank you very much.

147. This comment has been removed by the author.

148. Interesting.... with Python 2.6.4 Ineptkey (4.3) is generating errors when running that did not come up when running ineptkeymac.

Traceback (most recent call last):
File "/Users/blahblah/Documents/ineptkey_v43.pyw", line 31, in
from ctypes import windll, c_char_p, c_wchar_p, c_uint, POINTER, byref, \
ImportError: cannot import name windll

I believe a Mac system cannot process a call to Windows dll, right?

Has anyone else run into problems with ineptkeymac not generating a key?

149. Further sorting though this problem, it appears the Pycrypto 2.1 never properly installed. I notice when i attempt to "python setup.py build" I get an error indicating GMP library not found:

blahblah-macbook-pro:pycrypto-2.1.0 blahblah$python setup.py build running build running build_py running build_ext warning: GMP library not found; Not building Crypto.PublicKey._fastmath. blahblah-macbook-pro:pycrypto-2.1.0 blahblah$

Any ideas on how to assess whether the GMP library is installed as part of the OS X 10.5.6 install, or how to install it is not there?

Thanks!

150. use python 2.6 and pycrypt 2.6 - of course you can't access win functions with a Mac ... what have you expected. That's the reason ineptkeymac exists ;) ...

151. Of course JB, if you read my initial post, you will see ineptkeymac is also not functioning.

While I did not expect ineptkey4.3 to function, a fellow contributor kindly suggested trying it.

If you have any insights into why ineptkeymac is not functioning, as I originally posted, I would appreciate your thoughts. I suspect the problem lies with difficulties in getting a "good install" for Pycrypto completed. Note my prior post on the GMP error when attempting to build and install. Thanks

152. I'm getting the same missing GMP library error as mecarboy. And to my knowledge, there is no pycrypto 2.6, just 2.1.0. I'm on OSX 10.5.8, installed python 2.6 fine, pycrypto 2.1.0 won't build or install because of missing files. Here are the errors:

Jamies-iMac-2:pycrypto-2.1.0 apple$python setup.py build running build running build_py running build_ext warning: GMP library not found; Not building Crypto.PublicKey._fastmath. building 'Crypto.Hash.MD2' extension gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/MD2.c -o build/temp.macosx-10.5-i386-2.5/src/MD2.o unable to execute gcc: No such file or directory error: command 'gcc' failed with exit status 1 Jamies-iMac-2:pycrypto-2.1.0 apple$ python setup.py install
running install
running build
running build_py
running build_ext
building 'Crypto.Hash.MD2' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/MD2.c -o build/temp.macosx-10.5-i386-2.5/src/MD2.o
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1

Any suggestions?

153. This comment has been removed by the author.

154. As far as I know you don't need crypto API for the ineptkeymac version. And Wren you haven't installed the gnu compiler tools. I suggest you install it with the 'fink' installation package.

And you don't remove DRM from acsm files you remove it from the pdf files (acsm files are only the donwload files for the main pdf).

155. not to mention that you can install python crypto with fing with

sudo apt-get install python-crypto

156. WREN CAULFIELD>>> Have you had any luck sorting this out? I have also tried downloading and installing the Fink 0.9.0 Intel installer dmg file from the FINK site (http://www.finkproject.org/download/index.php?phpLang=en) and find that the INTEL installer DMG file will not mount, despite there being no question that the subject MacBook Pro has an Intel Core 2 Duo cpu.. thus the suggestion to install a GNU compiler suite gets us no further.

As for the PyCrypto version, I do apologize for the typo.. I have 2.1.0 installed.. and Python is 2.6. Again, apologies for confusion.

157. of course you need the same python crypto version as the python version (best 2.6).

To you other problems, consult a Mac (or fink) forum for further assistance.

I've got no Mac and I'm not planing to buy one. Also it's not a script but a Mac / Apple problem.

158. Awesome, just got this working. I grabbed the key from a windows machine, and now I can decrypt files on my OSX (running 10.6, Python 2.6).

The epub decryption script in the post above works fine for me, unmodified.

159. Thanks.. will keep exploring.. BTW, current "best" version of PYCrypto is 2.1.0
http://www.dlitz.net/software/pycrypto/

Simply, there is no Pycrypto 2.6...just the Python GUI is 2.6.

It may prove easier to migrate to 10.6 and cease phaffing around with 10.5.8.

Cheers!

160. I know google is my friend but I can't find the newest pdf script. I have tried and tried.

161. Google for ainept pdf epub tools

162. I tried that but I still can't find the download for pdf v 7.3 or 7.4

163. I google for that and then click on the top one (the freewebspace link) and there they are.

164. I've gotten one of the books completed (which was a PDF) using the format here. I have two others that must be in epub or something? I get an error message that says "Unexpected EOF".

Can anyone shed any light on that? Thanks!

165. This comment has been removed by the author.

166. I keep getting
Error: list assignment index out of range
despite having tried it on both
1.7.2 of Adobe Digital Editions and 1.7.1
when using ineptpub

any help would be nice

167. @mecarboy-

I am also on a mac. Here are the steps I did that worked:

1. install the 10.4u.sdk from the Mac OS X Install DVD. Put the OS X dvd in your mac and then choose "optional installs". Choose “Xcode.mpkg”. From there, follow the defaults until you get to the “Custom Install on ‘Macintosh HD’” screen. Everything is checked but “MAC OS X 10.4 Support” and that is the program that you ALSO want to install so check it and install.

2. Installed Python 2.6.5

3. Download Pycrypto 2.1 (which is for python 2.6) and extract it. Then go into Terminal and go to the directory with the pycrypto 2.1 folder (the easy way to do this is type "cd " into the Terminal window and then drag the pycrypto folder onto the terminal window - this fills in the info automatically into terminal. click enter). Now type the following:

"python setup.py build" (press return)
then

To double check if it is installed correctly, you go to “Macintosh HD/Library/Frameworks/Python.framework/Version/2.6/lib/python2.6″ there should be a folder called “site-packages” and inside that folder should be 3 items (readme, crypto folder, and pycrpyto-2.1.0-py2.6.egg-info)

6. Get "ineptkeymac.py" and "ineptepub.py". Put them in the same folder

7. Navigate to that folder with the scripts using terminal and type:
"python ineptkeymac.py"
Choose the same folder for the "adeptkey.der" to be saved.

8. Using terminal again, navigate to the directory that has both the adeptkey.der and the ineptepub.py. Type the following into terminal:
"python ineptepub.py"
Follow the instructions in the python window and you should have your new dedrm'd epub. Just remember to name the output file with the extension .epub.

168. God bless you, Allan - the DE 1.7.1 trick you explained here:

Worked like a charm! Hope your wife forgave you!

169. Hello, This is probably a stupid question but I am a programming ignoramous, so please forgive me.

I have installed Python and Pycrypto and have tried to run the above scripts for my Adobe DE epub files.

I get an error message:-

"problem decrypting session key"

Could you please explain what that means and how I get around it?

I can see from earlier comments that other people had the same problem but I can't work out how to fix it.

thx

170. Okay, an updated from my earlier post.

I went to pastebin.com after I read the final posts on the mobilereads thread and got this file http://pastebin.com/HbHbebqY

I then tried to decrypt and there was no error message. It said "file successfully decrypted".

How do I check that I did it right? I double clicked on my new saved book and it opened in Adobe DE which is what the encrypted one does so I don't know if I just wasted my time or not. (Sorry, this is probably very dumb to you!).

171. Sorry people but I am hoping one of you will be willing to help this old grandma in plain English and with clickable links.

I have just switched from a pc to a mac. Om my PC I was able to read books on my kindle that I had downloaded from the library by running the python script on them.

A kind young person has sent me step by step instructions with links so all I did was follow her instructions.

If one of you would be kind enough to do the same for me here so I can read the new library formatted eBooks (ePub) om my new Mac (our library is phasing out mobibooks which is what I have the instructions for) I will send you a huge box of treats or a great big thank you - your choice and you can also choose both :)

172. Me again. I've been stripping DRM off my Adobe DE files but have come up against an error on some of the books (not many).

The error message says:- error decrypting book session key

Does anyone know what it means and what I can do about it?

thx.

173. get the same error too (error decrypting book session key) - on all my books!!!

Running Ineptkey 4.4, IneptPDF 7.1, Win XP (SP3), ADE 1.7.1

If it helps, the books I am trying to decrypt are some career guides that I bought (legally!) from Vault

174. SFRVR, you MUST upgrade to ADE 1.7.2 as indeptkey 4.4 or 4.3 will NOT work with ADE 1.7.2 for getting the key. It only works with ADE 1.7.2.

175. SFRVR, you MUST upgrade to ADE 1.7.2 as indeptkey 4.4 or 4.3 will NOT work with ADE 1.7.1 for getting the key. It only works with ADE 1.7.2.

176. Ok, I have this working but why do the output files have more pages than the input files?

177. I have a problem with the output file giving an error 110 (unrecognized object name)on many of the pages in Adobe Acrobat 9. Here is what I'm using:
Pycrypto and Python (the correct ones for Python 2.6)
ineptkey 4.4
ineptpdf 7.4
After inept PDF decrypter completes the task, I do notice that the output file is a little smaller than the original.
Original size 173,533kb and Output size 173,473kb.
I have tried other versions of the ineptkey and ineptpdf with no success. Has anyone else come across this problem?

178. I navigated through Adam's steps above and backtracked when I hit some bumps. This is what I've done:

-I used pastebin to find "adeptkey.der" and "ineptepub.py" and "ineptkeymac.py" and saved as files all of them with their respective names. (Is that correct?)
-All of the above 3 files are in a folder along with the ePub file I'm trying to open.

When I type the commands using Terminal, I get, "Error decoding ASN.1" I have not seen anyone else report this error. Does anybody know what this means and what my next steps should be? Thanks!

179. Here's an update to my problem posted 4/13/2010. Turns out that Adobe Acrobat Reader was the problem. Whenever I view the pdf without the DRM in another program (I used PDF x-change viewer), everything is fine and there are no errors.

180. Thank you ever so much! I was happy to buy the books in ePUB format (saving about £20 and 2 months on the paper versions) but I cannot sit at the laptop and read a whole book -- now they're happily winging their way to the Palm (Mobipocket) for comfortable reading.

181. For those trying to work out the "not an ADEPT EPUB" error: I was getting that when I attempted to convert the epub I had simply downloaded (before finding out it was DRMed). After dowloading it again *through* ADE, then attempting to convert the epub from the ADE folder, it worked just fine. Maelcum's how-to above has the exact formula.

Cabbage: I really appreciate this. Like ZeWarren, I have an Iliad, which I read everything on, and like so many others, I bought a legitimate epub to read on it, with no warning that it had DRM (Simon and Schuster can go rot). Thank you for the solution.

182. I'm getting the exact same error Hans, Claude, and some others are getting:

Traceback (most recent call last):
File "D:\My Documents\Python Scripts\ineptkey_v43.pyw", line 230, in main
retrieve_key(keypath)
File "D:\My Documents\Python Scripts\ineptkey_v43.pyw", line 149, in retrieve_key
vendor = cpuid0()
File "D:\My Documents\Python Scripts\ineptkey_v43.pyw", line 112, in cpuid0
cpuid0__(buffer)
WindowsError: exception: access violation writing 0x01E6F208

I have the 32 bit version of Python 2.6.5 installed, and the matching version of PyCrypto. I am using version 4.3 of ineptkey, though I get the same error with version 3.

Anyone?

183. Hello. I'm having a bit of a problem stripping the DRM from 2 ebooks that I've purchased from the Sony Reader store. I have successfully stripped the DRM from 6 or 8 other ebooks so I know the process works. The errors I am getting are the following:

Error: File name in directory "OEBPS/CityandtheStar_dedi-1.h"

Error: File name in directory "OEBPS/Broo_9780345462053_epub_02//www.w3.org/2001/0" and header OEBPS/Broo_9780345462053_epub_02_r1-3-000_Split.htm" differ.

I suspect I may just be out of luck with these 2 ebooks since I have downloaded them from the Sony Reader store again and get the same errors. I thought I would at least ask, though.

184. Hiya...

So your scripts work great! Unfortunately, a good number of people aren't so computer savvy when it comes to using python. I wrote an windows installer program for your scripts, python 2.6, Digital Reader, and PyCrypto, that installs all the files, generates the digital key, and creates shortcuts to the scripts. Would you be interested in it?

186. Hi Jen,

I imagine if I directly link it, there's a chance the blog could get yanked (Big Brother Adobe is watching.) You could try googling 'Voltare DRM inept' and find it pretty easily. Sorry :(

187. I use ineptkey.pyw, version 4.4 and ineptpdf74.pyw, version 7.4 but when I try to remove the DRM I get the message "File Successfully decrypted" but when I open the file I can only read the first page.. When I go to page 2 it is zoomed to 4687% and I get a message saying "There was a problem reading this document(14)"

188. Michael - your epub structure seem to be flawed - it has nothing to do with the script.

189. I used Stephen's installer, and get exactly the same error as when I run the scripts manually. When trying to get the key, I get:

Traceback (most recent call last):
File "C:\IneptSuite-1.0\ineptkey-4.4.pyw", line 295, in main
retrieve_key(keypath)
File "C:\IneptSuite-1.0\ineptkey-4.4.pyw", line 214, in retrieve_key
vendor = cpuid0()
File "C:\IneptSuite-1.0\ineptkey-4.4.pyw", line 116, in cpuid0
cpuid0__(buffer)
WindowsError: exception: access violation writing 0x0057EAC0

190. @joblack Yeah, that was my conclusion as well. I cracked the files open and took a look at some of the internals but could not determine what might be the problem. That's not saying much since I don't have much experience with reading the internals of EPUB files.

191. Removing DRM from Library eBooks!!
I'm new to this stuff and need some help please.
Am trying to remove DRM from Library eBooks to read on my mobile phone.
Managed to figure out how to convert .prc files running python script in a command window.
Now trying to convert epub and pdf files and these errors:
1.file is not a zip file
2.unexpected EOf
3. something about it being too long !!!

Tried installing and uninstalling different version and deleting this and that.
Now i'm really confused and really frustrated.
Can some nice person help me please??
If you live in Australia, can I call you so you can talk me thru it on the phone????

192. Great stuff.
I purchased a book that's only available as DRM-ed PDF, but I prefer ePub on my e-reader.
Thanks to these scripts, I can now convert it to ePub.

193. Update - did a system restore and started again. Success with epub files.
used adeptkey v4 from johns post on feb14 with ineptepub v2.
woohoo!!
now I will work on pdf files.
And to think I almost gave up and bought a program to do this!!

thanks to the creation genius's

194. Help! I am also getting the "problem decrypting session key" error message.

Using ineptepub v4.1 and ineptkey v4.4 and trying to mess with a book bought from Sony. Upgraded to ADE 1.7.2 because I had to in order to get newer ebooks.

Any help would be appreciated :-) Kind of a newbie....

195. I got the same error as fontana4b; although I'm not a previous user.

Python 2.6.2
ineptpub.pyw v2

Is there logging or something I can use to provide more information for troubleshooting?

196. You need to get the newest ineptkey 4.4 and get the key again. The new ADE uses a slightly different method to save the keys in the registry. Needless to say that you need the newest ineptepub 4.1

197. Thanks jobblack, i'll have to figure out where to track latest version.

for anyone else
ineptkey 4.4 is http://pastebin.com/uKs91vR3

ineptpub 4.1 is http://pastebin.com/f4a7c338a

198. Hi

I'm getting the same error message as Andrew on May 8th. Does anyone have a suggestion?
Thanks in anticipation.

199. I am trying to remove drm off of my legal copy of an ebook from apollo to move it into my ipad and sony digital editions reader and I keep geting this "Error: it is not a zip file"
can anyone help on this.

200. Most of the erros come from a non-standard conform epub format. Almost always the fault is on the publisher's site.

If you don't have a standard conform epub the publisher has to correct it.

The script es unpacking, decrypting and repacking the epub so it has to be standard conform.

The script isn't trying to 'correct' non-standard-conform epubs.