checking a password for correctness