-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for "hardened" Adobe DRM & crypto code clean-up #48
Conversation
Thank you. It looks like a lot of work went into that. |
This comment was marked as resolved.
This comment was marked as resolved.
@PaulGJL You're using this patch on the newer Adobe DRM? |
@PaulGJL have you tried cloning this particular branch?
then create a release with
|
Wow, thanks a lot for the new Adobe DRM support. I wonder if this is going to cause yet another DMCA claim to this repository... I am going to take a look at the code and see if it works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested your changes and I was able to remove the DRM from an ADE3.0+ book. Great!
Though, I did notice one typo in your code that breaks some stuff, and I'm wondering why you removed the verify_book_key
function? That was added for a reason, and I'm not sure if your changes to the encryption code are sufficient to the point where that wouldn't be needed anymore. See apprenticeharper#1862 for details as to why this was added.
i install it ,but fail calibre, version 5.38.0 calibre 5.38 [64bit] embedded-python: True is64bit: True |
@johnhutnut |
@johnhutnut You are trying to load the plugin from source code - that's not supported. If you want to run versions that aren't released yet, use the make_release.py script to generate the proper archive. |
can you release a new versions ,i am doctor,dont know much about python
获取 Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
发件人: noDRM ***@***.***>
发送时间: Sunday, March 6, 2022 11:57:09 PM
收件人: noDRM/DeDRM_tools ***@***.***>
抄送: johnhutnut ***@***.***>; Mention ***@***.***>
主题: Re: [noDRM/DeDRM_tools] Add support for "hardened" Adobe DRM & crypto code clean-up (PR #48)
@johnhutnut<https://github.com/johnhutnut> You are trying to load the plugin from source code - that's not supported. If you want to run versions that aren't released yet, use the make_release.py script to generate the proper archive.
―
Reply to this email directly, view it on GitHub<#48 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AYC7MY4EZST4VFEQXPI4SQLU6TIVLANCNFSM5PVCQRHQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
can you make a update version for me |
I'm not going to create a release with untested code. Once the review of this PR is finished, the PR has been merged and the rest of the code is cleaned up a bit, there will be a new release. |
i don't know how to generate the achive ,can you package one archive for ,thank you so much
…________________________________
发件人: noDRM ***@***.***>
发送时间: Monday, March 7, 2022 12:06:51 AM
收件人: noDRM/DeDRM_tools ***@***.***>
抄送: johnhutnut ***@***.***>; Mention ***@***.***>
主题: Re: [noDRM/DeDRM_tools] Add support for "hardened" Adobe DRM & crypto code clean-up (PR #48)
I'm not going to create a release with untested code. Once the review of this PR is finished, the PR has been merged and the rest of the code is cleaned up a bit, there will be a new release.
―
Reply to this email directly, view it on GitHub<#48 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AYC7MY4LCPS4TEVGBVURKH3U6TJZXANCNFSM5PVCQRHQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
i am doctor ,not a programer
获取 Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
发件人: noDRM ***@***.***>
发送时间: Monday, March 7, 2022 12:06:51 AM
收件人: noDRM/DeDRM_tools ***@***.***>
抄送: johnhutnut ***@***.***>; Mention ***@***.***>
主题: Re: [noDRM/DeDRM_tools] Add support for "hardened" Adobe DRM & crypto code clean-up (PR #48)
I'm not going to create a release with untested code. Once the review of this PR is finished, the PR has been merged and the rest of the code is cleaned up a bit, there will be a new release.
―
Reply to this email directly, view it on GitHub<#48 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AYC7MY4LCPS4TEVGBVURKH3U6TJZXANCNFSM5PVCQRHQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Then you're better off waiting for the next release. |
Install the zip from https://we.tl/t-bNCKVOTyNx as a plugin. Do NOT extract anything. [Dislcaimer: Verify_key functions are absent and you might have issues.] |
4a72d93
to
253ac2e
Compare
thanks a lot ,work fine |
I just tried this with two ProQuest ebooks downloaded today, and it worked great on both; thanks! |
Hi, so this patch does work for most ADE books now, but it has failed with a particular book. Seems like there's a problem with the code? Please check, thanks.
|
Thanks a lot for the effort. it works! awesome!
|
Doesn't seem to work for me. I'm on Windows 7 and using a Calibre version prior to 5.38.0 -- might that be the problem? |
@usure |
Thanks. Makes sense. Will try on my Win 8 laptop. |
The goal is for this plugin to work with Calibre 4.x, too, at least for the most common DRM (Adobe). If it doesn't, can you post a debug log? |
@a980e066a01 Thanks so much. It works for me as well |
I've implemented these changes, and I've tried to convert some ebooks. Most worked, but the B&N ebooks I have didn't. I had a look at the new code, and I noticed that the book key that had been decrypted by this new code was 32 bytes long, while the bookkey from the current code was 16 bytes long. I noticed that the current code checks if the book key is longer than 16 bytes, and if that's the case, it only uses the last 16 bytes. This code has been omitted, but still seems needed, at least to convert the ebooks I have. Actually, this check is only needed if the book key can be shorter than 16 bytes, but maybe that doesn't happen anyway. In that case it may suffice to cut the extra bytes. If the book key always is 16 bytes, or longer, the correct book key can be generated by changing the line:
to:
If the book key can be shorter than 16 bytes, this line doesn't have to be modified, and the following lines from the current code should be placed after the line:
When the new code is modified this way, my B&N ebooks convert successfully. |
Thanks for letting me know... Can you remove the |
One ebook has book key:
The other ebook has book key:
The book key needed to convert the first ebook is:
The book key needed to convert the second ebook is: |
Can tyou please post again? The upload has since expired. Thanks. |
@JSWolf If you don't want to run makerelease.py yourself, the one noDRM posted in this comment is more recent: #48 (comment) |
I have been struggling with DRM on a single ebook for over a week now. I have been successful with every other PDF and EPUB from multiple sources. Also tried many from the same source as the problem ebook. I only have an error on this PDF so I can not figure out what the issue is.
|
@x0thrmc-exe You've tried with the current code (including what was merged from this pull request)? Not just the last 10.0.2 release? |
I am using the version from 2022-03-18 that was linked above in this thread. Is there a later one? |
No, not unless you run makerelease.py yourself. |
Ok I tried again. |
Hopefully @noDRM or someone can take a look at your last log and figure something out. |
Looking at other peoples error logs, I seem to be the only one that has anything like
And I wonder if this could be due to the metadata of the book containing non-ASCII characters. It's a bilingual book with both Chinese and English. Although, all other similar books from the same source, author, and publisher have no problem. |
Looking at the error code, this is unlikely to be caused by the book name. This looks like the account key in the plugin settings is corrupted. Did you manually import that key, or did the plugin auto-discover it? |
Only one book had this problem. All other books from the same source, including other books in the series had no problems at all.
I have tried both manually importing and auto-discovering, and on different platforms and computers. I have already tried removing and auto-discovering, but I will try once more. |
So this book is tied to the same Adobe ID as the ones which successfully decrypt? |
yes
|
Working fine on a ProQuest PDF tested today |
Hi, in [DeDRM_tools_beta_2022-03-18.zip] it appears the code can be run without calibre, standalone in file standalone/init.py To run as a standalone, what command to I type in terminal? and do i need to be in a specific directory? |
This has nothing to do with this PR... |
Hey, I'm experiencing this error as well. I have a PDF from ProQuest I'm attempting to remove the DRM of, that won't download in ADE 2.0 so I have to use 4.5, and after attempting to use the new version of DeDRM linked at #48 (comment) |
Ohh thank you, thank you!!! I almost gave up again. |
Here is another book which is still blocked by DRM with the same error. This one was downloaded from the Internet Archive. |
Okay, I've solved it. You need to go into Calibre preferences, and go into the plugin's preferences and delete your Adobe Digital Editions key. It seems that if you add it yourself, you get this ascii error. If you try adding a DRM book but you don't have any keys added, the plugin will automatically do some automated search for the correct key (that will not give you an ascii error) and the DRM will be gone. In other words, it's the "Create new Adobe Digital Editions Key" that is causing this ascii error; it's fetching some errored key. You just need to let the plugin sort itself out automatically. |
@TheWranger Ok, was surprised you were having trouble with an Internet Archive book since as far as I'm aware they don't use (or at least don't exclusively use) the newer Adobe DRM. |
It probably isn't, I just didn't get around to trying it with the old version of DE |
I've always just stuck with ADE 2 so I know it won't be. So far it hasn't stopped working for any of the places I get ebooks. |
OMG this worked! I was skeptical based on how many times I deleted and reset everything, but I simply did your steps and the book opened in Calibre no problem. After months I finally have a no DRM copy of that book. Thanks!
I also recently tried the same book i was having problems with in ADE 2 after finding an installer on archive.org. It would not open in ADE 2, giving some error about the key. |
Probably is the newer Adobe DRM when that happens. |
This PR adds support for the newer (""hardened"") Adobe DRM added with RMSDK 10.
It also cleans up the crypto code by removing support for anything but PyCryptodome and hashlib (faster than PyCryptodome). This actually fixes a few bugs on its own. You might want to review the two commits separately.
Closes #20, #25, #33, #45.
rights.xml
I have tested my code on Amazon, ADE and Kobo DRMed books, but hopefully I haven't broken anything.