Re:The God Login
by onion2k on Friday January 09, 2015 @08:53AM
(#8862190)
That's a good approach for usability but it does halve the keyspace for anyone attempting a brute force attack. It might not be appropriate everywhere.
[ Parent
| on HN ]
Halving isn't really a big issue, when we're talking about something that normally talk about in exponents.
Re:The God Login
by lost_my_pwd on Friday January 09, 2015 @09:14AM
(#8862271)
Not if, when caps lock is detected, the case is inverted before submitting.
I purposefully create passwords with caps lock on, what then?
> I purposefully create passwords with caps lock on, what then?
I think he means doing it on the server, i.e. checking the password as-is, if that doesn't work, then check it with case inverted.
The best way to handle this is not to modify the entered password, or to reject it, but rather to just display the message. If it stands out enough you should notice it and make the corrective action yourself. In your case no corrective action would be necessary.
It does "halve" the keyspace, by removing one bit of entropy from your password. This is assuming you only use letters in your password and not numbers or other symbols not affected by capslock.
Well, it's a bit tricky. Two inverted passwords still have different hashs. From that perspective, two inverted passwords are not equivalent and therefore the entropy is not decreased.
This is important because if you want to decode a hashed password using a rainbow table for example, you still have to hash the entire keyspace, not just half of it.
Edit @sp332: Exactly. That was my point.
If you're doing an online attack, you can submit half as many passwords. I guess it's just as hard for an offline attack where you're cracking the database of hashes.
Re:The God Login
by ChrisLomont on Friday January 09, 2015 @11:18AM
(#8862836)
It cuts it vastly more than in half.
For n character alphabetic values, it reduces the keyspace from 52^n to 26^n.
That would be for case-insensitive matching, not matching on the case being inverted.
That's only if it works with Mac-style caps lock.
For the 2 matching cases, it only reduces to 51^n
It might be nice to do it client-side.
var caps = null;
passwordField.onkeypress = function(e) {
if (caps !== false) {
var s = String.fromCharCode(e.keyCode || e.which);
caps = s.toUpperCase() == s && !e.shiftKey;
}
};
loginForm.onsubmit = function(e) {
if (caps) {
passwordField.value = invertCase(passwordField.value);
}
};No. Now you won't be able to log in if you signed up without JavaScript, or if you paste your password into the form field.