Added method for password encryption