I have my own password encryption dll that I am using to check the user's password when they login, this is referenced in my User entity.
Now I have created the ability for a user to register which is working fine, apart from the passwords are yet to be encrypted.
My question is quite simple, where should I put the encryption of the new user's password? I'm not sure as I am aware that the user's password shouldn't be transmitted in plain text, therefore I don't know where the best place to call the encryption function:
- User Entity (where the encryption dll is already used for validation).
- The User repository where the save user method is.
- The User controller where the user creation views are controlled.
- Somewhere else that I haven't considered!
Thanks very much