Blue Theme Orange Theme Green Theme Red Theme
 
DevExpress Free UI Controls
Home | Forums | Videos | Advertise | Certifications | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
6 Months Free & No Setup Fees ASP.NET Hosting!
Search :       Advanced Search »
Home » Learn .NET » Make Combination of Keys For Our Trial Version Application

Make Combination of Keys For Our Trial Version Application

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

Page Views : 4571
Downloads : 188
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
Download Files:
Make Combination of Keys for our Trial Version Application.zip
 
 
Nevron Chart
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 



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!
 

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Tanmay Sarkar
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
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.
Discover the Top 5 .NET Memory Management Fundamentals
To write the best .NET code, you need to know exactly how the .NET framework really manages memory. Ricky Leeks presents the Top 5 fundamental facts of .NET memory management. Learn more.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
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!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
DevExpress Free UI Controls
Become a Sponsor
 Comments
a question by ehsan On September 10, 2010
It's so easy to discover keys from Assembly via Deassemblers. So, what's your solution?
Reply | Email | Modify 
Re: a question by Tanmay On September 10, 2010
If you want to really protect your code then buy or use some free fuscator software. It's very simple & easy. I test it with some protector & get satisfied. Thanks to think about it & make a good Question!

Thank you!
Reply | Email | Modify 
A key for a machine? by Hoang On October 28, 2010
I see that the customers can buy a key and setup your program for all computers they want, even they can public that key for their friends. How do you solve this problem?
Reply | Email | Modify 
Re: A key for a machine? by Tanmay On October 28, 2010
For this situation on line activation is required and with out communicate with customer it can't possible to prevent that type of privacy. I just wrote here an of line activation, as consider if a person buy a product he/she don't distribute his/her copy or activation key.If I buy a copy then i should not distribute the key if i have not a company with lots of computer.
So it's depend on your product, if it useful for a single user then you build that type of key. And if your product required for company's use means lots of computer use your product under same person then it's better to implement on line activation.

Thanks.....
Reply | Email | Modify 
Offline active by Hoang On October 28, 2010
Firstly, thanks for your article and your reply. My product  runs offline and I'm afraid that my customers have no internet connection. I concern about the algorithm of Microsoft when activating their offline product, as Office, Visual Studio,.... I've studied about MAC address, but until now, it's still confuse. Wait for your new article about this issue...
Reply | Email | Modify 
an answer by ehsan On October 28, 2010
I've cracked many programs which used Online Activation. I suggest you:
1-use Unmanaged programs for Lock library and It's accessors.
2-use hashing or encryption methods that are performed by microsoft library.
3-use any post-development recompilation system even that you performed can be better!
4-at the end everytime try to crack your program. It can give you more strength.
Reply | Email | Modify 
A key for a machine by Theo On October 31, 2010
Great concept
Reply | Email | Modify 
Thank u by karthik On April 21, 2011
Thank u ... Its very useful to me...
Reply | Email | Modify 
Re: Thank u by Tanmay On April 23, 2011
welcome :)
Reply | Email | Modify 
After Activation !! by bevalti On December 30, 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
Reply | Email | Modify 
Re: After Activation !! by ehsan On December 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
Reply | Email | Modify 
Re: Re: After Activation !! by bevalti On December 31, 2011
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
Reply | Email | Modify 
DevExpress Free UI Controls
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.