I am implementing a service where application-specific passwords seem a good choice to improve security. A question on why and when they might make sense has already been discussed here Google Account: implications of using application-specific passwords
Now, I am interested in the how, especially with strong hashes like bcrypt or scrypt.
- I assume that Google, iCloud & Co store hashes of the app-specific passwords.
- Given that all the app-specific passwords map to the same username, does that mean that one has to compare the hash of the given password to all known hashes of the given username?
- If so, and say I use an encryption algorithm like bcrypt or scrypt with maxtime somewhere between 100 to 200 milliseconds, wouldn't I have to parallelise the hashing & comparison to minimise worst-case waiting time?
- Is there a good reason why they chose not to use application-specific usernames? e.g. say, I have an account "foo" and ":" is not allowed in a user name, why not use "foo:bar" as the bar-app-specific username of the "foo" account? That way, the relation username <-> password is 1:1 again. Is that because users should not have to remember multiple names?
Many thanks for your thoughts.