While others have well pointed out that there are few (if any) advantages, I would take issue with your claim that there aren't any drawbacks. If you store just the hashed username, then searching for the username is easy. If you store a salted, hashed username then searching becomes a bit more problematic.
Let's assume that if we build some SQL table containing usernames and (hashed) passwords and tell the SQL server to index the username column that it will do some sort of binary search or some other magic. We could have a table that looks like:
Username | Password
test | j9lnvqjAuhNJs
(This is the old-school unix crypt(3) hash just for simplicity and brevity.)
If you store your usernames in plaintext, retrieving the (hashed) password for a user is a simple SQL call. Let's say you want to validate the credentials for a user who typed in the username test
:
SELECT password FROM users WHERE username='test`;
Simple enough. Now if we were to store the usernames in the same format as the passwords, our table ends up looking like this:
Username | Password
M1CAtvzDdJDGU | j9lnvqjAuhNJs
Now when a user types in their username of test
, how do you validate the password? A binary search is useless here, since you don't even know the salt you used to store the username. Instead, you need to iterate over each username in the database, crypt
ing the given username with the salt for that username and comparing it to the stored (hashed) username to see if it matches. Youch!
Assume that you took some good precautions and used a nice slow hash like bcrypt
instead of good old Unix crypt? Double youch!
As you can imagine, there are some serious drawbacks to storing a salted hashed username instead of just plaintext.