Implemented authenticate, encrypt_password, password=, and private method generate_salt in user model.