User authentication and password encryption