5 Commits

Author SHA1 Message Date
ff5b8b4937 new encryption logic 2025-07-14 13:29:55 +01:00
aa1b9d7281 refactor(security): improve encryption using PyCryptodome and PBKDF2
Replace the `cryptography` library with `pycryptodome` for password encryption.

The previous implementation used AES-GCM with a static key derived from a
hardcoded secret. This change introduces a more robust security model by:
- Using PBKDF2 to derive the encryption key from the secret.
- Adding a unique, randomly generated salt for each encrypted password.

This significantly enhances security by protecting against rainbow table
and pre-computation attacks.

BREAKING CHANGE: The password encryption format has changed. All previously
encrypted passwords stored in the database are now invalid and will need
to be reset.
2025-07-14 11:55:13 +01:00
79a2f6e944 feat(security): implement AES-GCM for password encryption
Replaces the `pyeasyencrypt` library with a more robust and standard
encryption implementation using `cryptography.hazmat`.

This commit introduces AES-256-GCM for encrypting and decrypting user
account passwords. The `add_account` endpoint now properly encrypts
passwords before database insertion.

Error handling has been added to the `get_user_accounts` endpoint to
manage decryption failures for legacy passwords, which will be returned
as "DECRYPTION_FAILED".

BREAKING CHANGE: The password encryption algorithm has been changed.
All previously stored passwords are now invalid and cannot be decrypted.
2025-07-14 11:12:13 +01:00
445cdc834a latest working sample 2025-05-10 13:58:58 +01:00
Karl Hudgell
a15c68daac initial commit 2023-09-14 12:16:18 +01:00