Giter Club home page Giter Club logo

lcp-decrypt's Introduction

lcp-decrypt - a quick&dirty tool to remove LCP/CARE DRMs

lcp-decrypt takes an ePUB file protected with a Readium LCP protection (sometimes also called CARE) and decrypts it into a regular ePUB file. The decryption requires the LCP user key. The retrieval of the key is not handled by this program, in other words, lcp-decrypt does not crack any DRM. It only makes a DRMed ePUB you already have legitimate access to usable on any ePUB compatible reader.

Building lcp-decrypt

Until binaries are provided, you need to compile the tool yourself by running

go build -o lcp-decrypt .

Running lcp-decrypt

Once you have your user key (as a hex encoded string), getting a decoded ePUB is as simple as running

# decrypts ebook_with_drm.epub into ebook_without_drm.epub
lcp-decrypt -userKey 012345 ebook_with_drm.epub ebook_without_drm.epub

Retrieving the LCP user key

The process to retrieve the user key depends on how you officially access the ebook you purchased.

Vivlio Reader

I must give credits to Vivlio for providing a Linux version of their reader. The reader is an Electron application, which means it's easy to tell it to forward all requests through mitmproxy. Assuming mitmproxy is running on port 8080, run ./Vivlio-3.3.0.AppImage --proxy-server=127.0.0.1:8080. Log into your ebook reseller through the app and open the book. There should be one request in the mitmproxy console that looks like this:

GET https://api.your-book-store.com/v1/lcp/keys/user?device_id=XXX

and the response should look like

[{"user_key": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}]

The 0123... string is the value you should pass to the -userKey command line flag.

Limitations

As mentioned above, this is a quick&dirty tool. The ePUB parsing was tested on the one file I have access to, and I only checked that the resulting ePUB worked in Calibre and on a Kindle. Bug reports and contributions are welcome.

lcp-decrypt's People

Contributors

abustany avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.