On Windows, recover the Adobe ADEPT user key from an installed/activated Adobe Digital Editions and use it automatically, so ADEPT EPUBs decrypt with no --key argument. Ported from adobekey.py: * Build the DPAPI entropy byte-for-byte: system-volume serial number, CPUID leaf-0 vendor (EBX|EDX|ECX) and leaf-1 signature, and the ADE username, packed as ">I12s3s13s". * CryptUnprotectData (DPAPI) recovers the key-encryption-key from the HKCU\Software\Adobe\Adept\Device "key" value, then each per-credential privateLicenseKey under ...\Activation is AES-128-CBC decrypted and the DER RSA key taken from byte 26 onward. Decryption now lazily auto-extracts and retries when no supplied key fits, and newly found keys are written back to the TOML config so later runs are offline. Uses the `windows` (DPAPI/volume info) and `winreg` crates behind cfg(windows); pure-Rust crypto unchanged. Verified end-to-end on a real ADEPT EPUB: the key was extracted from the local ADE and the book decrypted to a valid, DRM-free EPUB (rights.xml and encryption.xml removed, content readable). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
43 lines
995 B
TOML
43 lines
995 B
TOML
[package]
|
|
name = "drmlibre-core"
|
|
description = "DRM-removal engine for Amazon Kindle and Adobe Digital Editions ebooks"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
authors.workspace = true
|
|
|
|
[dependencies]
|
|
thiserror.workspace = true
|
|
tracing.workspace = true
|
|
serde.workspace = true
|
|
toml.workspace = true
|
|
zip.workspace = true
|
|
flate2.workspace = true
|
|
quick-xml.workspace = true
|
|
base64.workspace = true
|
|
hex.workspace = true
|
|
|
|
# Crypto
|
|
rsa.workspace = true
|
|
aes.workspace = true
|
|
cbc.workspace = true
|
|
sha1.workspace = true
|
|
sha2.workspace = true
|
|
md-5.workspace = true
|
|
|
|
# Local key extraction from installed Adobe Digital Editions / Kindle (Windows).
|
|
[target.'cfg(windows)'.dependencies]
|
|
windows = { version = "0.58", features = [
|
|
"Win32_Foundation",
|
|
"Win32_Security_Cryptography",
|
|
"Win32_Storage_FileSystem",
|
|
"Win32_System_Memory",
|
|
] }
|
|
winreg = "0.52"
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|
|
rand = "0.8"
|