Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 12-04-2017, 05:43 AM   #16
mehmedbasic
Junior Member
mehmedbasic began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2017
Device: Sony PRS T2
In march 2015 I managed to figure out the key and iv for the spkgi format.

I released it on bitbucket as an Xposed module:
REMOVED

Base64 encoded versions:
REMOVED

The ereolen app is in Java and uses the cipher "AES/CBC/PKCS5Padding".
This may or may not work on windows/linux versions of Java - I haven't looked into it a couple of years.

I've ported it as a commandline app, and it may or may not work, I don't actually have encrypted files to test with. This can be found here:
REMOVED

Feel free to send me an email if you find any bugs.
Enjoy!

Last edited by mehmedbasic; 01-02-2018 at 09:32 AM.
mehmedbasic is offline  
Old 12-08-2017, 10:58 AM   #17
Nightcalib
Junior Member
Nightcalib began at the beginning.
 
Nightcalib's Avatar
 
Posts: 9
Karma: 10
Join Date: Nov 2013
Device: none
Smile

Hey mehmedbasic, thanks for replying after so long, really awesome and also very suprising.

I would looove to try your app it but unfortunately my phone isn't rooted so can't install the xposed framework. Also, it seems ereolen has switched to exclusively using java in the browser to display the ebooks, so there is no offline storage of the .spkgi files.

When I get my phone rooted I will try it, but unfortunately I don't know when that will be.

Once again, awesome that you found a way to decrypt the files.
Nightcalib is offline  
Old 12-11-2017, 02:43 AM   #18
mehmedbasic
Junior Member
mehmedbasic began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2017
Device: Sony PRS T2
Thanks for the nice words.

For the rooted device: You can install eReolen in an Android emulator and you will be able to root it and extract all the files.

In the browser it seems to be the same JavaScript reader as in the app, although the browser is streaming from an online location. It is a streaming reader from pubhub.dk. I poked around a little, if you look into the developer view in your browser you will see a couple of calls to pubub.dk/publicstreaming/v3/{session}/{bookid}/{packageNumber}?callback={callbackId}.

If you just change the packageNumber in a loop, you will be able to get the entire book in clear, unencrypted text.
mehmedbasic is offline  
Old 12-27-2017, 06:34 AM   #19
0rsted
Junior Member
0rsted began at the beginning.
 
Posts: 5
Karma: 12
Join Date: Oct 2013
Device: Kindle
This is absolutely brilliant mehmedbasic

I am getting an error though,

Quote:
SPKGI decrypt0r - (c) 2017 Jesenko Mehmedbasic
----------------------------------------------
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.simontuffs.onejar.Boot.run(Boot.java:313)
at com.simontuffs.onejar.Boot.main(Boot.java:161)
Caused by: java.lang.IllegalStateException: java.security.InvalidKeyException: Illegal key size
at com.mobileread.spkgidecrypt.EreolenDecryptingOutpu tStream.createCipher(EreolenDecryptingOutputStream .java:43)
at com.mobileread.spkgidecrypt.EreolenDecryptingOutpu tStream.<init>(EreolenDecryptingOutputStream.java: 23)
at com.mobileread.spkgidecrypt.Application.convert(Ap plication.java:132)
at com.mobileread.spkgidecrypt.Application.main(Appli cation.java:102)
... 6 more
Caused by: java.security.InvalidKeyException: Illegal key size
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:10 39)
at javax.crypto.Cipher.implInit(Cipher.java:805)
at javax.crypto.Cipher.chooseProvider(Cipher.java:864 )
at javax.crypto.Cipher.init(Cipher.java:1396)
at javax.crypto.Cipher.init(Cipher.java:1327)
at com.mobileread.spkgidecrypt.EreolenDecryptingOutpu tStream.createCipher(EreolenDecryptingOutputStream .java:40)
I'm not sure what causes the error, it could be that I'm on a mac, and it doesn't support the same things as linux for android...
0rsted is offline  
Old 12-28-2017, 06:55 AM   #20
mehmedbasic
Junior Member
mehmedbasic began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2017
Device: Sony PRS T2
Are you running oracle java 8 or openjdk?

Edit: It seems you need to run Java 9.

Last edited by mehmedbasic; 12-28-2017 at 07:36 AM.
mehmedbasic is offline  
Old 12-30-2017, 08:52 AM   #21
Nightcalib
Junior Member
Nightcalib began at the beginning.
 
Nightcalib's Avatar
 
Posts: 9
Karma: 10
Join Date: Nov 2013
Device: none
Thumbs up

Quote:
Originally Posted by mehmedbasic View Post
Thanks for the nice words.

For the rooted device: You can install eReolen in an Android emulator and you will be able to root it and extract all the files.

In the browser it seems to be the same JavaScript reader as in the app, although the browser is streaming from an online location. It is a streaming reader from pubhub.dk. I poked around a little, if you look into the developer view in your browser you will see a couple of calls to pubub.dk/publicstreaming/v3/{session}/{bookid}/{packageNumber}?callback={callbackId}.

If you just change the packageNumber in a loop, you will be able to get the entire book in clear, unencrypted text.
Hey mehmedbasic, played around with it a bit and was in fact able to extract the text by changing the packagenumber and pasting the address into the browser. Looking at the source, I was able to get the raw text out, however I was not able to extract it with formatting. Instead it was filled with html formatting code.

I think somebody more knowledgeable about java would easily be able to create a loop and extract the text with correct formatting and images. Unfortunately I am not at that level. I hope somebody out there will look into it. Until then, thanks again for everything. I will look into your android solution once I get hands on a rooted phone.
Nightcalib is offline  
Old 01-02-2018, 09:18 AM   #22
mehmedbasic
Junior Member
mehmedbasic began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2017
Device: Sony PRS T2
Quote:
Originally Posted by Nightcalib View Post
Hey mehmedbasic, played around with it a bit and was in fact able to extract the text by changing the packagenumber and pasting the address into the browser. Looking at the source, I was able to get the raw text out, however I was not able to extract it with formatting. Instead it was filled with html formatting code.
The HTML formatting code is basically the raw EPUB content without metadata and the sort.Try pasting it into a .html file and opening it in your browser.

If that does not work, the web-based reader most certainly has some CSS styles in the header of the page or embedded directly in a style tag. You should be able to extract the stylesheets with little to no problems.
mehmedbasic is offline  
Old 01-02-2018, 09:32 AM   #23
mehmedbasic
Junior Member
mehmedbasic began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2017
Device: Sony PRS T2
I hoped to show the DRM was flawed, but I was not aware of the legal complications that could arise from this. Due to legal considerations I have decided to delete the two repositories listed in this thread.
mehmedbasic is offline  
Old 05-06-2018, 04:38 PM   #24
smb3madness
Junior Member
smb3madness began at the beginning.
 
Posts: 1
Karma: 10
Join Date: May 2018
Device: N/A
Quote:
Originally Posted by mehmedbasic View Post
I hoped to show the DRM was flawed, but I was not aware of the legal complications that could arise from this. Due to legal considerations I have decided to delete the two repositories listed in this thread.
Hey ripdajacker, old buddy!
Would you mind emailing me the removed URLs? I would like to rip a book from the site, but so far I only managed to get the raw text, and compiling it all without tools takes too much time. I'm a Dane and I visited you once when we were teenagers. You also sent me a customized operating system once by mail. I think you might know who I am.
smb3madness is offline  
Old 02-07-2019, 05:00 PM   #25
smsdalleisback
Junior Member
smsdalleisback began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2019
Device: Samsung Galaxy A3 2017
Quote:
Originally Posted by mehmedbasic View Post
The HTML formatting code is basically the raw EPUB content without metadata and the sort.Try pasting it into a .html file and opening it in your browser.
If that does not work, the web-based reader most certainly has some CSS styles in the header of the page or embedded directly in a style tag. You should be able to extract the stylesheets with little to no problems.
Hi. I have tried to look for that specific string in the code, since I also want to extract a book from ereolen, bit I can't seem to find it, the way you to describe it. I'm using Chrome on Win10 if that helps in telling me what I'm? Doing wrong
smsdalleisback is offline  
Old 02-10-2019, 04:11 PM   #26
smsdalleisback
Junior Member
smsdalleisback began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2019
Device: Samsung Galaxy A3 2017
I figured out what I did Wrong.. I went into the code instead of the developer mode as said to do. Then I used excel to update the packagednumber in the web-adress and a macro program to copy the adress into the chrome browser and copy all text and code into notepad and when all 64 packages(chapters) was pastes into notepad I moved it into word and used Replace to remove all unnecessary code between jQuery and <h2> after that cleaned up 2 or 3 more unnecessary types of codes and put it back in notepad saved as html and bum clean nice book and right now Google chrome voice ad on is speaking the book and audacity is recording, so tomorrow afternoon I have the book as audiobook... thanks for the help

Last edited by smsdalleisback; 02-10-2019 at 04:13 PM.
smsdalleisback is offline  
Old 07-14-2019, 05:53 PM   #27
Zhico
Junior Member
Zhico began at the beginning.
 
Posts: 1
Karma: 10
Join Date: May 2017
Device: none
Quote:
Originally Posted by smsdalleisback View Post
I figured out what I did Wrong.. I went into the code instead of the developer mode as said to do. Then I used excel to update the packagednumber in the web-adress and a macro program to copy the adress into the chrome browser and copy all text and code into notepad and when all 64 packages(chapters) was pastes into notepad I moved it into word and used Replace to remove all unnecessary code between jQuery and <h2> after that cleaned up 2 or 3 more unnecessary types of codes and put it back in notepad saved as html and bum clean nice book and right now Google chrome voice ad on is speaking the book and audacity is recording, so tomorrow afternoon I have the book as audiobook... thanks for the help
Hi fellow Dane.

Did you do this in a browser or did you use the program above? The links are gone

Do you mind writing a more detailed tutorial?
Zhico is offline  
Old 08-15-2019, 03:23 AM   #28
J_blueflower
Junior Member
J_blueflower began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2017
Device: moon+
Please PM me a copy of the links.
J_blueflower is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Kindle format vs ePub format is like using a compiler vs winzip? Julius Caesar Workshop 1 09-01-2013 07:34 PM
iPhone Convert epub format to kindle for iPhone format. Is it possible? thecyberphotog Apple Devices 16 03-14-2013 01:04 AM
No 'epub' format shown in Plugboards Format dropdown list kakkalla Library Management 3 06-16-2012 04:23 AM
Ebook in PRC format will not convert to any other format Katelyn Calibre 0 10-01-2010 07:02 PM
Master Format for multi-format eBook Generation? cerement Workshop 43 04-01-2009 12:00 PM


All times are GMT -4. The time now is 06:24 PM.


MobileRead.com is a privately owned, operated and funded community.