user1071461
user1071461

Reputation:

Confirming system time

I'm trying to make a system that basically allows me to shove a DLL in an installation and some code in an exe that allows me to release all of my future programs as beta releases for a while.

Now the problem is of course if I'd want to do that, i'd need to choose until when the program is valid. Which is fine, except that by changing your system clock, you can easily bypass the system.

Now, I'd like to hear what people generally do for something like this. I've been trying a few approaches such as contacting a site to give the timestamp and compare that, which would be fine if it didn't always increase the program start time by over 9000 and and the fact that people would then not be able to use it if they're not connected to the internet.

Any suggestions are much appreciated.

Upvotes: 1

Views: 167

Answers (2)

Max
Max

Reputation: 7596

If your software can access some network share on some local server/nas, you can create a new file on this network share, and this file will have a creation time set using the clock of the server/nas, so you can compare the time set on the server/nas to the time of the local computer.

Or you can also save somewhere (a file, in the registry, in a DB) the last time of the last execution, and if the clock go back in time, then you can lock the application and require further assistance :-)

Upvotes: 0

Amar Palsapure
Amar Palsapure

Reputation: 9680

This is not 100% guaranteed solution but it will take you there

You will need to implement these things in the config file (Why Config file, because if user deletes it your app won't run). Also encrypt all the following data.

  • Store the Date and Time on which application ran.
  • Store the exact amount of time for which application ran.

By doing so you can avoid:

  • If user change the computer time, you will come to know that, as your app is logging Date and Time, it might overlap the earlier time, say user ran app on 6th and 10th of month, and then he reverts date to 7th, you will come to know about it.
  • Secondly user can change the date on every run to single date, in that case the total duration used will help you. Say user set date to 1st of month every time he runs it, in that case, he can use app for 24 Hrs only not more than that.

Other options like

  • Checking time from External Server (Flaw: Requires internet access)
  • Storing Time in Registry (Flaw: User can easily manipulate registry)

Hope this helps you.

Upvotes: 1

Related Questions