Skip to content

Use AES from pycryptodome package - #623

Closed
sylvainpelissier wants to merge 1 commit into
ParadoxAlarmInterface:devfrom
sylvainpelissier:pycryptodome
Closed

sylvainpelissier wants to merge 1 commit into
ParadoxAlarmInterface:devfrom
sylvainpelissier:pycryptodome

Conversation

@sylvainpelissier

Copy link
Copy Markdown
Contributor

Using pycryptodome AES implementation allows to have hardware optimizations when available and make the code easier to understand.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Comment thread paradox/lib/crypto.py
"""Encrypt, 0xEE-padding the key to 32 bytes and
the plaintext to a whole number of blocks.
"""
c = AES.new(key.ljust(32, bytes([PAD])), AES.MODE_ECB)
Comment thread paradox/lib/crypto.py
return bytes(dtxt)

"""Decrypt whole 16-byte blocks; a trailing partial block is ignored."""
c = AES.new(key.ljust(32, bytes([PAD])), AES.MODE_ECB)
@yozik04

yozik04 commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the idea and for putting this together! I agree with replacing the custom AES implementation, but I preferred using the cryptography library instead. The alternative is implemented in #624, so I am closing this PR as superseded.

@yozik04 yozik04 closed this Oct 17, 2026
@sylvainpelissier

Copy link
Copy Markdown
Contributor Author

Indeed, it is even better, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants