mobidrm — Utility for decryption and encryption of MOBI format ebook files.
Contents
Copyright
Copyright (C) 2021-2022 Bartek Fabiszewski.
Released under LGPL version 3 or any later (same as libmobi).
Description
The program encrypts or decrypts MOBI files with DRM schemes used on eInk devices. It is powered by
libmobi library.
It may encrypt documents targeting particular device by using its serial number or applying generic DRM
scheme targeting all supported readers.
Optionally encryption may be valid only during chosen period. Kindles require both start and end date to
be set. This tool allows one to specify only one date (start or end). In such case the other date will
be automatically set to respectively lowest (1970-01-01) or largest (10136-02-16) valid value.
In case of hybrid files mobidrm separately encrypts both enclosed parts and produces two files: mobi for
legacy format and azw3 for KF8 format.
The program also decrypts documents. One must supply device serial number or document PID if DRM was
applied for specific device.
Invoked without arguments prints usage summary and exits.
A list of flags and their descriptions.
Decryptionflags:
-d Decrypt. This flag must be set in order to decrypt document.
-ppid Set optional decryption pid (may be specified multiple times).
-sserial
Set optional device serial number (may be specified multiple times).
Encryptionflags:
-e Encrypt. This flag must be set in order to encrypt document.
-fdate Set optional validity period fromdate formatted as yyyy-mm-dd. Document will not be valid
before this date.
-sserial
Set optional device serial number. If not set document will be encrypted with generic reader
key. This flag may be specified multiple times to target multiple devices.
-tdate Set optional validity period todate formatted as yyyy-mm-dd. Document will expire after this
date.
Commonflags:
-odir Save output to dir folder.
-h Show usage summary and exit.
-v Show version and exit.
Diagnostics
For diagnostics libmobi must be configured with --enable-debug option.
Examples
The following command decrypts document using given serial number. Decrypted output will be saved to /tmp
folder.
%mobidrm-d-sB001XXXXXXXXXXXX-o/tmpexample.mobi
The following command decrypts document trying multiple PIDs.
%mobidrm-d-pXXXXXXXXX1-pXXXXXXXXX2example.mobi
The following command encrypts document targeting two devices using their serial numbers. Document will
be readable only on those devices.
%mobidrm-e-sB001XXXXXXXXXX01-sB001XXXXXXXXXX02example.mobi
The following command encrypts document for device with given serial number. Document will only be valid
within given period (inclusive).
%mobidrm-e-sB001XXXXXXXXXX01-f2021-01-01-t2021-01-31example.mobiName
mobidrm — Utility for decryption and encryption of MOBI format ebook files.
Return Values
The mobidrm utility returns 0 on success, 1 on error.
See Also
mobimeta(1) mobitool(1) Unix February 16, 2022 mobidrm(1)
Synopsis
mobidrm-d [-odir] [-ppid] [-sserial] filemobidrm-e [-odir] [-sserial] [-fdate] [-tdate] filemobidrm [-hv]
Web Site
Visit http://www.fabiszewski.net for details.
