-
Product Activation
Hi, hope you can help.
I want to majke a program that will last for 30 days from the install date. Then the program will not function until the user registers or puts in an activation code I.e. Serial number & Company ... That kind of thing
Many thanks in advance
Stuart Jones
Network Manager
-
Re: Product Activation
Stuart, it really depends on how unbreakable you want to make the activation scheme... Any scheme put in place, can be cracked if someone with knowhow really wants to, so you have the weight the complexity of your copy protection against the thought of the chances someone tries to crack your program..
-
Re: Product Activation
Hi Thanks for the reply Kleinma, put it this way i dont want the application to be made for banks, just something that can be put into place.
-
Re: Product Activation
you could do something as simple as this:
when the program is run check for a given registry value.
If the value doesn't exist, then consider the application to be a "new install" and write the key to the registry that has the current date. Then subsequent openings of the app can read this value and determine if the app should run or not.
The obvious drawbacks are that anyone could potentially discover this registry location, and simply delete it and run the app again after it is expired, there are actually a large number of apps that work this way.
I would also encrypt the data so it is not human readable if it is found...
-
Re: Product Activation
Hi, well this activation bit is all new to me so do you know where i can find some examples of some sort
thanks in advance
stuart jones
-
Re: Product Activation
well mine was just a broad example that didn't really go into a ton of detail. There are so many ways to implement this that it is hard to really pinpoint an exact one to best suite your needs.
One thing I can tell you is this is not the first time this type of question has been asked, so try searching the .NET section of the forums and see what turns up.
-
Re: Product Activation
Well, here's a simple scheme. It involves a license file, and two pieces of data, possibly stored in the Registry:
Program starts and looks for the license file. If it finds one, it checks the license against a code, possible derived from machine hardware IDs, or possibly just purely mathematical. If it finds a matching file, it runs, no further checks required.
If it doesn't find a proper license, then it checks for Data1. Data1 could be stored in the registry and it's the encrypted date that the program was first run on. If it doesn't find it, then it creates it using today's date (since this is it's first run). If it's present, then it gets the date stored there.
Next it checks Data2. Data2 is also a date. It should be the date of the last time the program was run. If it's not present, then it is created using today's date. If it is present, it reads it.
Now, it gets today's date/time (Now). If Now <= (Data2 + 2 hours), then the user is most likely setting the clock on their computer back trying to fool your routine. This is a "SanityCheck" routine to catch would-be hackers. Set Data2 to 1/1/2199 so they won't be able to get back even if they fix their clock. Tell them they need to buy the program and exit the program.
If Now is not <= (Data2 + 2 hours), set Data2 to "Now" and move on.
Now compare Data1 >= (Now - 30days). If true, then they are within their 30-day evaluation. Give them a reminder, figure the days they have left, and let them use the program. If not, then tell them their trial has expired and exit the program.
Now, this method isn't the strongest by far as any good hacker will find where you have Data1 and Data2 and delete them to extend their trial, but if hidden correctly, even uninstalling and reinstalling the program won't reset Data1 and Data2 since they won't get erased with an uninstall.
A real hacker will just modify your check and evaluation of your license file to return "ok" for any condition, true or false.
This methodology though will stop 99% of even the fairly tech savvy of typical users, because won't want to go through the hassle of hunting down your hidden registry keys and constantly deleting them just to use your trial.