4 ms·
The only realistic utility of this feature is that it could let you "guess" when the user has finished typing their password and check it automatically upon com
by Cushman 15y ago
The only realistic utility of this feature is that it could let you "guess" when the user has finished typing their password and check it automatically upon completion without them needing to press return. That would be a neat gimmick, but I don't see it working out.
The issues are twofold:
1. The obvious, it reduces an attacker's search space by the guess accuracy, in this case 256 times. To maintain equivalent security you must compensate for this by increasing the work of your hash function 256 times. Depending on your password's entropy (and thus your default work factor) this may or may not be acceptable. For user-supplied passwords secure hashes should take order of 100ms -- 10ms at the least -- and increasing that many orders of magnitude is definitely not acceptable. This, alas, pretty much breaks the idea, but putting it aside:
2. There will be collisions. The odds of a particular collision are 1/256; since an 8-character password contains seven chances for a collision, ballpark one in 36 of your users will have at least one collision during their password. This means that to maintain the seamless experience, you need to check the crypto-hash on the server silently, without indicating checking or failure to the user (anything else would be confusing). This introduces a number of very weird problems which you can definitely not be sure you have accurately addressed.
So, not really a good plan for passwords. Still a neat hack, though.
- tantalor 15y agoThe author attempted to solve issue #1 by adding the 1000-msec delay for the first challenge and unrelated-password request throttling. That solves the issue for attackers using the client API (they can't narrow their search space). The author has already acknowledged in the article that, were an attacker to get ahold of the stored password hash, they would have "everything needed to carry out brute-forcing." I agree this is probably a deal breaker and defeats the purpose of using a hash function with a work factor like bcrypt.