Sunday, December 20, 2009

Circumventing Barnes & Noble DRM for EPUB

In a move sure to leave consumers scratching their heads (especially the ones already wondering why they bought a Nook), Barnes & Noble has decided to implement their own DRM scheme for EPUB books. They partnered with Adobe to do it (it’s a variant of their ADEPT scheme), and all the Adobe SDK users will get access to it eventually. But for now much hilarity ensues as consumers buy books they can’t read on their devices.

The basic idea behind the B&N EPUB scheme is the same as that used by the ill-fated eReader format B&N acquired – step 1: generate an encryption key from the book-purchaser’s name + credit card #; step 2: hope that they don’t like giving that information out to strangers. They like to call this a form of “social DRM,” although I believe a more appropriate term is “silly.”

It would be very bad form for an application to keep user CC#s just sitting around on disk, so the Windows version of the Barnes & Noble Desktop Reader application (BDReader) just holds on to the generated key and not the source info. A wise decision, for which I congratulate them. It then stores this key in plain text in a sqlite3 database. An... interesting... decision, for which I thank them. Update: and then it turned out the key-generation algorithm was pretty easy too...

So now three scripts:

A Windows-only key-retrieval script: ignoblekey (version 2)

An any-platform key-generation script: ignoblekeygen (version 1)

And an any-platform book-decryption script: ignobleepub (version 1)

You need the decryption script and one of either the key-retrieval or key-generation scripts. They produce the same output, and the key-generator works on any platform, but I released the Windows key-retrieval script first and will leave it up for Windows users who’d rather not give their credit card number to random programs they download off the Internet (despite being a source-visible script and all).

For good only, please.

331 comments:

  1. Worked great. Thanks for everything.

    ReplyDelete
  2. Be advised in the US this is a violation of the DMCA - you have circumvented protections.

    Personally though I think this should be classified as "FAIR USE" - Really, what person is going to buy 1000 B&N books because they want to strip the DRM and release them as pirated copies?

    ReplyDelete
  3. Thank you! I despise DRM and think it should be banned, but support copyright with all I've got.

    Thank you!

    ReplyDelete
  4. I'm getting "Error: Problem decoding key; unexpected DB format?" after running ignoblekey.pyw.

    My clientapi file is: ClientAPI_v012.db

    Can you help?

    ReplyDelete
  5. OK, if anyone else has a similar problem: remove the ClientAPI_v012.db file and run B&N eReader and then close it.

    Thanks.

    ReplyDelete
  6. Thank you. A friend of mine calls these "digital crowbars", and says "use them only for good."

    THIS crowbar worked perfectly right out of the box.

    ReplyDelete
  7. Is there any way to use these scripts without having to install this questionable PyCrypto software?

    ReplyDelete
  8. I get an error when using ignoblekey.pyw stating,

    "Error: B&N user key not found; unexpected DB format?"

    Help please.

    ReplyDelete
  9. Okay, I got it working. Only now the DRM stripped epub isn't working. It won't be recognized by anything.

    ReplyDelete
  10. Hey,

    Everything worked great for me and I just wanted to say thank you for saving my $10. I bought an eBook from B&N, intending on putting it on my Sony Reader that I got for Christmas only to find out that it wasn't capatible. And of course, you have to dig quite deep to be clued into this on their website. Thank you so much!!!

    ReplyDelete
  11. @Michael; PyCrypto is the de facto standard Python cryptographic algorithms implementation. So no.

    ReplyDelete
  12. When we have the "Error:B&N user key not; unexpected DB format?" What did you did to make it work ?

    ReplyDelete
  13. @Mary; You can either find and delete your 'ClientAPI_v012.db' file then re-authorize BDReader with your account information, or just use the key-derivation script (ignoblekeygen). Both ignoblekey and ignoblekeygen will produce the same output when they work correctly.

    ReplyDelete
  14. Alright, I went through everything including the ignoblekey and it worked for 2 books (which came free with my account on B&N but it will not convert the book I purchased. The error I am getting is: "Error: Problem decrypting session key" I have tried using both my credit card number and the gift card number...still no luck. My Sony Reader I got for Christmas still will not work. Help?

    ReplyDelete
  15. @MLCarr; "Problem decrypting session key" is not an error ignobleepub can produce. Are you sure you aren't accidentally using ineptepub instead?

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. I am confusing myself, sorry I may be an engineer but I know nothing about computers! Here is what I have done:
    1. downloaded python and what other program was necessary
    2. created the adeptkey
    3. tried...unsuccessfully...
    4. saved and ran ignoblekeygen, successful.
    5. tried running ineptepub again. Results were successful on public domain novels, but not the one I purchased. This was when I got the "Problem decrypting session key" error.

    I will say that with the other books I still get the funky "Not an ADEPT EPUB" error. For some reason it still works even on my Sony Reader...

    ReplyDelete
  18. @MLCarr; Your main problem appears to be ignoblekey vs. ineptkey and ignobleepub vs. ineptepub. The default Adobe ADEPT EPUB DRM scheme and B&N EPUB DRM scheme are very simiar, but different. The 'inept' scripts will handle books you download via Digital Editions. The 'ignoble' scripts will handle books downloaded via the B&N website or Desktop Reader application. You cannot mix and match. Secondly, if you get "Not an ADEPT EPUB" errors, the book in question is likely already DRM-free in the first place.

    ReplyDelete
  19. Awesome, that worked perfectly. Thank you! The only problem I am still having is that when I open my Sony Reader program it says that my computer is not authorized to preview (or view) the page/book. This is the same error that I thought was related to B&N being stupid...maybe it is a different problem all together.

    ReplyDelete
  20. i need help with the b&n key. i got the pdf to work but when I double click any of the b&n scripts it does nothing...no certificate.. please dumb it down for me. i spend all day yesterday trying to figure it out.

    ReplyDelete
  21. i have sony prs 300. do i need to download the b&N reader for it to work?

    ReplyDelete
  22. I feel like a complete failure on trying to get this to work. I have the python 2.6 installed and downloaded all the need files.

    Nothing seems to do anything when I double click the ignobleekey script file.

    Also when I try the ignobleepub the input screen appears. Not sure what to place in each box, but when I place the script name ignobleeky in the first one and name of book in next to, I get "Key cannot be null string". Please help!!!

    ReplyDelete
  23. Thanks i<3cabbage its close to working-
    However the files i download from bn are pdb files not epub- is there a difference? can i just rename extension?

    ignoblekey and ignoblekeygen dont give the same key for me- maybe i am putting my name in differently then it wants or something.

    in anycase i get an error: File is not a zip file from ignobleepub the key file seems fine- it opens with zip and all. Renameing extension to zip didnt help.

    BTW @angle and eric you can try this install python then put the pythan install dir in your windows path -right click on my computer advanced edit environment variable. then open a command prompt and run
    python -s ignoblekey.pyw
    etc.

    ReplyDelete
  24. Ok im gettin with the program- i just bought ebooks like 3 weeks ago from bn and didnt realize they changed the format from pdb to epub since then.

    ReplyDelete
  25. Well R I have the same problem (.pdb not .epub) with one of the books I purchased, so we'll see. I'll wait for an answer from i<3cabbages on that one too.

    ReplyDelete
  26. @MLCarr, R; B&N is in the process of switching to all-EPUB. If you get an eReader format book (file downloaded with the .pdb extension) then darkreverser's 'ereader2html' will do what you need.

    @R; Not producing the same key? Could you e-mail me your name? It's possible/likely that I'm not handling non-ASCII characters properly in ignoblekeygen, in which case ignoblekey should be correct.

    @Eric; It sounds like your copy of ignoblekey/ignoblekeygen. Please re-download via the "download" link on the pastie page. When they run correctly, they should produce a file named bnepubkey.b64, which is what you provide as the "key file" parameter to ignobleepub.

    ReplyDelete
  27. Thanks...it seems to have worked!!

    ReplyDelete
  28. Ok Thanks -
    Actually there is no problem. Keys are the same- Use your b&n user name NOT whats on your credit card.

    ReplyDelete
  29. I figured it all out! Make sure when you go to the pasties you hit download on the side. if you try to copy and paste into notepad cause you didn't see the download button it will mess up the program buy putting all the line numbers before it even begins to put the programing and it will not space the programming properly. It is easier to use the keygen.

    ReplyDelete
  30. hi, will this python script run on the mac with version 2.5?

    ReplyDelete
  31. I got "Error: Problem decoding key; unexpected DB format?" while trying to run ignoblekey.pyw. I couldn't find this ClientAPI file that some people were talking about.

    ReplyDelete
  32. Thanks alot for this circumventing, finally I can read my newbought books on my mobile with mobipocket reader :)

    ReplyDelete
  33. Thank you first of all for posting this for us.I am having some trouble with ebooks purchased through a gift card though.I downloaded one yesterday (it's in .pdb format) and ereader2html doesn't work with it.I am getting an error (invalid name or credit card).I tried entering my entire gift card number, different permutations of my name but nothing seems to be working.Any ideas?

    ReplyDelete
  34. "B&N is in the process of switching to all-EPUB."

    Really? 8 of the 9 books I've bought are offered as .pdb downloads right now (and the 9th is a "Free" version of Pride and Prejudice -- I'm not even sure if it's encrypted). ereader2html works on the pdb files, but I'm surprised more of the paid books aren't epub.

    ReplyDelete
  35. Colin M.

    Buy a new book and you will see that's it EPUB (example J.D. Robb's Trial By Fire). Once Sony announced they were converting, it took months. But they only offered EPUB when they were completely done, whereas BandN are offering them one at a time.

    Stew

    ReplyDelete
  36. I love you!! Thank you!! I have a Kindle and I got a BN gift card for Christmas. I figured it wouldn't be too hard to convert their books, since I'd already used the kindle method and backed up all my books in different formats. The first book I downloaded was pdb. Figured that one out, then managed to download one in epub. Are ya friggin' kidding me?!?

    You're awesome, really.

    ReplyDelete
  37. I just started fooling around with this code and noticed (when I installed python and PyCrypto) that a new version and new maintainer of the latter software is available. The link is: http://www.dlitz.net/software/pycrypto/. Enjoy.

    ReplyDelete
  38. @Ruminator; dlitz is the new PyCrypto source maintainer, but neither he nor the original source maintainer provide binary packages. AFAIK, the link I provided is still the best place to go for Windows binary packages of PyCrypto.

    ReplyDelete
  39. help!! I get "Error: File is not a zip file" What do I do???

    ReplyDelete
  40. All my B&N files are in the good-for-nothing .pdb format and Darkreverser's script isn't working for me. Is there another way to get around the .pdb files?

    ReplyDelete
  41. I used calibre to covert a B&N .pdb book to epub.

    ReplyDelete
  42. Hi,

    I'm having issues with this. I have Vista 64 bit. Here is what I did, step by step:
    1. Downloaded PyThon 2.6.4, and installed it to it's default install location.
    2. Downloaded PyCrypto v2.1.0, and installed to it's default location.
    3. Installed the BN Reader Software to a default location.
    4. Downloaded the three scripts, and renamed them as suggested.

    Now, I'm having a few issues.
    1. Running ignoblekey.pyw, I get this error: "Problem locating B&N Reader DB"
    2. If I do the ignoblekeygen.pyw script, I enter my user ID and CC#, and it creates a new file successfully. Then, when I run the ignobleepub.pyw script, choose my book, and select output (ex: book.epub), I get the error "Key cannot be the null string".

    Please help!

    ReplyDelete
  43. Oh, and please bear in mind, this is the first time I have ever tried anything with Python and scripts :)

    ReplyDelete
  44. @i<3cabbages, MLCarr, & R how did you get the pdb to convert to epub. everything i trry doesn't work. and the windows flash so fast and do nothing.

    can i get a step by step. i have 4 pdb books i'd like to convert, and your help would be greatly appreciated.

    ReplyDelete
  45. I am having the same problem as John with the db file not being found, however when I try to run the keygen script to enter my own info, nothing happens. I'm running vista64 and wonder if the script's location is different than that of my setup (roaming/barnes & Noble/desktop reader). I'm checking the script.
    Thx,
    Sberg

    ReplyDelete
  46. OK, so there's an error in the raw script of the keygen, so I copied/pasted and got the script to work and bring up the keyfile generator; filled the info to create keyfile. I then ran the pub.pyw and entered what I thought was the correct info and it gives me an error: file is not a zip file. I don't know which file it's talking about. The BN file is a .pdb and my output file is a .epub.
    I need a little help... This is way over my head.
    SBerg

    ReplyDelete
  47. I'm having the same exact problems as John and 4shoppingonly too...

    ReplyDelete
  48. OK, after reading through the posts again, I discovered my problem was that my file is a .pdb not an .epub. So I needed to use "ereader2html" to remove the drm. It took me a while to find and work it, but once I figured it out my .pdb became a non-drm html that I was able to successfully import into both Calibre and Mobipocket Reader; and get onto my ebook (CyBook Gen3). So, I'm a happy camper :). Thanks to everyone here for their posts and especially to ILoveCabbages for starting this whole thing.
    sberg

    ReplyDelete
  49. well I get "key cannot be a null string" and I've done this setup correctly multiple times, and It is not a .pdb file.. downloaded as an epub.. any idea ?

    ReplyDelete
  50. Could we be having issues with it finding the B&N DB file, because we have Vista 64 bit, and it's located in Program Files (x86) instead of just Program Files?

    ReplyDelete
  51. John, I don't think so; both of my Windows 7 installations are 32-bit... Or maybe Windows 7 and Vista 64 might move the library?

    ReplyDelete
  52. I'm not entirely sure, I know nothing of programming, Python, and the like. I was just guessing. I did get the KeyGen to work, but Key Retrievel, on two different Vista 64 bit (1 Ultimate, 1 Premium), did not work. Same error.

    ReplyDelete
  53. HELP I am really lost. Novice at this. need a step by step for dummies. I downloaded python and the other. Don't know how to, or with what to save the script. I really am not this dumb. but HELP PLEASE

    ReplyDelete
  54. Most excellent. Now, do you have a way to dedrm the B&N PDB format? Most of their ebooks seem to be in that format.

    TIA

    ReplyDelete
  55. Anyone know where to get a current, working copy of ereader2html?

    Thanks

    ReplyDelete
  56. Here's ereader2html and other files: http://rapidshare.com/files/102854939/4DeDRMfiles.zip

    And here's the guy's blog: http://darkreverser.wordpress.com/

    Though I haven't gotten it working either...

    ReplyDelete
  57. Dude, you are great! INEPT, SWINDLE, IGNOBLE.
    Kind of a genius.

    Here.. cabbage for you. You've earned it!!

    \ /
    \\ //
    )\-/(
    /e e\
    ( =Y= )
    /`-!-'\
    ____/ /___\ \
    \ / ``` ```~~"--.,_
    `-._\ / `~~"--.,_
    ----->| `~~"--.,_
    _.-'/ \ ~~"--.,_
    / \_________________________,,,,....----""""~~~~````

    ReplyDelete
  58. This comment has been removed by the author.

    ReplyDelete
  59. This comment has been removed by the author.

    ReplyDelete
  60. Ok. So I got the nook downloaded 2 books (one 8 bucks and one for a dollar)..it super sucked, hattttttttted it, so I returned it and got the kindle. Love the kindle, but I have read through this and the whole other discussion on epub's and tried everrrrrything! I have no idea what I am doing wrong, but am not completely familiar with all this either. All I know is I do not want any more of my money to waste (already had to pay a stupid re-stocking fee to get rid of the dang nook)..i also get the null error, but I read what Eric said ealier and I<3cabbage's response, tried it, but it still wasn't working. Help!

    ReplyDelete
  61. Anything for .pdb books, everything i've bought so far has been .pdb books

    Thanks for all the work helping people own the books they paid for.

    ReplyDelete
  62. I finally found ereader2html.py and that works fine. I'd rather have it just output an unDRMed .pdb but calibre can easly convert it back, or to a .epub.

    Thanks!

    ReplyDelete
  63. I found eRdr2Pml.py which is the same as ereader2html.py except it doesn't convert the PML to HTML you can then take the PML source and make it back into a .pdb with Dropbook http://www.ereader.com/ereader/help/dropbook/download.htm
    But since I'm not Linux i just used calibre to convert the PML it into an epub and all the formatting and TOC was perfect, unlike when i tried to convert the html to epub.

    ReplyDelete
  64. I want to be able to change ereader format so my wife can read my Nook ebooks on her Kindle2. This is totally new to me but I managed to generate the key. But when I run ignobleepub.pyw I get the message "error: Key cannot be the null string". It seems like a couple of other people are having this problem but I have not seen a solution. I have Windows7 so I tried both the 32bit and 64bit versions of the softwares with the same results. I also tried running the programs on my WinXP laptop with the exact same results. I downloaded the scripts several time but I can not get pass that error message. I wish someone could please tell me what I may doing wrong. Thank you very much.

    ReplyDelete
  65. I found out why I was getting that Key cannot be the null string error. In the ignobleepub menu I was using my B&N user name instead of my real name. I tried it with my new name today and it worked perfectly. So for the others that are getting that error message, if you are not using your real name that could be the problem.

    ReplyDelete
  66. So there is no confusion. In the last post I should have said I tried it with my real name not my new name. I need to read these things better before I post them.

    ReplyDelete
  67. I haven't used the new version, but most ebooks that use your name and credit card number use the name that is on the credit card to decrypt.

    ReplyDelete
  68. You are correct. That was the problem. I should have used my real name which of course is the name on my CC.

    ~eddie

    ReplyDelete
  69. I am generating the key then when i go to decrypt the file i get filename.epub: not an B&N ADEPT EPUB

    ReplyDelete
  70. Tried this on a Windows 7 machine and a Windows XP machine. Both failed with

    Error: Problem locating B&N Reader DB.

    I edited the script to point to the specific DB file and got:

    Error: B&N user key not found; unexpected DB format?

    I used IDLE to step through the python and when I got the file read into a variable, there was no instance of 'uhk00000000' in the data, so I gave up.

    ReplyDelete
  71. Hi

    when I run ignoblekey i get this

    Traceback [most recent call last]:
    File"ihnoblekey.pyw",line93,in gui_main
    dbpath=find_bnclientdb_path[]
    File"ignoblekey.pyw",line68,in find_bnclientdb_path
    appdata=os.environ['APPDATA']
    File".usr/lib/python2.6/UserDict.py",line22, in_getitem_
    KeyError:'APPDATA'

    any idea??

    ReplyDelete
  72. ahh don't worry about it ..I'm a idiot

    I found what I was doing wrong and the problem was

    I'm an idiot

    ReplyDelete
  73. I brought a ebook from Barnes and Noble. I am not able to copy and paste to an external document. I don't know why. Is there a way?

    ReplyDelete
  74. I am trying to run the ignoblekeygen script and it is not recognizing my name and password. I am using the current Credit card on file with my Barnes and Noble account. I am getting an (ERRNO 13) Permission Denied: bnepubkey.b64.

    I also tried to use the ignoblekey script and it cannot find the BD Database. Any suggestions for either of these errors?

    Thanks

    ReplyDelete
  75. I tried using it on Sony epub files and the pub script failed with the error "problem decrypting session key". No output file was generated.

    The pdf script version worked fine on an Adobe File with the pdf script (so I know Python and decrypts work), but with the epub script and Sony downloaded "Digital Editions" will not decrypt.

    Could it be the document is not encrypted? This doc will not read on iPad or some other devices (but read OK with the Sony Reader I previously had. Is there a conversion utility to PDF that I can try? Any other suggestions?

    ReplyDelete
  76. These are invaluable tools, especially if I can get them to work. I recently purchased a DRM-protected ePub from B&N. Wanting to allow my wife to read it on one of our Kindles, I innocently went hunting for conversion tools. Sigh!!
    Having nor found these tools, which look very promising, I'm encountering a problem.

    This is a 32-bit Vista Ultimate system. When I run "python -s ignoblekeygen.pyw" in a command window I get a mountain of complaints. I have installed the current production version of Python, 2.6.5, and the recommended v2.1.0 of PCCrypto. Both installed without complaint. Python appears properly in the PATH EV. When I issue the above command, I get the following error stack from the .pyw script:

    C:\Users\Peter\Documents\My Barnes & Noble eBooks\PLBriggs@comcast.net>python -s ignoblekeygen.pyw
    Traceback (most recent call last):
    File "ignoblekeygen.pyw", line 147, in
    sys.exit(gui_main())
    File "ignoblekeygen.pyw", line 129, in gui_main
    root = Tkinter.Tk()
    File "C:\Python26\lib\lib-tk\Tkinter.py", line 1643, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
    _tkinter.TclError: Can't find a usable init.tcl in the following directories:
    {C:\Python26\tcl\tcl8.5} C:/Python26/lib/tcl8.5 C:/lib/tcl8.5 C:/lib/tcl8.5 C:/library C:/library C:/tcl8.5.7/library C:/tcl8.5.7/library

    C:/Python26/tcl/tcl8.5/init.tcl: version conflict for package "Tcl": have 8.5.7, need exactly 8.5.2
    version conflict for package "Tcl": have 8.5.7, need exactly 8.5.2
    while executing
    "package require -exact Tcl 8.5.2"
    (file "C:/Python26/tcl/tcl8.5/init.tcl" line 20)
    invoked from within
    "source C:/Python26/tcl/tcl8.5/init.tcl"
    ("uplevel" body line 1)
    invoked from within
    "uplevel #0 [list source $tclfile]"


    This probably means that Tcl wasn't installed properly during the Python installation. Does that make sense?

    My obvious guess is there's a version incompatibility, since the init.tcl file referenced is both present and came from the properly signed distribution.

    What would any of you recommend?

    Regards...............Peter

    ReplyDelete
  77. Further about the above problem, when I re-installed Python 2.6.4 (Hey, I'm desperate here!) I see exactly the same error message stack. It's my assumption that the specific TCL Version 8.5.2 request is not part of the .pyw scripts, but I've not tried to look at them very closely. Is it, perhaps?

    ReplyDelete
  78. Duh!!!! Never mind! Once I figured out the proper parameters to enter (via the internal USAGE displays), I began to get some results.

    I appear to have successfully generated a BN_Key.aes file using my values.

    Now, when I run the ignobleepub.pyw script, I get the following message:

    Traceback (most recent call last):
    File "ignobleepub.pyw", line 234, in
    sys.exit(cli_main())
    File "ignobleepub.pyw", line 110, in cli_main
    decryptor = Decryptor(bookkey[-16:], encryption)
    File "ignobleepub.pyw", line 52, in __init__
    self._aes = AES.new(bookkey, AES.MODE_CBC)
    ValueError: Key cannot be the null string

    The invoking command string is: C:\Users\Peter\Documents\My Barnes & Noble eBooks\PLBriggs@comcast.net>python -s ignobleepub.pyw "BN_Key.aes" "deadinthe
    familysooki_9781101187319.epub" "deadinthefamilysooki_9781101187319_NoDRM.epub"

    I'm obviously still doing something wrong.

    Any hints will be appreciated..........Peter

    ReplyDelete
  79. Hello,

    I too am having issues. I believe B&N changed some things about their latest reader. The Appdata directory was wrong in the script and I'm stuck on the user key error. Any updates on this issue?

    Thanks

    ReplyDelete
  80. I finally purchased the latest Dresden book from B&N this morning (because ebates has 11% back from B&N today, though I'm still not happy I had to pay $13 to get my Dresden fix) and within two minutes had it on my Sony 505. THANK you for an awesome set of tools. :o)

    ReplyDelete
  81. I had trouble with the Windows version of the key generator (using Vista), but the alternate version worked fine. Slight correction on the CC name--it wouldn't work with the name I had on the card, as the card has my middle initial. I had to omit the initial. You have really done us epub readers a great service--and slavaged my $10. Beautiful job--thanks.

    ReplyDelete
  82. Folks:

    It's always the little things...

    Working method steps:
    1) python -s ignoblekeygen.pyw "FirstName LastName [N.B. Name from CC with no middle initial!]" 1234567890123456 [N.B. CC #] "bnepubkey.b64" [N.B. Output keyfile name; assumes local folder;]
    2) python -s ignobleepub.pyw "bnepubkey.b64" [Input keyfile name from output of ignoblekeygen.pyw; assumes local folder;] "B&NeBookFileName.epub" [N.B. Assumes local folder;] "B&NeBookFileName_sans_DRM.epub" [N.B. Assumes local folder;]

    Don't include any of the text between square brackets in the actual commands -- they're just comments.

    These two steps left me with a slightly smaller (by 27 KB) .ePub book that my B&N eReader was still happy to process.

    I then opened the deDRM'd .ePub version in Calibre v0.6.53 and converted it to .mobi. I moved the new .mobi version to my permanent library of eBooks, and opened it with my Kindle for PC reader without difficulty. I then, finally, copied the resulting version to my wife's Kindle, where she is now happily reading the book.

    It was a matter of picking up a piece here and a piece there. Hopefully, the above will function more as a 'recipie' for the actual process of conversion. I'd say the process requires a total of about 10 minutes, allowing Calibre about 6 minutes to convert the format of the eBook.

    Thanks, again, for these extremely useful Python scripts and the obviously significant amout of work the went into them.

    Regards................Peter

    ReplyDelete
  83. Well, I can get the 'ignoblekeygen.pyw' to work just fine, But am unable to get the 'ignoblekey.pyw' to work. I keep getting the error 'error locating B&N Reader DB'. My DB file is named 'ClientAPI.DB', and when I edit the script and remove the underscore in the 'ClientAPI_*DB' line, I get the error 'B&N user Key not found;unexpected DB format?'. I'm wondering if B&N changed the format of their database, and version 2 script no longer works. Like I said, the other scripts work just fine, and I'll use those, but I would like to get the 'ignoblekey.pyw' script working as well. Any ideas?

    Regards,
    CJ

    ReplyDelete
  84. I <3 cabbages: thanks so much for the great tools! Also thanks to all the help from the rest of you -- I couldn't have done it otherwise! I got a much desired book from B&N and got to read it on my Kindle last night!!!
    Like Craig, I couldn't get 'ignoblekey.pyw' to work but 'ignoblekeygen.pyw' worked great so I didn't worry about it. Also, I had to make a slight change to the steps that Peter posted: I had to leave off the extension for the output file name to get it to work (otherwise I was getting 'ValueError: Key cannot be the null string') but then it did create an epub file that I converted using Calibre.

    ReplyDelete
  85. EDIT: The output file was created with no extension. I edited the filename to add '.epub' then opened it in Calibre to convert.

    ReplyDelete
  86. I am having the same problems as several of the folks above. I had to change the directory and file names to get ignoblekey to find my DB files (ClientAPI.db). When I do that I then get a "B&N user Key not found; unexpected DB format" error.

    I have tried several name variations with ignoblekeygen, but when I try to run all of them through ignoblepub I end up with a "sample.epub not a B&N ADEPT EPUB" error.

    Has B&N changed formats entirely? Or is that error just the result of my not having a valid keyfile?

    Any ideas?

    ReplyDelete
  87. I have to apologize for a major piece of stupidity that underlies my previous comment.

    The issues with ignoblekey no longer working with the current BN Desktop Reader are valid. Everything else was based on a false premise.

    The ePub document I was trying to unencrypt was not actually encrypted. Once I tried the process (ignoblekeygen and ignoblepub) on a book that was actually encrypted, instead of a "sample" that was not, everything worked as intended.

    Many thanks for the incredibly useful utilities!

    ReplyDelete
  88. Thank you so much- I have been trying to get this to work all day. I purchased books @ B&N and was disappointed I was unable to read on my Jetbook Lite...now I can. Thanks so much this is great.

    ReplyDelete
  89. Thanks a bunch! This and ineptkey/ineptpdf have been truly invaluable tools.
    I was initially getting the dreaded "key cannot be null string" error. The problem was I used the wrong CC number - both of them were associated with the account, but I added one of them after I activated my nook. Otherwise: smooth sailing so far!

    ReplyDelete
  90. Thanks everyone for the initial posts and the follow-up commentary. My wife and I will now be fighting over the Nook much less now that I can read my books on the ereader on my phone!

    ReplyDelete
  91. Prom dresses act as the main attraction catcher of most women.The cheap prom dresses play the most significant role in winning the prom title. Prom dress should bring out your beauty and compliment your body type. Prom gowns allow women to choose something different every time.Once you have made up your mind on what type of dresses for prom to buy.

    ReplyDelete
  92. I accidentally ran the key generator a second time and now it doesn't work. My error message is: "Error: problem decrypting session key." All was working fine before. Is there any way I can fix this, not too complicated please, I am not very technical

    ReplyDelete
  93. Cheap Generic Medication
    I would like to appreciate the great work done by you
    Generic Viagra
    Generic Cialis
    シアリス

    ReplyDelete
  94. This comment has been removed by the author.

    ReplyDelete
  95. This comment has been removed by the author.

    ReplyDelete
  96. Hello all,
    I had some problems particularly with "Key cannot be null string". Though now I have it all figured out. So after several revisions I have posted a simple to follow guide to remove DRM protection from your epub files.

    1. Download
    Barnes and Noble Desktop Reader
    Python
    Pycrypto (Compatible with Python Version)
    Scripts - (ignoblekeygen, ignobleepub)

    2. Installing
    Install B&E, download drm protected books
    Install Python THEN Pycrypto

    3.Generating your key
    Go to Barnes and noble website
    Log in and click on my account
    On the right click manage credit cards.

    The name under the credit card # will be he name used with ignoblekeygen (Pastie-753985)

    Open ignoblekeygen (Pastie-753985)
    Paste that name into the field name.

    For credit card number use your full 16digit card # that you have set as the barnes and noble default credit card(no spaces). The last few digit of this card are shown above name...

    Click generate and you should have your (bnepubkey.b64)

    If you get "Key cannot be null string" check over your name and cc settings.

    4.Decrypting
    Open ignobleepub(pastie-751366)

    For key open your previously generated (bnepubkey.b64)

    For input file go to(my doucments/my barnes and noble ebooks/my email/)and choose your drm protected epub file.

    Choose an output name and add the .epub extension.

    Click Decrypt

    Goodluck :)

    ReplyDelete
  97. I was getting the Key Cannot Be Null error. My problem was that when I started ignobleepub.pyw, 'bnepubkey.b64' would already be showing in the Key File textbox and it needed to have the full path to the key file. (use the ... box)

    ReplyDelete
  98. Thanks so much for the great tools, and thanks Lindsay for the clear directions. I have a Kindle, wanted an ebook that is not available yet in Canada, so I opened a B&N account with a U.S. address, then was able to use ignoblekeygen, etc., and Calibre to convert to mobi! Absolutely brilliant!

    ReplyDelete
  99. Hey just as a mention I had some problems with downloading my books. If your trying to download Barnes and Noble books outside USA then use Hotspot Shield (google it).

    Also if you downloaded a PDB protected ebook then read the posts from the follwing site to remove DRM protection. The guide it easy to follow but in my opinion, its a more complicated process compared to removing DRM protection from Epub books.

    http://stream-recorder.com/forum/remove-drm-pdb-ebook-b-n-barnes-t5423.html?t=5423

    ReplyDelete
  100. Thanks, Lindsay, for pointing me towards to the PDB info.

    As for Hotspot Shield, I have tried it and quickly uninstalled it because I found it incredibly invasive. It ran some processes that I could not turn off or prevent from loading with autoruns.

    ReplyDelete
  101. Worked great. You're the man!

    ReplyDelete
  102. Another thanks to Lindsay for the Missing Manual. Finally got rid of the "Null String" error.

    ReplyDelete
  103. Good work smart guy. I will now be able to buy Barnes and Nobel eBooks. (B&N, please drop the DRM. It stops people from wanting to purchase from your site!)

    ReplyDelete
  104. Lindsay, thanks for the tip regarding the account info. at B&N.
    I was getting the "Key cannot be null string" and that tip solved my problem!

    ReplyDelete
  105. Nice effort, very informative, this will help me to complete my task....I really like flowers

    ReplyDelete
  106. I have a problem: When I run Ignoble Key it says "could not locate B&N Reader installation". I have reader version 2.5. installed.
    Any advice?

    Thank you for the great work!

    ReplyDelete
  107. Biber Hapı Zayıflamaya Yardımcı En Etkili Formül

    Biber Hapı zayıflama hapları arasında en çok rağbet gören zayıflama hapıdır. Türkiye haricinde dünyanın bir çok ülkesinde kilo fazlası olan kişilerin yardımına koşuyor. İçeriğindeki yüzde yüz doğal bitkiler sayesinde etkili bir formülü olan Biber Hapı, diyet ve yapmadan sağlıklı ve hızlı bir şekilde kilo vermenize olanak sağlar.

    Peki Biber Hapı Nasıl Kullanılır?
    Sabah kahvaltıdan yarım saat önce 2 su bardağı tercihen ılık suyla kullanılır. Yarım saat sonra mutlaka kahvaltı yapılmalıdır. Gün içersinde bol su tüketmeniz gerekmektedir. Zira Biber Hapı etkili formülü sayesinde sizi gün boyunca susatacaktır. Kahve, gazlı içecekler ve siyah çaydan uzak durmalısınız. Bu içecekler sizin kilo vermenizi engeller. Bunu yerine bol yeşil çay ve meyve çayları tüketmelisiniz.

    Biber Hapı Nasıl Zayıflatır?
    Gün içersinde size bol su tükettirerek ve içerisindeki özel formül sayesinde yağlarınızı parçalanmasını sağlayacaktır. Ayrıca size tokluk hissi vererek gün içersinde yemeklerde aşırıya kaçmanızı önleyecektir. Böylelikle Biber Hapı sayesinde kısa sürede sağlıklı bir şekilde kilo verebilirsiniz.

    Biber Hapı Yan Etkileri Nelerdir?
    Eğer ilk kez Biber Hapı kullanacaksanız bir hafta-on günlük süre zarfında baş ağrısı, uykusuzluk yapabilir. Kullanmaya devam ettiğiniz de bu etkiler geçecektir. Eğer dayanılmaz şekilde bu etkileri görürseniz birkaç gün ara verebilirsiniz.

    Hemen siz de Biber Hapı satın almak istiyorsanız buraya tıklayabilir veya 0541 520 56 99 & 0533 704 63 14 numaralı telefonlardan 7 gün 24 saat sipariş verebilirsiniz.

    ReplyDelete
  108. I think its a pretty good idea not that there aren't other sites out there that already do something similar but I think it might catch on here pretty well.chanel charm bag 2.55
    chanel charms bag
    chanel chocolate bar clutch

    ReplyDelete
  109. Great stuff, thanks for the scripts! Absolute life saver.

    ReplyDelete
  110. ooo bu konu tam benlik bunun aynısı birde film izlerken görmüştüm adam kadınla fena sikişiyordu. Ben sandım oyun oynayacaklar. Aynısı bir de özderede görmüştüm. orda bi adam sağlık bilgileri veriyordu. O adama sordum izmirde satilik dükkan varmı diye. ama yokmuş :) Onada dedim ki boş boş oturma git film seyretfilm seyrederken onaMusallat olan biri gelmiş.Sonra onu ara mak içinhayat ın en hızlı olduğu yerlere gitmiş.ve oralarda special life aramış. ve istediğini bulmuş onun istediğigüzel hayatmış :)

    ReplyDelete
  111. Thanks so much!! I have a Sony Reader and bought a book in .epub format from B&N which I then could only read on the Nook desktop software. I knew someone out there had to have cracked the DRM.

    I am running Windows Vista Ultimate 64-bit and I ran into a bit of an issue. I installed Python 2.7 64-bit, and when I tried running ignoblekey it says "could not locate B&N Reader installation". Then I figured I would install PyCryto to use ignoblekeygen, it said it needed Python 2.6. I found Python 2.6.6 and finally figured out the only way to install PyCryto was to use the 32-bit version.

    Anyway, after I finally got Python and PyCrypto installed, then ignoblekeygen and ignobleepub worked just fine. I used Calibre to convert .epub to .pdf, now I just have to see which one looks better on my Sony Reader. Thanks so much for these scripts!!

    ReplyDelete
  112. Okay, I thought I was computer savvy but I am about to throw my laptop through the window right now. I have downloaded Python and created the script...getting an error saying that I need to install Python seperately. I am confused and in need of help. :-( Is there anyone who can walk me through it?

    ReplyDelete
  113. Slight problem here. First of all, I am not a Python guy, preferring PERL myself ;)

    Anywho, I had to make this change:
    BN_APPDATA_DIR = r'Barnes & Noble\BNDesktopReader'

    Yup, they changed the path name. The next problem is that the script appears to be looking for "ClientAPI_*.db". This file does NOT exist.

    I am using a version of the software installed around July (no way to find the version number that I can find).

    Any ideas?

    ReplyDelete
  114. Worked like a charm! Thanks, cabbage!

    Get and use the old Barnes & Noble Desktop Reader - 2.1: http://www.brothersoft.com/barnes--noble-desktop-reader-318301.html

    ReplyDelete
  115. I had to leave off the extension for the output file name to get it to work (otherwise I was getting 'ValueError:
    Alaçatı konaklama

    Alaçatı butik otelleri

    Alaçatı

    ReplyDelete
  116. For men who want bigger, harder, longer-lasting erections, there's now VigRX Plus™, a fresh twist on the already popular VigRX™, but designed to further enhance men's sexual functioning with the addition of three exciting new ingredients: Damiana, Tribulus, and Bioperin. Doctor endorsed and rated #1 for results by clients of penis enlargement consumers. rated two penis pills is vimax. if you find about male enhancement this products is the best and proven to work, there products have money-back guarantee in effectiveness and result.

    ReplyDelete
  117. I got a hold of this Master-class-level transcript last week, but your hd film izle analysis as always enriches and deepens whatever you're looking at, MM.

    I'd also wager a good portion of film izle this week's paycheck that Marion didn't get a lot of discussion because the two of them were, at the time, stunted man children who didn't really know women. ;)

    ReplyDelete
  118. film izle,filmini izle,filmi,hd izle,hd film izle,sinema filmi,yabancı film,türk filmi



    film izle

    ReplyDelete
  119. This comment has been removed by the author.

    ReplyDelete
  120. I know this is kind of an old post.. but I'm having a bit of a problem. Everything works fine until I get a "Incorrect Name and/or Credit Card" error. I bought my book with a Barnes & Noble gift card and I noticed others had similar problems but I have yet to find a solution! Anyone have any ideas?

    ReplyDelete
  121. Thanks, got it working now!

    I had problem with the keygen since the name was not being properly encoded. My name contains a swedish 'å' character which resulted in an ascii encoding exception.

    I don't know any python but with a bit of googling a got it to work for my by adding an utf8 encoding in the generate_keyfile function:

    name = normalize_name(name) + '\x00'
    name = name.encode('utf8');

    Hope that helps.
    /E

    ReplyDelete
  122. Thanks for giving the such a informative blog . I really like our explanations described here.
    Thanks for sharing the information. That’s a awesome article you posted. I found the post very useful as well as interesting. I will come back to read some more.

    ReplyDelete
  123. I am very enjoyed for this site. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy. I think it may be help all of you. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! all the best!
    pariuri online

    ReplyDelete
  124. Wow that was awesome. I just bought 2 books from B&N, not knowing that they had their own special epub format and incompatible with Sony. Once I got the right versions of the software installed this worked like a charm right away. Thanks, you saved me money and taught me a little more Python to boot!

    ReplyDelete
  125. is than admin
    www.yesilcamizle.net

    ReplyDelete
  126. I completely converted this code to C# so that people don't have to install python and stuff to decrypt their books. If anyone is interested in the source or the assemblies I can post them somewhere but I wouldn't know where. If the original poster is interested I could submit them to them.

    ReplyDelete
  127. Lindsay THANK YOU!!! For the first time EVER somebody wrote something I could understand! I DID IT!

    ReplyDelete
  128. Ha, wow stumbled upon this again after sorting bookmarks and found heaps of people found my little guide useful.

    Hey cabbage, not sure if you have updated this post recently but maybe consider posting my guide at the start (with your post) or inform people that instructions are included with the files when viewing. Thanks again for the scripts :)

    ReplyDelete
  129. Thanks for giving the such a informative blog . I really like our explanations described here.
    pariuri sportive

    ReplyDelete
  130. I'm at a loss. I downloaded and installed Python (v2.7 32 bit) and PyCrypto (v2.1.0) and the old version of the BN Reader. When I run the scripts, everything appears to work just fine, but the file that I get is still encrypted - or at least it looks like encrypted gobblety-gook. :(

    ReplyDelete
  131. Sounds fantastic! Do you tried to buy xanax online?

    ReplyDelete
  132. this wont work for me.
    i tried the ignoblekeygen first and the file key was generated sucessfully but when i tried to actually use it, there were errors, i was thinking about it and that might be because i but most ebooks with bn gift cards?

    i tried the ignoblekey then next and that one says 'Error: Could not locate B&N Reader installation' i was thinking that might be because the name of the reader was changed to 'nook for pc'?

    any ideas guys? please help! i got a kindle 3 for christmas so im trying to convert my 'nookbooks' so that my little brother can use it.

    ReplyDelete
  133. This is the most awesome program

    Thanks so much

    ReplyDelete
  134. It appears that B&N has gotten wise to your scripts. The nook program has been changed enough that they no longer work.

    The program itself has been renamed, the database is now housed in the user's Roaming AppData, and, worst of all, the DRM key appears to be kept on B&N's server (you no longer "activate" or "register" the PC software like you do the nook hardware; you only sign into your B&N account).

    ReplyDelete
  135. I'm having the same problem as elle. Any help would be greatly appreciated.

    Thanks!

    ReplyDelete
  136. I'm getting the same error as Chris, who posted above on 4.22.10: I try to run ignoblekeygen and get the following: "Error:(ERRNO 13) Permission Denied: bnepubkey.b64".

    I'm running Windows 7 x64, python 2.7.1 (32-bit), and OpenSSL 1.0.0 (32-bit).

    Help a fella out?

    ReplyDelete
  137. I'm strangely getting a 'not a zip file' error. Ideas?

    ReplyDelete
  138. I am happy to find this very useful for me, as it contains lot of information. I always prefer to read the quality content
    TüpBebek

    ReplyDelete
  139. Thanks. After several unsuccessful attempts using ignoblekeygen, I finally realized I used my nick name in my B&N account instead of my full name that's on my credit card. Once I got that all sorted, worked like a charm.

    ReplyDelete
  140. I am using a version of the software installed around July (no way to find the version number that I can find.
    Beautiful perfume
    kenzo perfume
    escada perfume
    estee lauder perfume
    bvlgari perfume
    fendi perfume

    ReplyDelete
  141. THANK YOU so much!!! I have a Kindle and I got a Borders gift card for Christmas. Downloaded a book from Borders, used your conversion codes, and WHAM!!!....now I can read it DRM free!!

    ReplyDelete
  142. Anyone get a Error -3 while decompressing: invalid stored block lengths?

    ReplyDelete
  143. Whoa!!! I'm bowled with your high level of knowledge. I am so impressed. I believe you have immense knowledge on the matter. I think you are too good? Keep working and keep it up!!
    Generic Cipro

    ReplyDelete
  144. I ordered eTextbooks online and I wanted to know if this process will allow me to read the files on my Barnes & Noble NookColor?

    ReplyDelete
  145. This comment has been removed by the author.

    ReplyDelete
  146. If you are using a gift card, your key will still be your name and the default credit/debit card for your account.

    ReplyDelete
  147. Solution to "Python version 2.x required, which was not found in the registry."

    Install a 32bit version of python rather than 64bit. (e.g. for Windows 7 64bit)

    ReplyDelete
  148. Should this DRM removal then allow the ebook to be read by any program that opens epub documents? The program successfully decrypted a nookbook, but when I tried to open it with Stanza (an iPhone ebook reader app), the contents was jibberish.

    ReplyDelete
  149. Please help.
    I was able to generate the key without problems but all attempts at decryption result in Error: Error -3 while decompressing: invalid distance too far back. I have about $50 of purchased Nook books that I can only read on my laptop. I would like to get them on my NextBook2. Thanks!

    ReplyDelete
  150. Great post! I am just starting out in community management/marketing media and trying to learn how to do it well - resources like this article are insanity helpful.

    ReplyDelete
  151. Becoming an affiliate partner with the Leadswaves Affiliate Program can help you monetize your traffic by providing a valuable service to your consumers and creating a recurring revenue automotive leads stream with minimal effort.

    ReplyDelete
  152. Only getting about 30% of my files successfully stripped of DRM. It seems that B&N is using some new method for many books at this point.

    Anyone verify this?

    ReplyDelete
  153. Your article definitely worth looking through. I recently found the application well written and then quickly logical. I must personally we appreciate the time you devote to create the application. I’m sure very pleased in addition to lose time waiting for your blog post.
    bonusuri case de pariuri | pariuri fotbal

    ReplyDelete
  154. This article definitely worth looking through. I stubled onto the idea well written as well as conveniently clear. I wish to in person appreciate some time you spend to write the idea. I’m sure happy and even expect a post.
    rezultate pariuri | bilet pariuri | bonusuri pariuri | case pariuri | biletul zilei la pariuri | biletul zilei | pariloto | statistici pariuri | tipsteri | casa pariurilor | oferta pariuri | meciuri online | pronosticuri pariuri | case de pariuri | franciza pariuri sportive | pariuri online | bonusuri pariuri | pariuri sportive

    ReplyDelete
  155. I am reading many posts from this site ,I recently found the application , business logo design

    ReplyDelete
  156. Android based phones have a diverse array of applications available. For the new Android user, it can almost be overwhelming choosing which apps to install.

    best android apps

    ReplyDelete
  157. So informative things are provided here,I really happy to read this post,I was just imagine about it and you provided me the correct information I really bookmark it,for further reading,So thanks for sharing the information.
    pariuri sportive

    ReplyDelete
  158. Keep the posting up. I never thought I would find an individual that had close to the same grasp of worldly wise knowldege , but, you are that beacon of hope in humanity!I hope you continue to bring your knowldge and enlightenment to the world and never let your expression be squelched! Live passionate!

    ReplyDelete
  159. There are actually plenty of particulars like that to take into consideration. That may be a nice point to convey up. I provide the ideas above as common inspiration but clearly there are questions like the one you bring up where an important thing can be working in honest good faith. I don?t know if best practices have emerged round things like that, however I am positive that your job is clearly identified as a good game. Each boys and girls really feel the affect of just a second’s pleasure, for the remainder of their lives.
    Remixuri 2011

    ReplyDelete
  160. Really you have done great job,There are may person searching about that now they will find enough resources by your post.I like this blog..
    Blogger how when you visit my site,
    My Site created for men's health,
    Here the best method for you and get the best Penis Enlargement Pills today.

    ReplyDelete
  161. Whats wrong with papaer books? whatever happened with those?
    generic viagra

    ReplyDelete
  162. These kind of post are always inspiring and I prefer to read quality content so I happy to find many good point here in the postcustom temporary tattoos

    ReplyDelete
  163. It is a very informative and useful post thanks it is good material to read this post increases my knowledge engraved gifts

    ReplyDelete
  164. Thanks for the posting. Loads of excellent writing here. I wish I had found this site soonerhypnosis rotherham

    ReplyDelete
  165. This is actually pretty cool...maybe we can develop some reading about health supplements or vitamins in the near future.

    ReplyDelete
  166. There are actually plenty of particulars like that to take into consideration. That may be a nice point to convey up. I provide the ideas above as common inspiration but clearly there are questions like the one you bring up where an important thing can be working in honest good faith. I don?t know if best practices have emerged round things like that, however I am positive that your job is clearly identified as a good game. Mesa Yalikavak
    dap burgu kule Mini Royal Terrace Feri Each boys and girls really feel the affect of just a second’s pleasure, for the remainder of their lives.

    ReplyDelete
  167. Thanks for the posting. Loads of excellent writing here. I wish I had found this site sooner


    Manchester photography studio hire

    ReplyDelete
  168. Just curious, has the key retrieval script (ignoblekey) worked for anybody here? I've seen various comments of the key generation script working but not the key retrieval script.

    ReplyDelete