Skip to content
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

Wrong ADE Passhash (B&N) key selected #687

Open
HamsterExAstris opened this issue Dec 2, 2024 · 3 comments
Open

Wrong ADE Passhash (B&N) key selected #687

HamsterExAstris opened this issue Dec 2, 2024 · 3 comments

Comments

@HamsterExAstris
Copy link

HamsterExAstris commented Dec 2, 2024

Question / bug report

I have two Nook books where the wrong key is being selected, resulting in the file not decrypting correctly.

Other books correctly skip the wrong keys and select the correct one. Both books are selecting the same wrong key each time, but they're selecting different wrong keys from each other.

Which version of Calibre are you running?

7.22

Which version of the DeDRM plugin are you running?

10.0.9-rc1

If applicable, which version of the Kindle software are you running?

No response

Log output

DeDRM v10.0.9: Trying to decrypt FILENAME.epub
DeDRM v10.0.9: Verifying zip archive integrity
DeDRM v10.0.9: “FILENAME.epub” is a secure PassHash-protected (B&N) ePub
DeDRM v10.0.9: Trying Encryption key KEYNAME
1n0rxpk8.epub is a secure Adobe PassHash (B&N) ePub.
DeDRM v10.0.9: Post-processing took 0.0 seconds
DeDRM v10.0.9: Finished after 2.4 seconds
DeDRM v10.0.9: Trying to decrypt FILENAME.epub
DeDRM v10.0.9: Verifying zip archive integrity
DeDRM v10.0.9: “FILENAME.epub” is a secure PassHash-protected (B&N) ePub
DeDRM v10.0.9: Trying Encryption key KEYNAME
lqrxjw60.epub is a secure Adobe PassHash (B&N) ePub.
Could not decrypt lqrxjw60.epub because of an exception:
Traceback (most recent call last):
  File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptepub.py", line 275, in decryptBook
  File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptepub.py", line 91, in __init__
  File "Crypto\Cipher\AES.py", line 228, in new
  File "Crypto\Cipher\__init__.py", line 79, in _create_cipher
  File "Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher
  File "Crypto\Cipher\AES.py", line 90, in _create_base_cipher
ValueError: Incorrect AES key length (0 bytes)

DeDRM v10.0.9: Failed to decrypt with key KEYNAME after 2.9 seconds
DeDRM v10.0.9: Trying Encryption key KEYNAME
lqrxjw60.epub is a secure Adobe PassHash (B&N) ePub.
Could not decrypt lqrxjw60.epub because of an exception:
Traceback (most recent call last):
  File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptepub.py", line 275, in decryptBook
  File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptepub.py", line 91, in __init__
  File "Crypto\Cipher\AES.py", line 228, in new
  File "Crypto\Cipher\__init__.py", line 79, in _create_cipher
  File "Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher
  File "Crypto\Cipher\AES.py", line 90, in _create_base_cipher
ValueError: Incorrect AES key length (0 bytes)

DeDRM v10.0.9: Failed to decrypt with key KEYNAME after 2.9 seconds
DeDRM v10.0.9: Trying Encryption key KEYNAME
lqrxjw60.epub is a secure Adobe PassHash (B&N) ePub.
Could not decrypt lqrxjw60.epub because of an exception:
Traceback (most recent call last):
  File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptepub.py", line 275, in decryptBook
  File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptepub.py", line 91, in __init__
  File "Crypto\Cipher\AES.py", line 228, in new
  File "Crypto\Cipher\__init__.py", line 79, in _create_cipher
  File "Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher
  File "Crypto\Cipher\AES.py", line 90, in _create_base_cipher
ValueError: Incorrect AES key length (0 bytes)

DeDRM v10.0.9: Failed to decrypt with key KEYNAME after 2.9 seconds
DeDRM v10.0.9: Trying Encryption key KEYNAME
lqrxjw60.epub is a secure Adobe PassHash (B&N) ePub.
DeDRM v10.0.9: Post-processing took 0.0 seconds
DeDRM v10.0.9: Finished after 3.4 seconds
@ElleKayEm
Copy link

Are you using the Windows Nook app to extract your key and download your books?

@HamsterExAstris
Copy link
Author

Yes, I'm using the Windows Nook app to download the books, and the correct key was extracted from there. If I remove the wrongly-selected keys from the plugin configuration, it successfully uses the extracted key to decrypt the file.

The keys it's selecting in error are username/password keys from c. 2012. Obviously not going to have any new files using those keys, but I prefer to keep them on file just in case I stumble across any old files I didn't previously run through the tool.

@ElleKayEm
Copy link

Okay, something @noDRM will need to look at.

I have a few of those old cc based passwords lurking around in DeDRM too. Incidentally, the only way you'd need one of those keys is if you found an undecrypted file that you couldn't download a new copy of. If the account it was purchased from was deleted or the book was completely deleted from the account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants