Added authentication and password encryption