created methods to encrypt password in user model