1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00
FFmpeg/libavformat
Vesselin Bontchev 03fb314acf 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>
2020-11-05 21:40:20 +05:30
..
2020-10-03 21:50:59 +02:00
2020-11-04 23:30:53 +01:00
2020-10-25 23:44:26 +10:00
2020-10-25 23:44:26 +10:00
2020-10-06 00:01:35 +08:00
2020-10-06 00:01:27 +08:00
2020-10-24 19:11:12 +02:00
2020-11-04 23:30:53 +01:00
2020-10-20 13:00:04 +02:00
2020-09-25 10:21:28 +02:00
2020-10-07 22:16:09 +02:00
2020-09-24 13:38:28 +02:00
2020-10-25 09:49:26 +01:00
2020-09-18 11:30:03 +02:00
2020-10-25 23:44:26 +10:00
2020-09-03 18:11:00 +02:00
2020-09-03 18:03:18 +02:00
2020-10-24 19:11:12 +02:00
2020-10-25 09:49:31 +01:00
2020-10-28 13:53:20 +01:00
2020-09-13 16:05:01 +02:00
2020-10-22 20:53:57 +08:00
2020-10-21 17:21:41 +02:00