Bump the `rand` dev-dependency to the latest (0.10), which exposes rand_core
0.10, while the latest `rsa` (0.9) still requires an rand_core 0.6 RNG for key
generation. Bridge the skew with a small, test-only adapter instead of pinning
rand back.
* Add `rand_core_06 = { package = "rand_core", version = "0.6" }` so the shim
can implement the old traits (cargo unifies it with the rand_core 0.6 that
rsa already uses).
* `RandCompat<R>` wraps a modern RNG and re-implements rand_core 0.6's RngCore
+ CryptoRng over it, delegating to rand_core 0.10's infallible methods.
Implementing both satisfies rand_core 0.6's blanket CryptoRngCore impl, which
is exactly the bound rsa keygen requires.
* The CryptoRng bound is preserved (only wraps RNGs still marked
cryptographically secure), so the randomness is not weakened — it is purely a
trait-version shim. Tests now use `RandCompat(rand::rng())`.
46 tests pass (incl. the RSA-based EPUB roundtrips that exercise the shim);
clippy + rustfmt clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
DRMLibre
A standalone, single-binary command-line tool (written in Rust, no runtime dependencies) for removing DRM from Amazon Kindle and Adobe Digital Editions ebooks. The decryption logic is ported from DeDRM_tools; DRMLibre is therefore licensed GPL-3.0-or-later. See CREDITS.md.
Use DRMLibre only on books you own, to exercise your own rights (format shifting, backup, accessibility). Respect the law in your jurisdiction.
Status
Under active development. Supported / planned formats:
| Capability | Status |
|---|---|
| Adobe ADEPT EPUB (+ hardening, B&N PassHash, font de-obfuscation) | ✅ done |
| Kindle MOBI / AZW / AZW3 | ✅ done |
| Adobe key auto-extraction from installed ADE (Windows, DPAPI) | ✅ done |
Kindle-for-PC key (.kinf) / Android / macOS auto-extraction |
planned |
| Kindle KFX-ZIP | planned |
| Adobe PDF, Kindle Topaz, eReader, Kobo, LCP | out of scope |
On Windows with Adobe Digital Editions activated, ADEPT EPUBs decrypt with no extra arguments — the key is extracted from the local install and cached in the config for later offline use.
Usage
drmlibre remove <files...> [options] # remove DRM
drmlibre passhash ... # generate/extract Adobe/B&N PassHashes
drmlibre config # summarize keys in the config file
Common remove options: -o/--output, --outputdir, -f/--force,
--overwrite, --serial, --pid, --key, --passphrase, --android-backup,
--config (default ./drmlibre.toml).
Examples:
# Adobe EPUB, using an exported Adobe key:
drmlibre remove "My Book.epub" --key adobe.der -o "My Book (no DRM).epub"
# Kindle eInk book, using the device serial:
drmlibre remove "My Book.azw" --serial 0123456789ABCDEF
Architecture
A Cargo workspace:
crates/drmlibre-core— the UI-agnostic engine (format detection, key management, decryptors). No printing or process exits; everything is aResultand progress goes throughtracing. This is what a future GUI links.crates/drmlibre-cli— thedrmlibrebinary (argument parsing, file I/O policy, exit codes).
Building
cargo build --release # binary at target/release/drmlibre
cargo test # run the test suite