From 229b3c01ca4fcae1825e7304f8f289c79695b955 Mon Sep 17 00:00:00 2001 From: Dick Marinus Date: Thu, 9 Oct 2025 19:43:54 +0200 Subject: [PATCH 1/2] Switch from pyaes to pycryptodomex --- changelog.md | 4 ++++ mycli/config.py | 6 +++--- pyproject.toml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index f7a18629..0865dbb8 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,10 @@ Bug Fixes -------- * Don't require `--ssl` argument when other SSL arguments are given. +Internal +-------- +Switch from pyaes to pycryptodomex as it seems to be more actively maintained. + 1.39.0 (2025/09/30) ============== diff --git a/mycli/config.py b/mycli/config.py index 98039126..b965acd4 100644 --- a/mycli/config.py +++ b/mycli/config.py @@ -9,7 +9,7 @@ from typing import IO, BinaryIO, Literal, TextIO from configobj import ConfigObj, ConfigObjError -import pyaes +from Cryptodome.Cipher import AES logger = logging.getLogger(__name__) @@ -175,7 +175,7 @@ def realkey(key: bytes) -> bytes: return bytes(rkey) def encode_line(plaintext: str, real_key: bytes, buf_len: int) -> bytes: - 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") @@ -250,7 +250,7 @@ def read_and_decrypt_mylogin_cnf(f: BinaryIO) -> BytesIO | None: # Create a bytes buffer to hold the plaintext. plaintext = BytesIO() - aes = pyaes.AESModeOfOperationECB(rkey_b) + aes = AES.new(rkey_b, AES.MODE_ECB) while True: # Read the length of the ciphertext. diff --git a/pyproject.toml b/pyproject.toml index 3a1d826d..25117db8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ dependencies = [ "configobj >= 5.0.5", "cli_helpers[styles] >= 2.7.0", "pyperclip >= 1.8.1", - "pyaes >= 1.6.1", + "pycryptodomex", "pyfzf >= 0.3.1", "llm>=0.19.0", "setuptools", # Required by llm commands to install models From c2dca9361a481a4c6e7d483dd2eb6868714e92ac Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Thu, 9 Oct 2025 13:54:37 -0400 Subject: [PATCH 2/2] move changelog entry to upcoming release --- changelog.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 0865dbb8..aff5517f 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ Upcoming (TBD) Internal -------- * Test on Python 3.14. +* Switch from pyaes to pycryptodomex as it seems to be more actively maintained. 1.39.1 (2025/10/06) @@ -13,10 +14,6 @@ Bug Fixes -------- * Don't require `--ssl` argument when other SSL arguments are given. -Internal --------- -Switch from pyaes to pycryptodomex as it seems to be more actively maintained. - 1.39.0 (2025/09/30) ==============