Originally Posted by
vikrant
Hi sporty,
I am not very sure how much security you want. But simple example i can give you is use the hash function concept for creating the serial number.
If you are aware of Hash function and Hash key then it is very easy for you to understand it. It is a way to search the value in the present set of values.
In your case you can use the following things.
1) Fix the length of the serial numnber you want to keep for ur s/w
2) say for example you fix for 6
3) Now for our complexity we will split this word in parts like 2 + 1 + 2 + 1
4) first 2 numbers will plain numbers and next digit will be MOD 8 function of those and same for the next pair.
e.g. consider the number 67 and 98 now we will generate the serial number like this
1) 67 so the MOD 8 will be 67/8 = 8 and remainder 3 so the answer is 3
2) 98 so the mod 8 will be 98/8 = 12 and reminder is 2 so answer is 2
3) now create the serial number as 67 + 3 + 98 + 2
4) so the serial number will be 673982
5) this is valid as per our logic.
Whenever user enters the serial number we will split that in parts like 2+ 1+ 2 + 1 and then check it against the mod8 logic that we have developed..
This is the simplest logic developed. You can increase the complexity and parts as well the hash function. and create a secure key. But make sure that the number is unique .
let me know if you want any more help.
Bookmarks