Pin Generation

前端 未结 11 841
走了就别回头了
走了就别回头了 2021-01-31 05:26

I am looking to develop a system in which i need to assign every user a unique pin code for security. The user will only enter this pin code as a means of identifying himself. T

11条回答
  •  终归单人心
    2021-01-31 06:10

    May I suggest an alternative approach? Take a look at Perfect Paper Passwords, and the derivatives it prompted .

    You could use this "as is" to generate one-time PINs, or simply to generate a single PIN per user.

    Bear in mind, too, that duplicate PINs are not of themselves an issue: any attack would then simply have to try multiple user-ids.

    (Mileage warning: I am definitely not a security expert.)


    Here's a second answer: from re-reading, I assume you don't want a user-id as such - you're just validating a set of issued scratch cards. I also assume you don't want to use alphabetic PINs.

    You need to choose a PIN length such that the probability of guessing a valid PIN is less than 1/(The number of attempts you can protect against). So, for example, if you have 1 million valid PINs, and you want to protect against 10000 guesses, you'll need a 10-digit PIN.

    If you use John Graham-Cumming's version of the Perfect Paper Passwords system, you can:

    1. Configure this for (say) 10-digit decimal pins
    2. Choose a secret IV/key phrase
    3. Generate (say) the first million passwords(/PINs)

    I suspect this is a generic procedure that could, for example, be used to generate 25-alphanumeric product ids, too.

    Sorry for doing it by successive approximation; I hope that comes a bit nearer to what you're looking for.

提交回复
热议问题