views:

35

answers:

2

A good security practice is never to maintain a database of login passwords for your system but instead to maintain a database of hashes of passwords (using some suitable hash function) and at login compare the hash of the password provided with the information stored in the database.

However, I am increasingly seeing examples of logins where I am required (for example) to only provide the 3rd, 4th, 6th and 8th characters of my password. Does this mean that my original password must be stored in order to do the character comparison? Or is there a special type of hash function which still allows character comparison?

+3  A: 

It doesn't mean that they're storing the plaintext password. The could, for example, just hash the 3rd, 4th, 6th, and 8th character of whatever you enter. In any case, it's definately highly insecure. They've basically just shortened your password to 4 characters.

Peter Ruderman
Hashing a character is useless, since there are only a small number of them, and it's trivial to brute-force the plain-text character.
Amnon
A: 

many banks do that, and typically you enter those characters by choosing them via mouse clicks instead of using the keyboard. All this is to prevent keyloggers getting the password. But yes it must mean they keep the plaintext password stored.

raticulin
That's not conclusive, they could just concatenate the characters and hash those.
nos
But then they would have to store the hash of every possible subset of my password that they could ask for. If, for example, they always ask for 6 of the 15 characters that make up my password then that's 5005 hashes. (At least to me) That seems like a lot of extra per person.
qwerty1793
@qwerty1793: To me too. If a site does indeed ask for a random subset of your password characters, then I'd say it's strong evidence that they're storing the full password on the backend (but probably still encrypted).
Peter Ruderman