summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorAdrien Bustany <adrien@bustany.org>2022-05-31 23:34:54 +0200
committerAdrien Bustany <adrien@bustany.org>2022-05-31 23:34:54 +0200
commit2ecc51bd2edc47938432168572e6567f7a0c2abd (patch)
tree2b0b16a4f10170a0ce7120d97deff54f9a3f9a69 /README.md
parentRoot commit (diff)
downloadlcp-decrypt-2ecc51bd2edc47938432168572e6567f7a0c2abd.tar
lcp-decrypt-2ecc51bd2edc47938432168572e6567f7a0c2abd.tar.gz
lcp-decrypt-2ecc51bd2edc47938432168572e6567f7a0c2abd.tar.bz2
lcp-decrypt-2ecc51bd2edc47938432168572e6567f7a0c2abd.tar.lz
lcp-decrypt-2ecc51bd2edc47938432168572e6567f7a0c2abd.tar.xz
lcp-decrypt-2ecc51bd2edc47938432168572e6567f7a0c2abd.tar.zst
lcp-decrypt-2ecc51bd2edc47938432168572e6567f7a0c2abd.zip
Diffstat (limited to 'README.md')
-rw-r--r--README.md59
1 files changed, 59 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0c3045e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,59 @@
+# 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](https://mitmproxy.org/). 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.