3

I am creating an ePub Reader App. Currently, the app can render the ePub file from local storage. But my intention is not to render the open (unencrypted) epub file but rather the encrypted one.

What my app basically wants to do is

  • download the epub file from a server through the app
  • then encrypt the epub file before storing on the mobile storage
  • render the encrypted epub file on the app

I want to implement the feature similar to youtube offline videos in my ebook app. As we know youtube stores the offline videos as encrypted exo files and displays them only through the youtube app. I want the downloaded epub files to be displayed only on our app but nothing else.

Is it possible to encrypt the epub file as a whole or if possible as separate encrypted files like youtube?

My main question is how to encrypt and display the encrypted epub file in the app.

PS. I am using react-native for app development

Sagaryal
  • 415
  • 4
  • 15

3 Answers3

0

Conceal library from Facebook will help you to encrypt and decrypt different types of file.

And this epub Reader lib might help you to render epub. I have never tried it. And several epub reader libs are available readily.

VishnuSP
  • 599
  • 5
  • 16
  • Thankyou for the answer but can you suggest compatible with react-native library? Actually I am using react-native. Thankyou – Sagaryal Dec 21 '17 at 09:30
  • Sorry, I haven't used react native yet. As react native and conceal are from Facebook there might be some way to make it compatible. I request you to update the tag for your question with *react native* to get better solutions. – VishnuSP Dec 21 '17 at 09:37
0

Encode Files using ChiperInputStream

0

Here is what you can do

1.Download and save file to root folder .

2.After downloading extract the epub file and delete the original file .

3.get the html content required from the files , encrypt the html data and store it in sqlite database .

4.Delete those files from folder .

Manohar
  • 22,116
  • 9
  • 108
  • 144
  • wouldn't that jeopardize the epub format? and after storing in sqlite, can it still be displayed as epub file? – Sagaryal Dec 21 '17 at 09:50
  • epub files contain mostly html data , you just want to get that data out and encrypt , store it . – Manohar Dec 21 '17 at 09:55