X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Faes.py;h=7817adcfdd546f70cfb76e0634b8df8ddbcaf8e0;hb=5c2266df4b9aeb7881ed8c026a038e2a25e43734;hp=2eeb96a5a066665dd239997ad8bda90b1e5e60b4;hpb=b74e86f48aa6d007b681e2723ff28fe82a49fa9d;p=youtube-dl diff --git a/youtube_dl/aes.py b/youtube_dl/aes.py index 2eeb96a5a..7817adcfd 100644 --- a/youtube_dl/aes.py +++ b/youtube_dl/aes.py @@ -1,4 +1,4 @@ -__all__ = ['aes_encrypt', 'key_expansion', 'aes_ctr_decrypt', 'aes_cbc_decrypt', 'aes_decrypt_text'] +from __future__ import unicode_literals import base64 from math import ceil @@ -152,7 +152,7 @@ def aes_decrypt_text(data, password, key_size_bytes): """ NONCE_LENGTH_BYTES = 8 - data = bytes_to_intlist(base64.b64decode(data)) + data = bytes_to_intlist(base64.b64decode(data.encode('utf-8'))) password = bytes_to_intlist(password.encode('utf-8')) key = password[:key_size_bytes] + [0] * (key_size_bytes - len(password)) @@ -327,3 +327,5 @@ def inc(data): data[i] = data[i] + 1 break return data + +__all__ = ['aes_encrypt', 'key_expansion', 'aes_ctr_decrypt', 'aes_cbc_decrypt', 'aes_decrypt_text']