added password encryption and authentication