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

Obok plugin can sometimes use the wrong key for decryption #1718

Open
MentalHolyGlobe opened this issue May 28, 2021 · 17 comments
Open

Obok plugin can sometimes use the wrong key for decryption #1718

MentalHolyGlobe opened this issue May 28, 2021 · 17 comments

Comments

@MentalHolyGlobe
Copy link

I just discovered this issue because there was a book in my library that appeared to successfully decrypt, but when I tried to open it the book was still encrypted gibberish (or I guess technically wrongly decrypted gibberish). I then tried decrypting the same book from the command line with the obok.py script, and it succeeded. Looking at the logs (see below), it was clear that the plugin was finding a key that passed the plaintext check for the first encrypted file, but the CLI ruled that same key out because the next encrypted file check failed.

You can see in the code, the plugin decryption short-circuits the check after the first file passes, while the CLI script checks every file.

At first I assumed the check was short-circuited for performance reasons, but looking at the code it doesn't seem like it's very expensive, it's probably marginal compared to the cost of the actual decryption. So I think the fix is probably just to perform the check on every encrypted file, just like the CLI script.

Relevant logs from plugin:

...
Trying key:  b'41ce833dca23272df38e57accbe88474'
Checking text:b'OC21-\x85\xd86%\x1b':
Perhaps utf-8 without BOM
Seems to be good text
Success!

Relevant logs from CLI (starting from the same key the plugin settled on, you can see how the very next test fails):

...
Trying key: 41ce833dca23272df38e57accbe88474
Checking text:b'OC21-\x85\xd86%\x1b':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'\xfa\xad\xebsANN\x0b\xbf\xc7':
Perhaps utf-8 without BOM
Bad character at 0, value 250
Decryption failed.
Trying key: 77d78e5f9b92faa9441d043336abd571
Checking text:b'>\xb3\xef\xed\x1a9\xc4\x9auP':
Perhaps utf-8 without BOM
Bad character at 1, value 179
Decryption failed.
Trying key: 8ae806b963060ba6ee0f26ae497d1384
Checking text:b'\xe5w\x01\xae\xc31\xcc\x8dx\xde':
Perhaps utf-8 without BOM
Bad character at 0, value 229
Decryption failed.
Trying key: 7fc3649e345cdb8b29d957ccc360687b
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
... (Testing all the other files which also pass)
Decryption succeeded.
@jcd1013
Copy link

jcd1013 commented May 28, 2021

It would be awesome if there was a fix because I'm having to log out of the Kobo app and do a fresh download of the books every time in order for obok to recognize that the files is actually encrypted.

@ableeker
Copy link
Contributor

You're right. It's not difficult to remove this feature. You just have to delete line 378, and 399, and change line 400 to:

file.check(contents)

Please note that in line 400 you'll have to remove one indent as well, so it'll have the same level of indents as line 396, 397, and 398.

However, someone has definitely added these lines here. At first glance it should be fine to remove them, but I wonder why they were put here, does it fix another bug?

@ableeker
Copy link
Contributor

It seems this code has a different function. I've just imported 3 Kobo books (I only have 3 encrypted books) from the PC (not the device) with the code, as well as without. What happened is that in both cases the 3 books not only were imported successfully, they were decrypted successfully too. However, without this code, a number of extra tests were performed even though the books were already confirmed to be decrypted successfully. For one book, that happened dozens of times. So it looks like this code is meant to prevent that. Both times all books were successfully imported, and decrypted successfully, but without the code the log file contained 624 line, while with this code, it contained 315 line.

So it looks like this code is useful, and I wonder if your issue is caused by something else.

@ElleKayEm
Copy link

Obok 7.1.0 works for me, but 7.2.1 doesn't. Won't decrypt or import.

@MentalHolyGlobe
Copy link
Author

@ableeker I think you may have a small misunderstanding of the issue. The way the decryption in the CLI script works is for each possible key it decrypts each file, then for each decrypted file with a recognized mime type it does a sanity check, verifying that it has a correct-looking header. If every one of these sanity checks passes, then it's very likely that the key was the correct one.

The way the plugin does it is almost the same, except that it only does a sanity check on the first decrypted file with a recognized mime type. If that check passes, it assumes the key is the correct one and doesn't do any further checks, it just decrypts the remaining files. This works most of the time, but as I discovered it is possible for the stars to align and the wrong key to appear to correctly decrypt that first file (in this case it was the ASCII branch of the check, which is relatively easy to pass as it just needs to have a small number of characters be in the correct range. You can see in my original post that the incorrect key decrypted to gibberish, but enough of that gibberish was in the ASCII range for it to pass the test.)

The result is that in some (probably still fairly rare) cases the incorrect key is chosen and the book is imported using that, meaning the imported book is gibberish. The fix will do more work, as you say (you are seeing more lines in the log because each of those additional checks outputs a few lines), but it's not actually that much more work per chapter, and it will vastly decrease the probability of using the wrong key.

@MentalHolyGlobe
Copy link
Author

Obok 7.1.0 works for me, but 7.2.1 doesn't. Won't decrypt or import.

I don't think this is the same issue. My issue imports the book but the book is unreadable because it was decrypted with the wrong key.

@ableeker
Copy link
Contributor

@MentalHolyGlobe Good point. I've had a closer look at the code, and I think the person who has introduced this code probably concluded that all these test weren't needed. And that may well be true in most cases, for instance with the Kobo books we've tested the code. But because it introduces an issue, we shouldn't use it.

Are the books decrypted successfully with the version I have attached?

Obok_plugin.zip

@ableeker
Copy link
Contributor

@ElleKayEm I've checked again, I've definitely been using Obok plugin 7.2.1, dated April the 11th, and my Kobo books were successfully imported, and decrypted. Was there anything useful in the log file?

@MentalHolyGlobe
Copy link
Author

@MentalHolyGlobe Good point. I've had a closer look at the code, and I think the person who has introduced this code probably concluded that all these test weren't needed. And that may well be true in most cases, for instance with the Kobo books we've tested the code. But because it introduces an issue, we shouldn't use it.

Are the books decrypted successfully with the version I have attached?

Obok_plugin.zip

Yes, I can confirm that this version decrypts the problematic book successfully (as well as a small sample of books that already worked previously).

@ableeker
Copy link
Contributor

Great! I've submitted pull request #1753 with the fix.

@ElleKayEm
Copy link

@ableeker

Was there anything useful in the log file?

I'll let you be the judge:

calibre Debug log
calibre 5.22.1 [64bit] embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && Count Pages (1, 11, 0) && EpubMerge (2, 11, 0) && EpubSplit (3, 1, 0) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0) && KindleUnpack - The Plugin (0, 83, 0) && Obok DeDRM (7, 2, 1)
calibre 5.22.1 [64bit] embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && Count Pages (1, 11, 0) && EpubMerge (2, 11, 0) && EpubSplit (3, 1, 0) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0) && KindleUnpack - The Plugin (0, 83, 0) && Obok DeDRM (7, 2, 1)
Turning on automatic hidpi scaling
devicePixelRatio: 3.0
logicalDpi: 96.0 x 96.0
physicalDpi: 94.51162790697674 x 94.75647668393782
Using calibre Qt style: True
[0.00] Starting up...
[0.00] Showing splash screen...
[0.53] splash screen shown
[0.53] Initializing db...
[0.55] db initialized
[0.55] Constructing main UI...
DEBUG: 0.0 obok::utilities.py - loading translations
DEBUG: 0.0 obok::dialogs.py - loading translations
DEBUG: 0.0 obok::config.py - loading translations
DEBUG: 0.0 obok::action_err.py - loading translations
[1.28] main UI initialized...
[1.28] Hiding splash screen
Starting QuickView
[17.38] splash screen hidden
[17.38] Started up in 17.38 seconds with 466 books
Running Obok DeDRM v7.2.1
DEBUG: 30.2 didn't find device
Obok v4.0.0
Copyright © 2012-2020 Physisticated et al.
C:\Users\lkmil\AppData\Local\Temp\tmptu3gw21s
DEBUG: 30.2 got kobodir C:\Users\lkmil\AppData\Local\Kobo\Kobo Desktop Edition
Found 4 possible keys to try.
DEBUG: 106.7 BookListTableWidget:get_books - book_num: 16
DEBUG: 106.7 BookListTableWidget:get_books - book: Startide Rising
DEBUG: 106.7 InterfacePluginAction::launchObok - number of books to decrypt: 1
Obok DeDRM v7.2.1 - Decrypting Startide Rising
Trying key: b'447e3871bd3cf4adf03d1f5b5aa0bb86'
Checking text:b'Rr\xbe\x15U\xf1h\xac~\xe3':
Perhaps utf-8 without BOM
Bad character at 2, value 190
Decryption failed, trying next key.
Trying key: b'b3c136f6517f835345d6ca35d9540ee8'
Checking text:b'O\xa2\xb2\x14#\xba\xed\x0c\x90\x07':
Perhaps utf-8 without BOM
Bad character at 1, value 162
Decryption failed, trying next key.
Trying key: b'b49e15b80a605c0078ba2235a03f308e'
Checking text:b'\x80\x91\xe7\tO\xe9)\x04\x86\xc1':
Perhaps utf-8 without BOM
Bad character at 0, value 128
Decryption failed, trying next key.
Trying key: b'4114153a848a820db464ce1d00cf6af2'
Checking text:b'/\t]\xae`\xa5\n>\xac\xd6':
Perhaps utf-8 without BOM
Bad character at 1, value 9
Decryption failed, trying next key.
Obok DeDRM v7.2.1 - Couldn't decrypt Startide Rising
DEBUG: 106.8 DecryptAddProgressDialog::do_book_action - book decryption failed: 'Startide Rising'
Obok DeDRM v7.2.1 - wrapping up results.

Tried with the version you attached and got the same.

Here's a successful log with 7.1.0:
calibre Debug log
calibre 5.22.1 [64bit] embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && Count Pages (1, 11, 0) && EpubMerge (2, 11, 0) && EpubSplit (3, 1, 0) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0) && KindleUnpack - The Plugin (0, 83, 0) && Obok DeDRM (7, 1, 0)
calibre 5.22.1 [64bit] embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && Count Pages (1, 11, 0) && EpubMerge (2, 11, 0) && EpubSplit (3, 1, 0) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0) && KindleUnpack - The Plugin (0, 83, 0) && Obok DeDRM (7, 1, 0)
Turning on automatic hidpi scaling
devicePixelRatio: 3.0
logicalDpi: 96.0 x 96.0
physicalDpi: 94.51162790697674 x 94.75647668393782
Using calibre Qt style: True
[0.00] Starting up...
[0.00] Showing splash screen...
[0.53] splash screen shown
[0.53] Initializing db...
[0.56] db initialized
[0.56] Constructing main UI...
DEBUG: 0.0 obok::utilities.py - loading translations
DEBUG: 0.0 obok::dialogs.py - loading translations
DEBUG: 0.0 obok::config.py - loading translations
DEBUG: 0.0 obok::action_err.py - loading translations
[1.34] main UI initialized...
[1.34] Hiding splash screen
Starting QuickView
[15.26] splash screen hidden
[15.26] Started up in 15.26 seconds with 466 books

Running Obok DeDRM v7.1.0
DEBUG: 115.8 didn't find device
Obok v4.0.0
Copyright © 2012-2020 Physisticated et al.
C:\Users\lkmil\AppData\Local\Temp\tmplh2o32_f
DEBUG: 115.8 got kobodir C:\Users\lkmil\AppData\Local\Kobo\Kobo Desktop Edition
Found 12 possible keys to try.
DEBUG: 123.8 BookListTableWidget:get_books - book_num: 16
DEBUG: 123.8 BookListTableWidget:get_books - book: Startide Rising
DEBUG: 123.8 InterfacePluginAction::launchObok - number of books to decrypt: 1
Obok DeDRM v7.1.0 - Decrypting Startide Rising
Trying key: b'ab06789b6af0ae138b2ec29f1362e711'
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Success!
DEBUG: 124.2 DecryptAddProgressDialog::do_book_action - decrypted book: 'Startide Rising'
Obok DeDRM v7.1.0 - Added Startide Rising
Obok DeDRM v7.1.0 - wrapping up results.

@ableeker
Copy link
Contributor

ableeker commented Jul 3, 2021

@ElleKayEm I see what you mean, so the answer to that would be, "Not really, no... ", it just doesn't find the right key. Is it working with this version?

Obok_plugin.zip

@ElleKayEm
Copy link

@ableeker Yes, that works! Whereas regular 7.2.1 only finds 4 possible keys and it doesn't work. 7.1.0 found 12 and it worked. This finds 16. Here's the log:

calibre 5.22.1 [64bit] embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && Count Pages (1, 11, 0) && EpubMerge (2, 11, 0) && EpubSplit (3, 1, 0) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0) && KindleUnpack - The Plugin (0, 83, 0) && Obok DeDRM (7, 2, 1)
calibre 5.22.1 [64bit] embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && Count Pages (1, 11, 0) && EpubMerge (2, 11, 0) && EpubSplit (3, 1, 0) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0) && KindleUnpack - The Plugin (0, 83, 0) && Obok DeDRM (7, 2, 1)
Turning on automatic hidpi scaling
devicePixelRatio: 3.0
logicalDpi: 96.0 x 96.0
physicalDpi: 94.51162790697674 x 94.75647668393782
Using calibre Qt style: True
[0.00] Starting up...
[0.00] Showing splash screen...
[0.47] splash screen shown
[0.47] Initializing db...
[0.48] db initialized
[0.48] Constructing main UI...
DEBUG: 0.0 obok::utilities.py - loading translations
DEBUG: 0.0 obok::dialogs.py - loading translations
DEBUG: 0.0 obok::config.py - loading translations
DEBUG: 0.0 obok::action_err.py - loading translations
[1.11] main UI initialized...
[1.11] Hiding splash screen
Starting QuickView
[16.95] splash screen hidden
[16.95] Started up in 16.95 seconds with 467 books
Running Obok DeDRM v7.2.1
DEBUG: 43.7 didn't find device
Obok v4.0.0
Copyright © 2012-2020 Physisticated et al.
C:\Users\lkmil\AppData\Local\Temp\tmpwueln4q4
DEBUG: 43.8 got kobodir C:\Users\lkmil\AppData\Local\Kobo\Kobo Desktop Edition
Found 16 possible keys to try.
DEBUG: 65.6 BookListTableWidget:get_books - book_num: 16
DEBUG: 65.6 BookListTableWidget:get_books - book: Startide Rising
DEBUG: 65.6 InterfacePluginAction::launchObok - number of books to decrypt: 1
Obok DeDRM v7.2.1 - Decrypting Startide Rising
Trying key: b'ab06789b6af0ae138b2ec29f1362e711'
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Checking text:b'<?xml vers':
Perhaps utf-8 without BOM
Seems to be good text
Success!
DEBUG: 65.9 DecryptAddProgressDialog::do_book_action - decrypted book: 'Startide Rising'
Obok DeDRM v7.2.1 - Added Startide Rising
Obok DeDRM v7.2.1 - wrapping up results.

@journeyman88
Copy link
Contributor

@ableeker Yes, that works! Whereas regular 7.2.1 only finds 4 possible keys and it doesn't work. 7.1.0 found 12 and it worked. This finds 16.

As with the 7.2.1 includes one of my commits that is necessary to have obok work on some machine, but introduces a regression on others; in the current pull list there's a fix for this regression that uses both methods (pre 7.2.1 as standard and post 7.2.1 as fail-over) to retrieve the keys.

Can you check if that resolves the issue?

@ableeker
Copy link
Contributor

ableeker commented Jul 5, 2021

That's most likely what happened here. I had noticed that there has been only one change, this changes the way the plugin tries to find the MAC-address of the PC that's needed as part of the decryption. So my version just reverses this method change, and uses the old method. Both methods work on my PC, but that's not the case with all PC's, as @ElleKayEm has found out. So both methods by themselves will not work on all PC's. But fortunately @journeyman88 has submitted pull request #1691 that solves this problem by trying both methods. I've implemented this fix in this version, is it working?

Obok_plugin.zip

@ElleKayEm
Copy link

Yes, that works for me.

@kirtr
Copy link

kirtr commented Sep 14, 2021

Your patch resolved my issue as well. I mentioned my success in your merge request, @ableeker. Thank you!

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

6 participants