Make Combination of Keys For Our Trial Version Application



In this article we make a combination of keys for our trial period application.

In my previous article, I showed a simple algorithm which describes how to build a trial version for main application. Now we make a combination of keys. So we can distribute our products to several customers.

Now we build several product keys using a 2D array. The array elements are random but they are not a random number generated by application. When we save a product key in the Registry we make a simple trick & over write the product key string with a type conversion. So if the user can find the registry key then he can't access the right product key.
 
For the combination we build a 5x10 array, like:

string[,] passwordSt = new string[,] // 5X10
            {
                {"ASDF","QWER","MKOG","EDFR","CVBH","DRFW","HNKO","GHER","RERW","SWVU"},
                {"ASDW","HJUM","VGTR","VFDS","PCFT","GEIK","CWTH","GETD","ETDA","EFQS"},
                {"HGFD","POLK","DFRE","NBGH","JYUO","GECS","DFWU","GQAS","VRYE","CAER"},
                {"GFHY", "OPHY","GHSW","JNYH","CFFR","VS5H","CD3T","C67N","F34F","F8J5"},
                {"DRFW", "HNKO","GHER","RERW","SWVU","E4N7","2C8U","3F5N","3CFD","F5UT"}
            };


For these five rows we can build 10 different keys. All total we can build 1,000,000 keys.

In Main in the application the Program.Cs file looks like:

static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            String abc = @"Software\Tanmay\Protection";
            string[,] passwordSt = new string[,] // 5X10
            {
                {"ASDF","QWER","MKOG","EDFR","CVBH","DRFW","HNKO","GHER","RERW","SWVU"},
                {"ASDW","HJUM","VGTR","VFDS","PCFT","GEIK","CWTH","GETD","ETDA","EFQS"},
                {"HGFD","POLK","DFRE","NBGH","JYUO","GECS","DFWU","GQAS","VRYE","CAER"},
                {"GFHY", "OPHY","GHSW","JNYH","CFFR","VS5H","CD3T","C67N","F34F","F8J5"},
                {"DRFW", "HNKO","GHER","RERW","SWVU","E4N7","2C8U","3F5N","3CFD","F5UT"}
            };
            Secure sec = new Secure();

            bool logic = sec.Algorithm(passwordSt, abc);
            if(logic ==true)
                Application.Run(new Form1());
        }


Anybody can easily make a dll which only contains a Product Key. (I am not writing on that right now)
I pass it through main.

Now user should provide a 20 Character Product key. (a combination of those).

The screen looks like:

trial1.gif

What is the Combination?

I upload here a KeyGen which builds a 20 character Product Key.

It looks like:

trial2.gif

In the first box you provide a 5 digit Integer string & it build a key using the given 2D array.

Example:  51541

passwordSt[0,5]= DRFW
passwordSt[1,1]= HJUM
passwordSt[2,5]= GECS
passwordSt[3,4]= CFFR
passwordSt[4,1]=
HNKO

So, you can provide from 00000 to 99999 Product key.

As we rewrite our product key with a conversion. The Conversion processes are very simple. We convert corresponding Character to equivalent Integer so we get a long integer string (number) that will be saved in the registry. But if the user fins it, he/she could not get the original Product Key.

So if any tool can retrieve any thing it can't get the original Product Key.

You can distribute the same copy of your product to 1,000,000 people. We can also use a dll to write our Product Key Combination String.

That's it!

File: I upload here

  1. A sample Main app

  2. Trial Maker Dll

  3. KeyGen (Only for this String) Don't Distribute Keygen it's only for generate password, and distribute your application with a single key. Keep the 5 digit number to identify your customer. Like for 00000 you get a product key, 00001 get another one and so.

Few Words:

All the applications are built with VS 2010 in 3.5 Framework.

Hope it will help you!

Thank You!
 


Similar Articles