Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In some password-authenticated sites, you are asked to enter a random selection of specific characters from your password rather than the whole word/phrase. For example, it might say 'Enter the 1st, 4th and 8th letter' and provide three separate input boxes.

From what little I know of security mechanisms, I would have expected this to be less secure than entering the whole password, salting + hashing it and comparing it to the stored hash, as there is no plain text anywhere in sight.

This system is used by (hopefully) very secure websites, though, including certain bank sites in the UK.

So my two-part question is, is this as secure as traditional salt/hash comparison and why is it so?

share|improve this question

migrated from Sep 23 '11 at 17:32

This question came from our site for professional and enthusiast programmers.

This means that the site is storing the password in plaintext, or else it is impossible to compare and verify the password character-wise. Unless there's a new kind of encryption that I'm not aware of.. – Jin Sep 23 '11 at 9:50
Horribly insecure as a password (the whole string needs to be stored somewhere), but useful in addition to a real name+password (the user needs to know username, password and the security code, yet even if there's a keylogger, the attacker only gets a part of the security code; the hope is that different part of the code will be required next time). I know a bank that used this as a 1.5-factor authentication (so to speak), before cellphones were common. – Piskvor Sep 23 '11 at 9:51
I'd stay away from such a bank. – Heisenbug Sep 23 '11 at 9:54
@Piskvor These characters are admittedly asked for after a previous secret pass is verified (but that is just birthday + 4 digits so most of it could be found if the attacker knows anything about the person). I hadn't thought of the keylogger, though, that's interesting. Could this dual-level authentication be more secure than just a normal salted/hashed pass? – Alex Sep 23 '11 at 9:56
@Jin and Piskvor the password doesn't need to be stored as cleartext, and I really hope it's not. See Partial passwords - How?. – captaincomic Sep 23 '11 at 10:12
up vote 19 down vote accepted

This method of password entry is popular in bank sites in Poland. It's called masked passwords. It's meant to protect from keyloggers - and keyloggers only. The password transmission itself is protected from sniffing with SSL, so the reasoning is that if keylogger is installed on client's device, it will never get access to the full password.

However, this logic has a few flaws:

  1. Attacker needs to enter fewer characters (e.g. only 4 characters, often numbers only) for a single try. Therefore it's easier to brute force this authentication step. That is why masked passwords need to be paired with account lockout policy.

  2. With just a few known characters at certain positions (e.g. gathered by a keylogger/screengrabber) attacker can simply try logging in when the server chose positions he knows and refresh when others were chosen. So often masked passwords implementation stores the positions choice for an account server-side for certain amount of time (e.g. a day) until successful authentication.

  3. Getting to know the whole password only needs capturing a few successful authentications (e.g. when password length is 12 and there are always 4 positions chosen, it usually takes 8 tries), so a keylogger/screengrabber will get it - it will just take a little bit longer.

  4. The biggest threat for Internet banking authentication is malware (man-in-the-browser attacks) like ZeUS or SpyEye and this kind of software usually conducts social engineering attacks that totally overcome masked passwords scheme. For example, this software can:

    • ask for a whole password
    • display a fake password change form after fake authentication
    • simulate password entry errors and redisplay the form with other positions to fill to get full password in 2-3 tries

Masked passwords are being difficult to handle for users and tricky to implement correctly. At the very least developers need to add account lockout policy, positions choice storage and partial hashes.

Contrary to popular belief, masked password, especially in e-banking sites, though they offer protection from basic keylogging, completely fail to other, more prevalent threats like malware utilizing social engineering.

share|improve this answer
I logged in to one of the Polish banks before a minute and decided to check how masked passwords can be implemented together with hashing. And then google pointed me to this answer :) – Tomasz Zielinski Oct 27 '12 at 15:01

I know one online banking website, that does ask first for a password (numbers and characters), and then you have to enter with your mouse two digits of a second 6-digit password (numbers only). You you presented with a numpad on the sceen and click on the numbers.

The reasoning behind this is that it is (probably) harder for malware to track your mouse movement than it is to log your key presses.

In the above example it's obviously more secure than just a single password.

In the situation that you describe, where one has to enter only specific characters of a password by keyboard, the reasoning could be that if someone logs or phishes your input he still doesn't have your whole password.

I guess that the mechanism used to validate the input is secure, you still can use hashing if you store a hash of every possible input combination.

Here is a short wikipedia artical about partial passwords, that mentions this.

share|improve this answer
Thanks for the link, didn't know the idea had a name. – Alex Sep 23 '11 at 10:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.