Best way to generate software activation codes?

What is a good way to randomly generate non-encoding activation codes that cannot be randomly generated for use to activate software? I am making an automatic execution system for a web application.

I am using C #.

+4
source share
4 answers
+16
source

It depends on your goals. The GUID is easy to create, but it is a pain if the user must enter it manually. This is great if activation occurs, for example, by clicking on the URL provided by email, or if you can expect the user to copy and paste the value from the activation email.

In other cases (for example, compressed software in which the activation code is physically printed on the packaging in some way), the user will manually enter the code. In this case, you'd better use a method similar to that used by Microsoft and Blizzard: generate code consisting of five groups of five random alphanumeric characters (skip the vowels if you want to eliminate the risk that the activation code will contain something something like 4SHIT), and check each code generated against the main list for duplicates. (Although I think that the chances of even a 100,000 sequence extracted from {1, 2, ... 34 ^ 26 - 1} containing a duplicate are pretty small. It's hard to say for sure, because the only way I know is to calculate he overwhelms the double.)

+4
source

Guid.NewGuid (). Tostring ()

If you do not mind the length of 36 characters.

+2
source

You should probably just use Guid

+1
source

All Articles