Apparently "import_key" only exists in newer versions (as an alias to
"importKey"). "importKey" works in all versions ...
## Fixes on master (not yet released):
-- (None)
\ No newline at end of file
+- Fix a bug introduced with #48 that breaks DeDRM'ing on Calibre 4 (fixes #101).
\ No newline at end of file
if len(bookkey) != 64:
# Normal or "hardened" Adobe ADEPT
- rsakey = RSA.import_key(userkey) # parses the ASN1 structure
+ rsakey = RSA.importKey(userkey) # parses the ASN1 structure
bookkey = base64.b64decode(bookkey)
if int(keytype, 10) > 2:
bookkey = removeHardening(rights, keytype, bookkey)
def initialize_ebx_inept(self, password, docid, param):
self.is_printable = self.is_modifiable = self.is_extractable = True
- rsakey = RSA.import_key(password) # parses the ASN1 structure
+ rsakey = RSA.importKey(password) # parses the ASN1 structure
length = int_value(param.get('Length', 0)) // 8
rights = codecs.decode(param.get('ADEPT_LICENSE'), 'base64')
rights = zlib.decompress(rights, -15)