views:

52

answers:

3

Hi,

I have an application which license should expire after some period of time.

I can check the time in the applicatino against the system time, but system time can be changed by the administrator, therefore it's not a good idea to check against the system time in my opinion.

What alternatives do I have?

Thank you

+2  A: 

You could check against an online NTP server or, alternatively, at every run, note how many days have elapsed on the system clock. If they ever set this back before the time you know has currently elapsed, it will be obvious and you will know they are trying to cheat.

Martin Eve
I have considered this, but few copies of the app will run on internal network without WAN connection...
vikp
+1  A: 

I'd say that forcing the user to run with the wrong date set would be enough deterent for most people. However, you could always combine it by storing the last run date in the registry and every time you compare that with today's date, if the the last run date is higher than today's date they've probably reset the date. There could be legit reasons for this though so you might want to have a check that you only disable the software after this has been done x number of times or similar.

ho1
+1  A: 

you can use a counter so the user can use the software n times

anotherway is that you store the start- and enddate of the user starting the application. If the user starts the application another time, you check against it.

Another way is to always check with an online server.

Patrick Säuerl
"anotherway is that you store the start- and enddate of the user starting the application. If the user starts the application another time, you check against it."-- how is he supposed to know the endtime without checking against the system clock?
Martin Eve
For example, I log in 01/01/2010 at 09:00 - store in registry.The next time I change the date to 01/01/2010 and log in at 09:01 - store in registry. This will still work...
vikp
he still hast to check against the system time clock.the idea behind this suggestion is that the user can´t reset the time to a date before he used the applicationfor instance: i ran the programm on 03/01/2010 at 09:00 till 03/01/2010 12:00 i can´t change the date back to 03/01/2010 09:01 because the programm was at use at 03/01/2010 12:00
Patrick Säuerl