Tuesday, December 22, 2009

B&N EPUB key derivation algorithm

I’ve managed to figure out the Barnes & Noble user EPUB AES key derivation algorithm. Rather than fragment things too much, I’ve just edited my previous post on B&N EPUBs and added the (for any platform) key-derivation script.

The algorithm is interesting mostly in that it isn’t very good. I mentioned in my post analyzing Adobe’s ADEPT system that ADEPT is a fairly well-designed cryptographic system, even if not a very effective DRM system. Adobe used all standard algorithms applied in standards ways and glued together with standard plumbing. Barnes and Noble’s key derivation algorithm in contrast is neither effective at increasing obfuscation nor shows much awareness of cryptographic standards.

Cryptography is hard. Do you know how different configurations of your chosen algorithms can make them more or less resistant to side-channel attacks? Do you understand why RSA Laboratories switched the recommended RSA padding scheme in PKCS#1 to OAEP? Do you know the implications of different block cipher modes of operation and why or why not you should choose a mode which includes integrity protection? These questions represent a random sampler platter of things you should just know in your bones before you do anything close to designing a cryptosystem. For everyone else – a category in which I include myself – there are well-reviewed, well-tested algorithms presented in standards documents published by such organizations as RSA Laboratories and the IETF.

For key derivation from non-random source data, there is in particular the PBKDF2 (Password-Based Key Derivation Function) published in PKCS#5. My point is not that the key-derivation algorithm used by B&N necessarily has cryptographically undesirable properties (although its computation speed makes brute-force attacks more plausible), but that the fact that they rolled their own instead of reaching for PBKDF2 shows a marked lack of cryptographic savvy.

On the DRM-as-obfuscation end this algorithm similarly come up short. The multiple steps involved demonstrate some level of attempt to introduce complexity, but in the resulting binary all those steps are in one place. The entire algorithm boils down to one function calling a handful of easily-labeled subroutines (sha1_wrapper, normalize_name, aes_encrypt, etc).

I really am starting to think that e-book format providers actively want their DRM schemes to be broken.

75 comments:

  1. How's that "other experiment" going? You know, the one about "gems"?

    ReplyDelete
  2. 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
  3. I think that the people at BN that write the key-generation schemes feel the same as one of the people that commented on your previous post. (DRM != good && Copyright == good)

    ReplyDelete
  4. Any Chance you've got a decryption script for Sony Reader EPUB formats? Or is it the same as any of the others you've released thus far?

    ReplyDelete
  5. I am having trouble loading pccrypto, keeps locking up. I have python 2.6. Any sugestions?

    ReplyDelete
  6. I think that this hack doesn't work any more - there is no *.db file in the B&N folder that I can find, even after the app has been installed, a book opened, and the app closed. Shame.

    ReplyDelete
  7. Adam, the .db file is under the Users\username\AppData\Roaming\Barnes & Noble\DesktopReader directory. The ignoblekey file is looking for ClientAPI_*.db, but there is no underscore or anything following any longer. You can edit the ignoblekey file so that it does not reference the underscore, but I still haven't gotten past the "key cannot be null string" that John mentioned earlier.

    ReplyDelete
  8. I Love You, Cabbages!!!

    ReplyDelete
  9. Cabbages,
    I am a newbie at this and dont know where to start in terms of understanding and implementing what your saying step by step on OSX.

    do you have a simple newbie tutorial?

    appreciate it

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

    ReplyDelete
  11. The keygen and decrypt worked like a charm under Ubuntu Linux 64-bit with python, python-tk and python-crypto installed.

    Thank you!

    ReplyDelete
  12. Thank you very much guy, it help me a lot !

    ReplyDelete
  13. Generous, I Can’t seem to be able to see anything similar on Yahoo – Guess I will have to keep it bookmarked!

    3D ultrasounds | 4d Ultrasounds

    ReplyDelete
  14. Thanks for sharing, much appreciated and useful post, congrat and keep on track!
    Cialis Online

    ReplyDelete
  15. That is a communal habit just before abuse Finpecia online headed for treat a range of class maladies.

    ReplyDelete
  16. I deliberate generic Periactin be able to make this doable to accomplish it.

    ReplyDelete
  17. This very boundary marker ended me hark back of buy Propecia, with the aim of's very fine!

    ReplyDelete
  18. Thi is a careful idea, a short time ago be keen on valtrex online, thanks for the column!

    ReplyDelete
  19. I carry out believe it is feasible in the direction of achieve this, thanks very a good deal en route for generic Zithromax.

    ReplyDelete
  20. Please one more post about that. I wonder how you got so good. This is really a fascinating blog, lots of stuff that I can get into. One thing I just want to say is that your Blog is so perfect...

    3d ultrasounds

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

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

    ReplyDelete
  23. I impressed greatly that the way you have written such great article. I got many reference about this topic but your one is online bookmakers Excellent tips, and the performance is looking much improved. bet365, bwin, uk betting tips, online betting, free bets, betting odds, horse racing, ladbrokes, free betting tips and bookmakers reviews , online bookmakers and promotional bonus codes

    ReplyDelete
  24. These collections are works of art in digital perspective. Thumbs up.
    Best Graphic Design Site

    ReplyDelete
  25. With many skills you can be good at at many more jobs and make less mistakes while doing it….
    web hosting pakistan

    ReplyDelete
  26. Your findinds about the different areas in the book worlds are really insightful, giving the fact that cryptography is one of my favourite sciences!
    Movers

    ReplyDelete
  27. weight loss programs mn

    Wow,great content and your blog template is so beautiful. Is this template free or not. If so, would you please share this template? if not, how much does it cost? Thanks a lot!

    ReplyDelete
  28. Interactive Presentation

    I like it very much because it has very helpful articles of various topics like different culture and the latest news. I am a

    ReplyDelete
  29. If so, would you please share this template?
    uk dissertation help

    ReplyDelete
  30. Adobe used all standard algorithms applied in standards ways and glued together with standard plumbing.

    writing dissertation papers

    ReplyDelete
  31. The entire algorithm boils down to one function calling a handful of easily-labeled subroutines.
    dissertation proposal title

    ReplyDelete
  32. website hosting australia

    This great blog is very interesting and enjoyable to read. I am a big fan of the subjects discussed. I also enjoy reading the comments, but notice that alot of people should stay on topic to try and add value to the original blog post. I would also encourage everyone to bookmark this page to your favourite service to help spread the word.

    ReplyDelete
  33. thank you guy .. can u share more like that documents ?
    uçak bileti

    ReplyDelete
  34. Great post,It gave me a lot of inspiration to make changes in my blog and make it way better than before.
    Law Essay Writing Service

    ReplyDelete
  35. Επιλέξτε όλες τις εικόνες με βιτρίνα καταστήματος.
    Όταν δεν υπάρχουν άλλες, κάντε κλικ στην επιλογή "Επαλήθευση".

    ReplyDelete
  36. شركة البيوت للخدمات المنزلية


    هي شركة البيوت سعودية ذات خبرة 25 عاما في مجالات الخدمات العامه واعمال اليرها وشركمقاولات والصيانة العامة مثل كشف التسربات واعمال تخزين عفش و نقل اثاث وتنظيف بالرياض ترميم منازل بالرياض و نقل اثاث وحل ارتفاع فاتوره المياه ومكافحة الحشرات رش مبيدات بالرياض وتخزين اثاث غ وة البيوت تمتلك اقوي فريق عمل قادر علي التواصل مع العملاء بشكل محترف ومرونة تامة . شركة البيوت قائمة علي المصداقية والثقة والضمان فيما تقدمه للعميل من خدمات المنزلية وكذلك سهولة التعاقد والاتفقات معنا ولا نختلف تماما عن الاسعار المطلوبة فالأهم لدينا كسب ثقة العميل وارضاؤه علي اي حال .

    شركة تخزين اثاث

    رش مبيدات

    شركة نقل اثاث بالرياض

    شركة ترميم منازل

    شركة تنظيف بالرياض

    شركة رش مبيدات

    كشف تسربات المياه

    تخزين عفش

    نقل اثاث بالرياض

    مكافحة الحشرات

    شركة كشف تسربات المياه بالرياض

    شركة تخزين اثاث بالرياض

     

     

     

     

     

     

     

    ReplyDelete
  37. افضل شركة غسيل وتعقيم خزانات غسيل الكنب والسجاد ومكافحة الحشرات وتسليك المجارى بالمدينة المنورة المثالية 0552692371
    شركة تنظيف بالمدينة المنورة تنظيف الفلل والشقق بالمدينة المنورة متخصصون شراء الاثاث المستعمل بالمدينه المنوره

    شركة شراء اثاث مستعمل بالمدينه المنوره

    شركة شراء الاثاث المستعمل بالمدينة المنورة

    شراء الاثاث المستعمل بالمدينة المنورة

    شراء الاثاث المستعمل بالمدينة المنورة

    شراء الاثاث المستعمل بالمدينة المنورة

    شراء الاثاث المستعمل بالمدينة المنورة


    شركة غسيل كنب بالمدينة المنورة


    شركة غسيل خزانات بالمدينة المنورة


    شركة تنظيف خزانات بالمدينة المنورة


    شركة مكافحة حشرات بالمدينة المنورة


    شركة تنظيف خزانات بالمدينة المنورة

    شركة غسيل كنب بالمدينة المنورة


    شركة غسيل شقق بالمدينة المنورة


    شركة مكافحة حشرات بالمدينة المنورة


    شركة غسيل خزانات بالمدينة المنورة


    شركة غسيل كنب بالمدينة المنورة



    شركة غسيل شقق بالمدينة المنورة


    شركة غسيل كنب بالمدينة المنورة



    شركة مكافحة حشرات بالمدينة المنورة  




    شركة تسليك مجارى بالمدينة المنورة


    شركة مكافحة حشرات بالمدينة المنورة


    شركة كشف تسربات المياة بالمدينة المنورة




    شركة نقل عفش بالمدينة المنورة    


    شركة نقل الاثاث بالمدينة المنورة

    شركة نقل عفش بالمدينة المنورة



    شركة تركيب غرف نوم بالمدينة المنورة

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

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

    ReplyDelete
  40. This blog actually takes me back to certain time a few years back. Its very interesting to read and one that one would revisit to read and keep on knowing more about loving cabbages. Wallpaper sellers Kenya Its such a privilege to find this post. Great work that should continue.

    ReplyDelete
  41. Wow, what a coincidence, I just landed on this page and found the programming information I was looking for. I am very grateful and I would like to appreciate the author who compiled this information and shared it with us. I am sure it will be of help to a lot of online users. Additional, he or she can access Case Study Proofreading Services which will help him to post error-free documents.

    ReplyDelete

  42. شركة ركن الذهبيه للصيانة والنظافة ، ارخص شركة تنظيف منازل بالرياض تقدم شركتنا افضل الخدمات المنزلية علي الاطلاق حيث انها تقدم خدمات التنظيف المتكاملة مثل تنظيف المنازل والبيوت والفلل والقصور والمكاتب الحكومية ، كما انها تقدم خدمة تسليك المجاري وخدمة نقل الاثاث ومكافحة الحشرات ورش المبيدات وكذلك كشف التسربات وشفط البيارات
    يمكنك زيارة موقعنا https://nileriyadh.wordpress.com لانها هي الافضل علي الاطلاق حيث انها توفر كل الخدمات التي تحتاج

    شركة تنظيف خزانات بشرق الرياض
    شركة تنظيف خزانات بشمال الرياض
    شركة تنظيف خزانات بجنوب الرياض
    شركة تنظيف خزانات بغرب الرياض
    شركة تنظيف سجاد شمال الرياض
    شركة تنظيف سجاد شرق الرياض
    شركة تنظيف سجاد جنوب الرياض
    شركة تنظيف سجاد غرب الرياض

    ReplyDelete
  43. ور المدينة رائدة شركات التنظيف بالمملكة تقدم لك عزيزى العميل خصومات مزهلة خاصة للتعاقدات الجديدة لدينا اجود مواد تنظيف مستوردة من الخارج واجود معطرات شركة تنظيف مجالس بالرياضحيث نقوم بخدمة شاملة كل انحاء المكان من تنظيف للارضيات والحوائط والاسقف والخزانات والمجالس والمفروشات الارضية من موكيت وسجاد شركة تنظيف مجالس بالرياضفريق العمل معنا منذ عشرات السنون خبرتة الكبيرة وامانتة جعلتنا فى الصدارة دائماشركة تنظيف مجالس بالرياض
    شركة تنظيف بأبها

    شركة تنظيف فلل بأبها
    شركة تنظيف شقق بابها


    شركة تنظيف منازل بأبها
    شركة تنظيف مجالس بابها
    شركة ننظيف موكيت بأبها
    شركة تنظيف خزانات بأبها
    شركةتنظيف منازل بخميس مشيط
    شركة تنظيف فلل بخميس مشيط

    ReplyDelete
  44. I want you to thank you for your interval of this outstanding read!!! Your blog website content is more interesting and useful. coursework writing services

    ReplyDelete
  45. very informative post and looking forward for more post like this. We are providing background removal service for your business.
    Are you professional photographers, photography agencies, eCommerce retailers? If so Orbit Graphics is the right co-partner for your eCommerce product photo editing solutions including background removal service.

    ReplyDelete
  46. من مؤسسة رواد الحرمين المتخصصة فى عزل

    شركه عزل فوم بجدة
    شركة عزل خزانات بالدمام
    هو عزل مائى مستورد من الخارج للحفاظ على الخزان من الشروخ وتراكم المياه الملوثة التى تجلب الجراثيم شركة عزل اسطح بالدمام لديها العمالة المتميزة فى تنظيف وعزل الخزانات العلوية والارضية وعزلها بالمواد المائية بعد التعقيم من الجراثيم.
    احدث معدات وادوات عزل الخزانات الموجودة بالدمام للقيام بتنفيذ العزل المستخدم على السطح المائى والحرارى بالدقة العالية.


    شركه عزل فوم بجدة افضل شركة عزل خزانات بالدمام التى تمتلك افضل المعدات الحديثة والمتطورة والعمالة المدربة على تركيب انواع العزل المستخدم للسطح بالحرفية العالية.
    أفضل المواد المطلوبة فى عزل الخزانات الموجودة بالدمام لدى شركة عزل اسطح بالدمام لحماية وزيادة عمر الخزان الافتراضي.

    شركه عزل فوم بالدمام عزل فوم بعنيزة هو افضل انواع العوازل فى الفترة الاخيرة المستخدم فى حماية الأسطح من الرطوبة العالية وتسربات المياه.
    شركه كشف تسربات المياه بالاحساء

    مادة كويتية الصنع تستخدم بماكينات ضغط الهواء من خلال افضل مجموعة عمل مكونة من فنيين وعمالة مدربة فى تنظيف السطح ورش الفوم علية وتسليك شركة الكهرباء.
    شركه عزل فوم بالجبيل
    لا تجهد نفسك ونحن تحت امرك ورهن اشارتك .
    أبرز خدمات مؤسسة الحرمــين للمقاولات العامة بالدمام والرياض

    شركه عزل فوم بالدمام


    شركه عزل اسطح بالاحساء


    شركه عزل فوم بالقطيف

    شركه عزل فوم بالاحساء

    شركه كشف تسربات المياه بالاحساء

    تركيب حجر فرعوني للمنازل

    شركه عزل فوم بالجبيل شركة عزل اسطح مبلطة وغير مبلطة بالجبيل

    ReplyDelete
  47. من مؤسسة رواد الحرمين المتخصصة فى عزل

    شركه عزل فوم بجدة
    شركة عزل خزانات بالدمام
    هو عزل مائى مستورد من الخارج للحفاظ على الخزان من الشروخ وتراكم المياه الملوثة التى تجلب الجراثيم شركة عزل اسطح بالدمام لديها العمالة المتميزة فى تنظيف وعزل الخزانات العلوية والارضية وعزلها بالمواد المائية بعد التعقيم من الجراثيم.
    احدث معدات وادوات عزل الخزانات الموجودة بالدمام للقيام بتنفيذ العزل المستخدم على السطح المائى والحرارى بالدقة العالية.


    شركه عزل فوم بجدة افضل شركة عزل خزانات بالدمام التى تمتلك افضل المعدات الحديثة والمتطورة والعمالة المدربة على تركيب انواع العزل المستخدم للسطح بالحرفية العالية.
    أفضل المواد المطلوبة فى عزل الخزانات الموجودة بالدمام لدى شركة عزل اسطح بالدمام لحماية وزيادة عمر الخزان الافتراضي.

    شركه عزل فوم بالدمام عزل فوم بعنيزة هو افضل انواع العوازل فى الفترة الاخيرة المستخدم فى حماية الأسطح من الرطوبة العالية وتسربات المياه.
    شركه كشف تسربات المياه بالاحساء

    مادة كويتية الصنع تستخدم بماكينات ضغط الهواء من خلال افضل مجموعة عمل مكونة من فنيين وعمالة مدربة فى تنظيف السطح ورش الفوم علية وتسليك شركة الكهرباء.
    شركه عزل فوم بالجبيل
    لا تجهد نفسك ونحن تحت امرك ورهن اشارتك .
    أبرز خدمات مؤسسة الحرمــين للمقاولات العامة بالدمام والرياض

    شركه عزل فوم بالدمام


    شركه عزل اسطح بالاحساء


    شركه عزل فوم بالقطيف

    شركه عزل فوم بالاحساء

    شركه كشف تسربات المياه بالاحساء

    تركيب حجر فرعوني للمنازل

    شركه عزل فوم بالجبيل شركة عزل اسطح مبلطة وغير مبلطة بالجبيل

    ReplyDelete
  48. تحية للكاتب ولكل من أثرى بعقله وقلمه مجرى النقاش. أنا من قراء عبدالله القصيمي المفكر المبدع الذي عانى الأمرين من المتدينين. لكن يا أهل السعودية هناك أمل طالما أن أقلامكم قد وصلت إلى الحوار المتمدن ... متنفس الحرية.
    مقابر للبيع
    خبير سيو
    خبير سيو
    خبير سيو
    مقابر للبيع
    مدافن
    خبير سيو
    شركة تصميم مواقع
    افضل شركة تصميم مواقع
    networkuniversity
    فيب الرياض
    فيب
    موقع فيب

    ReplyDelete
  49. This page is very nice and very suitable to expand. I really like this page.
    don't forget to visit my site :) Thankss..
    games poker369
    Poker bri 24j am
    ceme 24 jam
    Omaha 24j am
    Dominoqq 24 jam
    Super10 24j am

    ReplyDelete
  50. Freemake Video Converter Key also fuses straightforward gizmos for altering video prior to when a switch, for example, slicing scenes and so forwards. These features aren’t as extensive as master video changing programming like Final Cut Pro. Be that as it will, FVC will put every thing so as when there is no other alternate. Free of charge, quickly, converts into or out of any video compound

    ReplyDelete
  51. مقال من افضل المقالات ومدونة ممتازة دائما متفوقة وفي المقدمة تسلموا علي المجهود المبذول في كتابة مثل هذا المحتوي الرائع
    خبير سيو
    مقابر للبيع
    سيو

    ReplyDelete