C#: Free licensing system?

kytro360

Power Member
Joined
Jan 12, 2010
Messages
708
Reaction score
737
Hey, I made a program in C# and was wondering if anyone who codes in C#, or even VB would be kind enough to share code to set up a licensing system for my program?
 
I doubt so but there are many commercial products available. e.g. softwarekey
 
Hey,

I am looking for the same thing. I have two separate new programs that I want to start selling. I would love to find a licensing system for them as well.

You should keep in touch about your trials. I will do the same.

That way if we find one that is crap, the other doesnt have to waste there time!

Let me know. So far I have tried a few.. No go though..

Thanks-
 
Maybe this will get you started...

I just make a random key on the server in PHP. Then md5 it. After Paypal success I do...
Code:
    $licenseKey = makeRandomKey();  //make random key    
    $dbKey = base64_encode(md5($licenseKey, true));
    
    //Save that key to database

In C#, you have to have the user input their key, MD5 it the same way, and send that to the server. The server should check if that MD5 is in the database then.

Code:
        //C# code to MD5 same way as PHP
		private string MD5_this(String input)
		{
			System.Security.Cryptography.MD5 alg = System.Security.Cryptography.MD5.Create();
			UTF8Encoding enc = new UTF8Encoding();
			byte[] hash = alg.ComputeHash(enc.GetBytes(input));
			string output = Convert.ToBase64String(hash);
			
			return output;
		}

If the server finds MD5 of that key in database... the server then adds a known string to that MD5, then MD5s that again. The C# program knows the string going to be appended so it can MD5 that same string on its own, so it could compare its own value with the response from the server. If the responses match, it's a valid key.

I'm sure appending the same string on both sides to validate response isn't super secure... but I'm not expecting people trying to crack my software. It works well enough for me.
 
You should also protect your code from people tampering or easily cracking your licensing system - Visual Studio has a good obfuscator for .Net.
 
Check out Infralution. They have several products including a licensing system at very reasonable prices. I'm not associated with them and as a matter of fact, I'm looking at them for the very same reason you guys are. I'm looking to release a product very soon and I think this is the route that I'm going to go.
 
I suggest you to code your own and never use commercial ones because all of them are cracked and vulnerable...


cheers..
 
I decided to just do a webrequest to my sites login form instead
 
Back
Top