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

1

0

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.

Audwen answered 24/12, 2010 at 8:5 Comment(3)
We roled our own license key routines. I do not think that a GUID would be suitable. Our method is still weak but enough for the kind of product we are selling. We do encode our data with our own alphabet, adding some random and checksums and we get a result like "ZP10F-HJE2-NYHE-MOCF-YKRV-DSPQ-KCMD-0RSQ0".Deutero
You should look at the answers to related questions. Two that have good advice are https://mcmap.net/q/1634632/-product-serial-key-purchase-closed and #890342.Corriecorriedale
There is an answer to a similar question here: #4584130Amphiarthrosis
N
7

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.

Novikoff answered 24/12, 2010 at 8:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.