If you program correctly, this should not become a problem.
Encrypt the password using md5 or another hash function before storing it. That way, even if someone could get the md5 of the password, it would still be useless. It cannot be decrypted. Since the user interface encrypts the input, you HAVE to enter the correct password, or find another way in.
Furthermore, any query-extensions entered into the password fields would be encrypted too, before querying the database.
You can also do a simple regexp on the username, making sure it doesn't contain any characters that are forbidden. And if you programmed well, you can just use the same function used to validate the username the user entered when he signed up.