|
des?
=== My plan ===
Suppose you want to issue 100,000 cards.
1. Use a cryptographically safe pseudo-random number generation algorithm, and use the master key (that is, the initial seed of the system) to generate 100,000 random numbers large enough, with 20-30 decimal digits. And save it in a table (PRGN_TABLE);
2. The random number is printed on the card, of course, the random number must be hidden:) (like this mobile phone card), after the user buys the card, get a random number (ie password);
3. When the user hits the value, enter the random number and the server will look it up in the table, if any. It indicates that it is a legal user, and the value is charged, otherwise it is rejected.
safety:
Can users who do not purchase cards guess the numbers in PRNG_TABLE, or can users who purchase several cards guess the numbers in PRNG_TABLE based on the data they have obtained?
The answer is: the probability is almost zero.
* The master key should be kept secret, otherwise others can generate the same table according to your algorithm and initial value;
How to get cryptographically safe pseudo-random numbers, google "PRNG" |
|