Creating function to encrypt password

thanks for the feedback, however as i said.

I cannot change the authentication method.
because it is already in production.