The EncryptionService and KeyHandler currently mix file I/O operations with business logic. This makes them difficult to test and violates the single responsibility principle.
Refactor EncryptionService into a dedicated service
Extract file i/o operations into a FileHandler service, the encryption service should only handle encryption
Implement Pydantic models for request/response validation
Replace manual error handling with custom exceptions and a global handler.
The EncryptionService and KeyHandler currently mix file I/O operations with business logic. This makes them difficult to test and violates the single responsibility principle.
Refactor EncryptionService into a dedicated service
Extract file i/o operations into a FileHandler service, the encryption service should only handle encryption
Implement Pydantic models for request/response validation
Replace manual error handling with custom exceptions and a global handler.