diff options
author | Vesselin Bontchev <vesselin.bontchev@yandex.com> | 2000-01-01 12:00:00 +0300 |
---|---|---|
committer | Vesselin Bontchev <vesselin.bontchev@yandex.com> | 2020-11-05 19:10:20 +0300 |
commit | 03fb314acfa4f5a4af84a6fc82a425477fd352eb (patch) | |
tree | 51d799425284a10a0e497d54556472de76d2c9dd /libavformat/isom.h | |
parent | 70d8077b795766e2486e6ec8110f22a97362d6d6 (diff) |
Add support for playing Audible AAXC (.aaxc) files [PATCH v4]
The AAXC container format is the same as the (already supported) Audible
AAX format but it uses a different encryption scheme.
Note: audible_key and audible_iv values are variable (per file) and are
externally fed.
It is possible to extend https://github.com/mkb79/Audible to derive the
audible_key and audible_key values.
Relevant code:
def decrypt_voucher(deviceSerialNumber, customerId, deviceType, asin, voucher):
buf = (deviceType + deviceSerialNumber + customerId + asin).encode("ascii")
digest = hashlib.sha256(buf).digest()
key = digest[0:16]
iv = digest[16:]
# decrypt "voucher" using AES in CBC mode with no padding
cipher = AES.new(key, AES.MODE_CBC, iv)
plaintext = cipher.decrypt(voucher).rstrip(b"\x00") # improve this!
return json.loads(plaintext)
The decrypted "voucher" has the required audible_key and audible_iv
values.
Update (Nov-2020): This patch has now been tested by multiple folks -
details at the following URL:
https://github.com/mkb79/Audible/issues/3
Signed-off-by: Vesselin Bontchev <vesselin.bontchev@yandex.com>
Diffstat (limited to 'libavformat/isom.h')
-rw-r--r-- | libavformat/isom.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/isom.h b/libavformat/isom.h index 78495fd336..5a6d504090 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -286,6 +286,10 @@ typedef struct MOVContext { int activation_bytes_size; void *audible_fixed_key; int audible_fixed_key_size; + void *audible_key; + int audible_key_size; + void *audible_iv; + int audible_iv_size; struct AVAES *aes_decrypt; uint8_t *decryption_key; int decryption_key_len; |