method to encrypt the password