11-24-2021, 05:52 AM | #46 | ||
Junior Member
Posts: 6
Karma: 10
Join Date: Nov 2021
Device: tolino epos
|
The mentioned book can only be downloaded next month so I took the previous version and got the same result:
Quote:
As I dont know, which private information are coded in the URLlink.acsm file I send it via a PM as well as the diff information. The libgourou version I use is: Quote:
|
||
11-27-2021, 04:35 AM | #47 |
Member
Posts: 21
Karma: 107532
Join Date: Jul 2021
Location: France
Device: Cybook Odyssey
|
Fixed in v0.4.3. Thanks for your report
|
Advert | |
|
12-03-2021, 08:02 PM | #48 |
Enthusiast
Posts: 48
Karma: 12654
Join Date: Dec 2009
Location: UK
Device: Likebook Ares, Kindle 3G, Nook STR, 511eb
|
Here's one which doesn't work. https://archive.org/details/informationwarfa00denn
I logged in to the Internet Archive, borrowed the book for 14 days, ran acsmdownloader v0.4.4 The process took ages and didn't show any errors, when I tried to open the PDF, my reader asked me for a password. The problem seems to occur with any PDF from https://archive.org/details/books?and[]=year%3A%222015%22&and[]=lending___status%3A%22available_to_borrow%22 - although the ePubs work fine. Thanks for the incredibly helpful tool! |
12-04-2021, 05:12 AM | #49 |
Junior Member
Posts: 6
Karma: 10
Join Date: Nov 2021
Device: tolino epos
|
If you download with acsmdownloader the pdf is DRM encrypted. If you try to open this file with a pdf-reader you will be asked for a password.
Have you tried to open the downloaded pdf file with a Adobe-DRM enabled pdf-Reader? |
12-06-2021, 12:15 PM | #50 | |
Enthusiast
Posts: 48
Karma: 12654
Join Date: Dec 2009
Location: UK
Device: Likebook Ares, Kindle 3G, Nook STR, 511eb
|
Quote:
Are you able to download PDFs from the Internet Archive? |
|
Advert | |
|
12-07-2021, 08:01 AM | #51 |
Junior Member
Posts: 6
Karma: 10
Join Date: Nov 2021
Device: tolino epos
|
Sorry, I have a Tolino epos SW-Version 15.2.0 that has been registered to Adobe DRM. As I normally use this tablet offline, I copy the downloaded pdf file into directory "Books", when the Tolino is connected via USB to my Linux Notebook. After disconnecting the USB port, the Tolino finds the new loaded books and the pdf file can be read.
I did not made an intensive google search for DRM enabled PDF readers on Linux. But I know that there is the possibility to run Adobe ADE (a Windows Program) under Linux using wine. I've heard about the possibility to use Calibre but have no experience/knowledge about that. |
12-20-2021, 02:46 AM | #52 |
Member
Posts: 21
Karma: 107532
Join Date: Jul 2021
Location: France
Device: Cybook Odyssey
|
Hello all,
I released a new version (v0.5) that (mainly) supports anonymous accounts and add a DRM removal utility. Hope you'll enjoy it ! All is available at http://indefero.soutade.fr/p/libgourou/ |
12-20-2021, 03:40 PM | #53 |
Groupie
Posts: 182
Karma: 2010542
Join Date: Sep 2021
Device: PB Era, PB InkPad 3 Pro
|
I haven't tested it yet, but looking at the code this seems to have the same bug as https://github.com/apprenticeharper/...ls/issues/1828 :
When parsing the encryption.xml, you need to manually check for each entry if that's related to AdobeDRM or if that's something else (like font data). And after decryption, you should only delete the AdobeDRM entries from the encryption.xml, and only delete the whole file from the EPUB if it's empty (no other entries that aren't DRM). Otherwise this breaks embedded obfuscated fonts (which are also included in the encryption.xml). |
12-21-2021, 02:55 AM | #54 |
Member
Posts: 21
Karma: 107532
Join Date: Jul 2021
Location: France
Device: Cybook Odyssey
|
Thanks Leseratte. I was not aware about that kind of encryption. I'll update my code to check encryption algorithm value.
|
12-30-2021, 03:23 PM | #55 |
Junior Member
Posts: 4
Karma: 10
Join Date: Dec 2019
Device: Kobo Aura H2O Edition 1
|
|
01-04-2022, 02:30 PM | #56 |
Member
Posts: 21
Karma: 107532
Join Date: Jul 2021
Location: France
Device: Cybook Odyssey
|
Oups... Fixed in v0.5.1.
|
02-04-2022, 02:45 PM | #57 |
Junior Member
Posts: 2
Karma: 10
Join Date: Feb 2022
Device: none
|
Grégory, first of thanks for libgourou.
I tried using removal util on a book I bought from an ADB-backed store provided by vendor called "inkBOOK" (Arta Tech) but unfortunately without success. I used XML files found inside .adobe-digital-editions and the encrypted epub that got stored by the app inside Books dir of my Android phone. The removal util exited with Segmentation fault so I decided to investigate further by looking at your code and trying to mimic the process with OpenSSL CLI. I base64-decoded the privateLicenseKey from activation.xml and verified it was in fact a valid RSA private key: Code:
> openssl asn1parse -inform DER -in private-license-key.bin 0:d=0 hl=4 l= 630 cons: SEQUENCE 4:d=1 hl=2 l= 1 prim: INTEGER :00 7:d=1 hl=2 l= 13 cons: SEQUENCE 9:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption 20:d=2 hl=2 l= 0 prim: NULL 22:d=1 hl=4 l= 608 prim: OCTET STRING [HEX DUMP]: ... Code:
> openssl rsautl -decrypt -in rightsEncryptedKey.bin -out plain.txt-inkey private-lincense-key.pem -raw RSA operation error 140109553796480:error:0406506C:rsa routines:rsa_ossl_private_decrypt:data greater than mod len:crypto/rsa/rsa_ossl.c:400: 2. libgourou uses RSA_NO_PADDING when decrypting, so I used -raw switch. I tried other paddings also but without success. Since nothing worked for me, I decided to look at DeDRM decrpytion procedure, specifically decryptBook method inside ineptepub.py. There I found this: Code:
if len(bookkey) != 172: print("{0:s} is not a secure Adobe Adept ePub.".format(os.path.basename(inpath))) return 1 Which finally brings me to my questions: - is 172 chars also the length that libgourou implicitly assumes? - do you have any ideas on what else I could throw at openssl to try decrypting the encryptedKey? FYI, from what I can gather the Android app uses v12.5.2 of the librmsdk lib behind the scenes. P.S.: You may want to introduce a new enum (CLIENT_INVALID_PKCS8) here instead of re-using CLIENT_INVALID_PKCS12: Code:
PKCS8_PRIV_KEY_INFO* p8inf = d2i_PKCS8_PRIV_KEY_INFO_bio(mem, NULL); if (!p8inf) EXCEPTION(gourou::CLIENT_INVALID_PKCS12, ERR_error_string(ERR_get_error(), NULL)); |
02-08-2022, 03:10 AM | #58 |
Member
Posts: 21
Karma: 107532
Join Date: Jul 2021
Location: France
Device: Cybook Odyssey
|
Hello,
Can you give me a stack trace of segfault ? |
02-08-2022, 01:43 PM | #59 |
Junior Member
Posts: 2
Karma: 10
Join Date: Feb 2022
Device: none
|
Sorry, it was acsmdownloader that caused segfault:
Code:
PID: 101119 (acsmdownloader) UID: 1000 (geca) GID: 1000 (geca) Signal: 11 (SEGV) Timestamp: Tue 2022-02-08 18:28:22 GMT (10min ago) Command Line: ./utils/acsmdownloader -k /home/geca/code/adobe-drm/salt -a /home/geca/code/adobe-drm/activation.xml -d /home/geca/code/adobe-drm/device.xml -f /home/geca/code/adobe-drm/tonoc.acsm Executable: /home/geca/code/libgourou/utils/acsmdownloader Control Group: /user.slice/user-1000.slice/session-2.scope Unit: session-2.scope Slice: user-1000.slice Session: 2 Owner UID: 1000 (geca) Boot ID: b1423d57dfb8482cad49d8174b680389 Machine ID: 392ca35aec644e57b2fd49674fbfceed Hostname: oropat Storage: /var/lib/systemd/coredump/core.acsmdownloader.1000.b1423d57dfb8482cad49d8174b680389.101119.1644344902000000.zst (present) Disk Size: 408.1K Message: Process 101119 (acsmdownloader) of user 1000 dumped core. Module /home/geca/code/libgourou/utils/acsmdownloader with build-id 9f55955dfc2ff2fec2cc13a0fe4a6f54d145cef3 Module /home/geca/code/libgourou/libgourou.so with build-id 792dc8daa95fe5793a92b6ed56b399de70200910 Module linux-vdso.so.1 with build-id e4928c61148e651d67ca59cd11805e39c611af66 Module libffi.so.8 with build-id f90d8b734f6de9b25faedb8cbfab7054dafc0a42 Module libgpg-error.so.0 with build-id 3801187d42c4955bd93c605451430cdf1b164e63 Module libgmp.so.10 with build-id e58d34ab389d1b649c24195c2d145e3ff2e58290 Module libhogweed.so.6 with build-id 2d70cff7b1841b4d9ca4e8e7726cd4b944c07fdc Module libtasn1.so.6 with build-id ee3429ca5e94718aea4fe5249fc859e0cd88e4e9 Module libunistring.so.2 with build-id 015ac6d6bcb60b7d8bea31a80d1941b06e8636ab Module libidn2.so.0 with build-id 1ce2b50ad9f9821c2c629b521cf5a3c99593d332 Module libp11-kit.so.0 with build-id f97c44b297b54185bbe3eb6ed6dab5d8967f1532 Module libpcre.so.1 with build-id 845483dd0acba86de9f0313102bebbaf3ce52767 Module libicudata.so.70 with build-id e1dcc2a88cfaafed882d09c90c668af0eed4efed Module libgcrypt.so.20 with build-id db45f5d5e0f7af1e77324fea1885f974619ad268 Module libcap.so.2 with build-id f56c6cd6ad4d35053340d7ff2f8f954498796739 Module liblz4.so.1 with build-id e63600ab23b2f6997f42fac2fa56e1f02ce159a1 Module librt.so.1 with build-id 75484da2d6f1515189eefa076e0a40328834cd16 Module libresolv.so.2 with build-id c915c72668282861a813f7ea3c0780f37b681dc0 Module libkeyutils.so.1 with build-id ac405ddd17be10ce538da3211415ee50c8f8df79 Module libkrb5support.so.0 with build-id adf65240a4d2aba772d7a0772b4d015469934113 Module libcom_err.so.2 with build-id be99503e12b86d78d6ede2f0d1ffb66408a37576 Module libk5crypto.so.3 with build-id eb8220b8f36675aac769450be4cb6bb7f97ec38a Module libkrb5.so.3 with build-id 72d26767c5cb1097db75a5f5bff88860233c902b Module libnettle.so.8 with build-id 9a878e513c02007598fcf1e2e286c2203f13536e Module libgnutls.so.30 with build-id 8c87466eacaec0041a370df713d0fd200358c94c Module liblzma.so.5 with build-id 8b615460aa230708c5183f16bede67aa0437d95e Module libbz2.so.1.0 with build-id 919597c477c9b2cb9cdbb7745ed6494ac0e6da60 Module ld-linux-x86-64.so.2 with build-id 040cc3dd10461562f177df39e3be2f3704258c3c Module libglib-2.0.so.0 with build-id 220436a4e27f39372710df014d2517c0387eefa4 Module libzstd.so.1 with build-id 6214183688018e3fba6d66db10c2c8d0b45e0578 Module libpcre2-16.so.0 with build-id 195fbccafbcff538ce13805ba687514fb614c5ed Module libicuuc.so.70 with build-id 2e245c2bf12f95fd8ab79b3a4be99524677cbd70 Module libicui18n.so.70 with build-id 95af755fca990df26753a7d720b8e3ae24270e42 Module libdouble-conversion.so.3 with build-id d162eb67b00f523a3f146b1077ae00fe04d5fb85 Module libsystemd.so.0 with build-id 69dfd360ef432adc8911dd446411765f1922fb48 Module libssl.so.1.1 with build-id 1024424ab33a3767da03f4fdb1fc1b02479f160f Module libgssapi_krb5.so.2 with build-id e6e098ad51ce7bdd3dbe902d7b0f69a90f8a9e08 Module libdl.so.2 with build-id 5abc547e7b0949f89f3c0e21ab0c8331a7440a8a Module libpthread.so.0 with build-id 07c8f95b4f3251d08550217ad8a1f31066229996 Module libc.so.6 with build-id 4b406737057708c0e4c642345a703c47a61c73dc Module libgcc_s.so.1 with build-id 7f8508bb914546ada778809b64b99d234337d835 Module libm.so.6 with build-id 2b8fd1f869ecab4e0b55e92f2f151897f6818acf Module libstdc++.so.6 with build-id 9b5eeeb149bf3c4efe787fb398b44f00507aec87 Module libz.so.1 with build-id 0c1459c56513efd5d53eb3868290e9afee6a6a26 Module libzip.so.5 with build-id 68e333db519fa50980d49c7b5747320e87196bd1 Module libcrypto.so.1.1 with build-id 4c926b672d97886b123e03a008387aecf0786de4 Module libQt5Core.so.5 with build-id a6903ae93931b07f9214357aac2905372a406c16 Module libQt5Network.so.5 with build-id 5d5febbf1fc5bc522602a1f1751a9931fc05b78e Stack trace of thread 101120: #0 0x00007fa6db10ac30 EVP_PKEY_get0_RSA (libcrypto.so.1.1 + 0x176c30) #1 0x00007fa6db10ac88 EVP_PKEY_get1_RSA (libcrypto.so.1.1 + 0x176c88) #2 0x0000562bcf9691f3 n/a (/home/geca/code/libgourou/utils/acsmdownloader + 0xb1f3) #3 0xaa1ecea45dda5716 n/a (n/a + 0x0) ELF object binary architecture: AMD x86-64 Code:
Exception code : 0x5004 Message : error:0406506C:rsa routines:rsa_ossl_private_decrypt:data greater than mod len |
02-09-2022, 03:38 AM | #60 |
Groupie
Posts: 182
Karma: 2010542
Join Date: Sep 2021
Device: PB Era, PB InkPad 3 Pro
|
An encrypted book key of 192 characters means the book is encrypted with the new variant of Adobe's DRM.
In 2014 Adobe introduced a new version of their DRM because the old one is so easy to crack. It didn't gain much popularity (because, well, all eReaders would need to be updated to support it), but it looks like some vendors have recently switched to that new version. There is no known public method to remove DRM from these books. One would need to reverse-engineer RMSDK to figure out how this new DRM works. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ADE in linux w/ WINE - sucess recogonizing device | thersites | PocketBook | 6 | 07-19-2024 10:19 AM |
Linux Users: Is Wine + ADE/K4PC still working for you? | latepaul | Amazon Kindle | 7 | 10-04-2021 12:45 PM |
PRS-500 PRS 500 (updated) + ADE + Linux | brontus | Sony Reader | 6 | 08-11-2011 12:33 AM |
ADE under Linux (Wine), PB360 not recognized | rogue_librarian | PocketBook | 2 | 12-02-2010 06:12 PM |
Calibre on Linux, ADE on Windows/WINE - how do I manage? | Beetle B. | Calibre | 4 | 11-28-2010 03:35 PM |