SIGN UP MEMBER LOGIN:    
ARTICLE

Make Combination of Keys For Our Trial Version Application

Posted by Tanmay Sarkar Articles | Learn .NET September 08, 2010
In this article we make a combination of keys for our trial period application.
Reader Level:


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!
 

Login to add your contents and source code to this article
share this article :
post comment
 

Hi ehsan thanks’ for response me!! My problem it’s very simple to understand it!! in your Main you put a Boolean variable (Logic) : This variable returns true after testing sec.Algorithm(passwordSt, abc) What I want is!! In other form (for example in « Contact or Help » form) I want to view if the product version was activated or not (we can add a Label after testing it contains activated or not version). Thank you very match for your help

Posted by bevalti bevalti Dec 31, 2011

Dear Bevalti It is not really clear how you have built your lock and how you want to manage it. Without those information, the thing that I can point is that, try to verify your lock from some other places, and then retrive the result of verification in your mainform. Do not do both checking and verification in main form. :) You should think beyond a cracker have a nice time

Posted by ehsan khakifirooz Dec 31, 2011

hi !! thank you for this nice post I want to know how can I test if the product was activated or not in my main Form (or MainWindow in WPF), and I will change my Label text from "unactivated version" to "this is an activated version"!! Thank you

Posted by bevalti bevalti Dec 30, 2011

welcome :)

Posted by Tanmay Sarkar Apr 23, 2011

Thank u ... Its very useful to me...

Posted by karthik raja Apr 21, 2011
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor