feat(security): T12 implement AES-256 encryption service

- Add EncryptionService with AES-256-GCM via cryptography.fernet
- Implement PBKDF2HMAC key derivation with SHA256 (100k iterations)
- Deterministic salt derived from master_key for consistency
- Methods: encrypt(), decrypt() with proper error handling
- 12 comprehensive tests with 100% coverage
- Handle InvalidToken, TypeError edge cases
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-07 12:03:45 +02:00
parent 66074a430d
commit 2fdd9d16fd
4 changed files with 736 additions and 1 deletions

View File

@@ -53,7 +53,7 @@
- [x] T11: Setup Alembic e creare migrazione iniziale - ✅ Completato (2026-04-07 11:20)
### 🔐 Servizi di Sicurezza (T12-T16) - 0/5 completati
- [ ] T12: Implementare EncryptionService (AES-256)
- [ ] T12: Implementare EncryptionService (AES-256) - 🟡 In progress
- [ ] T13: Implementare password hashing (bcrypt)
- [ ] T14: Implementare JWT utilities
- [ ] T15: Implementare API token generation