The login function now encrypts passwords for comparison.