diff --git a/mycli/config.py b/mycli/config.py index 5d71109..1626726 100644 --- a/mycli/config.py +++ b/mycli/config.py @@ -8,7 +8,7 @@ import sys from typing import Union, IO from configobj import ConfigObj, ConfigObjError -import pyaes +from Cryptodome.Cipher import AES try: import importlib.resources as resources @@ -189,7 +189,7 @@ def encrypt_mylogin_cnf(plaintext: IO[str]): return bytes(rkey) def encode_line(plaintext, real_key, buf_len): - aes = pyaes.AESModeOfOperationECB(real_key) + aes = AES.new(real_key, AES.MODE_ECB) text_len = len(plaintext) pad_len = buf_len - text_len pad_chr = bytes(chr(pad_len), "utf8") @@ -267,7 +267,7 @@ def read_and_decrypt_mylogin_cnf(f): # Create a bytes buffer to hold the plaintext. plaintext = BytesIO() - aes = pyaes.AESModeOfOperationECB(rkey) + aes = AES.new(rkey, AES.MODE_ECB) while True: # Read the length of the ciphertext. diff --git a/setup.py b/setup.py index e31f759..883a1ba 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ install_requirements = [ 'configobj >= 5.0.5', 'cli_helpers[styles] >= 2.0.1', 'pyperclip >= 1.8.1', - 'pyaes >= 1.6.1' + 'pycryptodomex', ] if sys.version_info.minor < 9: