Generate serial numbers for each product key and validate them [closed]

那年仲夏 提交于 2019-12-25 14:21:49

问题


I have a piece of software with different unlockable modules. Each module has to be purchased separately. I've started with assigning a unique key to each module via Guid.NewGuid method.

Now I have to provide users with serial numbers for activating those upgrades, and then the numbers will need to be validated:

  1. Serial number belongs to specific product key
  2. Serial number is valid for specific product key.

Any suggestions how to generate a serial number based on the Guid product key and perform a reverse operation for validation?

Thanks.


回答1:


Perhaps you can generate some sort of hash based on the user's name and company. Then take that hash and generate some sort of combined hash based on the first hash and the product's GUID. Use that final hash to form your key.

Then your program does the same thing (the user must enter their name and company) and if it comes up with the same final hash value, consider it to be valid.



来源:https://stackoverflow.com/questions/4525048/generate-serial-numbers-for-each-product-key-and-validate-them

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!