diff --git a/pyrogram/crypto/aes.py b/pyrogram/crypto/aes.py index c571fb2d..05a01044 100644 --- a/pyrogram/crypto/aes.py +++ b/pyrogram/crypto/aes.py @@ -53,7 +53,7 @@ class AES: @staticmethod def ctr_decrypt(data: bytes, key: bytes, iv: bytes, offset: int) -> bytes: - replace = int.to_bytes(offset // 16, byteorder="big", length=4) + replace = int.to_bytes(offset // 16, 4, "big") iv = iv[:-4] + replace if is_fast: