I'm designing a simple user login/register program with user login/register and a repository. The passwords for users should be encrypted when stored but I don't know where to put the encryption step either on the repository or in the service that handles the logic for registering/login in a user. the user passwords should always be encrypted and for that reason I think it is better to have this logic in the repository as it is the class that will be called every time I want to do something with a user. Putting the encryption logic on the service mean that every service that wants to do something with a user must be aware of the encryption logic.
On the other side, I don't know if the repository should be aware of this logic.
Or maybe it is worth creating a value object "UserPassword" that receives the raw password and a cypher as constructor parameters and it immediately saves the encrypted password for future retrieval?
I'm trying to design an hexagonal architecture. (Don't know if this may help)