开发者

Ask user for partial PIN

I'm developing an additional security module for a web application, which asks the user to enter a PIN code randomly 开发者_运维知识库generated at user signup. The PIN is stored AES-128 encrypted in a db and sent by sms to the new user.

The user will be ask to provide his PIN when certain situations occur (i.e. "strange" accesses, or unusual operations) - and i'd like the user not to enter the entire PIN code, but just 2 digit (for example: the 1st and the 6th).

2 4 6 2 9 1 8 3    -> entire PIN
^---------^----    -> digits i'm asking

My question is: is the a more secure way to choose which digits to ask? Should i choose them randomly (but an eventual attacker who owns part of the pin could retry until the digits he owns are requested) or should i ask each user always for the same digits - maybe storing their indexes encrypted with the PIN, or generate them with a function parametrized with the PIN itself?

Thanks.


The way I find most online banking software implements this is that once it's asked for two digits it will keep asking for the same until the user either blocks the account (from too many wrong attempts) or answers it correctly. After this another 2 digits is randomly selected for next time.

As far as I know this is the only way to mitigate an attacker simply reloading until they get a combination they desire.


If you have secondary, more secure way of authentication, then do ask for random digits but lock the account after a few failed attempts. That way, the chance that an attacker has the correct digits is very small, yet the implications of the same two digits leaking are also mitigated.

[Edit: As @m.edmondson suggests, only change the pair after a successful login, not before.]

If you just ask for the same two digits over and over, you might as well just have a two-digit PIN.

If a user inadvertently locks herself out, you can always fall back on the secondary authentication to recover the account.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜