Skip to content

Ken-B/ebook-freedom

Repository files navigation

Ebook Freedom

Live app →

Built entirely by AI using Claude Code.

A fully client-side web application for removing DRM from ebooks you own. Your files never leave your browser — all processing happens locally.

What it does

Removes DRM from:

Format Platform Key needed
.azw, .azw3, .mobi Amazon Kindle Device serial number
.epub (Adobe ADEPT) Adobe Digital Editions .der key file
.pdf (Adobe ADEPT) Adobe Digital Editions .der key file
.epub (Kobo) Kobo e-readers Device serial number

Usage

  1. Open the live app or serve locally with npx serve .
  2. Drop your ebook file onto the drop zone (or click to browse)
  3. Enter the key for your platform (see below)
  4. Click Remove DRM
  5. Download your DRM-free ebook

Where to find your key

Kindle AZW / AZW3

The device serial number is required. It can be found:

  • On the device: Settings → Device Options → Device Info → Serial Number
  • On the back label of older Kindle models (starts with B00 or G000)
  • Amazon account: manage.amazon.com → Devices → select your Kindle

Adobe Digital Editions (ePub / PDF)

You need your Adobe account activation key exported as a .der file:

  1. Install Adobe Digital Editions
  2. Authorize your computer with your Adobe ID (Help → Authorize Computer)
  3. Use DeDRM Toolsadobekey.py to export your activation key as adobe_account_key.der

Kobo ePub

The device serial number is required:

  • On the device: Settings → About → Serial Number (13–16 character alphanumeric code)
  • Typically starts with N, E, or a digit followed by numbers/letters

Technical overview

Architecture

index.html          — Single-page application shell
js/
  app.js            — UI orchestration, drag-and-drop, format detection
  kindle.js         — Kindle AZW/AZW3 DRM removal (PC1 cipher, PID derivation)
  adobe.js          — Adobe ADEPT ePub/PDF DRM removal (RSA + AES-128-CBC)
  kobo.js           — Kobo ePub DRM removal (PBKDF2 key derivation + AES)
  crypto.js         — Shared crypto primitives (Web Crypto API)
  utils.js          — Shared utilities (format detection, ZIP helper, encoding)
  worker.js         — Web Worker for off-main-thread processing (optional)
css/
  style.css         — Responsive CSS with dark mode support
tests/
  unit/             — Vitest unit tests
  e2e/              — Playwright end-to-end tests

Kindle DRM

  • Derives an 8-character PID from the device serial using CRC32-based algorithm
  • Each DRM voucher in the MOBI file contains the book key encrypted with PC1 cipher
  • Content records are decrypted with PC1 using the recovered book key

Adobe ADEPT DRM

  • The ePub ZIP contains META-INF/rights.xml with an AES content key encrypted via RSA PKCS#1 v1.5 with the user's account public key
  • Content files are encrypted with AES-128-CBC (IV = first 16 bytes)
  • We decrypt the session key with the user's private key (.der file) then decrypt each content resource

Kobo DRM

  • Uses the same ZIP/ePub structure as Adobe ADEPT
  • Session key is encrypted with AES-128-ECB using a device key derived via PBKDF2-SHA1 (password = device serial, salt = "Kobo Inc.", iterations = 1000)

Cryptographic primitives

All crypto uses the Web Crypto API (crypto.subtle). The only exception is RSA PKCS#1 v1.5 decryption, which Web Crypto doesn't support for decrypt operations (only signing), so it's implemented with BigInt modular exponentiation.

Development

npm install            # install dev dependencies
npm test               # run all unit tests
npm run test:unit      # unit tests only (Vitest)
npm run test:e2e       # end-to-end tests (Playwright)
npm run fixtures       # regenerate test fixtures

Running locally

npx serve . -p 8080
# then open http://localhost:8080

Browser compatibility

Browser Version Notes
Chrome / Edge 80+ Full support
Firefox 78+ Full support
Safari 15+ Full support
Safari 14 No module worker (falls back to main thread)

Requires: ES modules, Web Crypto API, JSZip (loaded from CDN).

Legal notice

This tool is intended for personal use to exercise your legal right to make backup copies of ebooks you own. Laws regarding DRM circumvention vary by jurisdiction. In Belgium and other EU countries, the private copy exception may allow circumvention for personal backup purposes. You are responsible for ensuring your use complies with the laws in your jurisdiction.

The authors of this software do not condone copyright infringement.

License

MIT License — Copyright (c) 2024 ebook-freedom contributors. See LICENSE for details.

About

Remove DRM from your legally-owned ebooks (Adobe, Kindle, Kobo). Built entirely by AI using Claude Code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors