views:

324

answers:

5

I want to create a free trial of (30 days of) my software. I cant able to take the system time because it may be changed by the user.How I can calculate a Day in my system.

It's my task in this month . try a solution. in this week i have to submit the report in what way i am doing .Plz

I dont have internet connection.

+1  A: 

If you can't trust the system time, then logically you have to use a time from another system. You could contact an Internet-based time server of some kind, but then this will require Internet access, which not every PC has all the time. However, depending on what your application is, this may not be a problem.

David M
A: 

If you can't use the system time, set up a web page which tells the time and make sure your application connects to that web page whit HTTPS. Fail if the SSL certificate is wrong.

You can also make the web page more dynamic. The first time the user opens the application, give it a unique id number. The id can be saved (encrypted) on disk. Check the age of the id number on your server. If it's an invalid id (i.e., the user have tampered with it), fail the opening.

Emil Vikström
what if the system running the software doesn't have an internet connection.
JP Hellemons
If you can't trust the system time, you have to check something external from the system.
Emil Vikström
+1  A: 

I think, Patrick had a very good article on this topic in his blog,

Have a look at below link,

http://www.kalzumeus.com/2006/09/05/everything-you-need-to-know-about-registration-systems/

Thi
A: 

Since it is probable you'll distribute shareware over the internet, you can use a time server. It may be the case that the installation machine only has intermittent internet access, such as dial-up for instance. In this case, you can still log time tuples of (time-server time, local system time), and use the delta in system time as the increment to add to the last time a connection to a time-server could be made. It, like most strategies is not 100% secure, but 100% is beyond the optimum cost-benefit ratio anyway.

cjrh
+1  A: 

if you install the software get the system time and encrypt it (not with one way algorithm) and store it on the disk. when you startup the software get the systemtime again and verify it. but make sure that the current systemtime cannot be before the installation time. people can set back the time of their system. but i don't think a lot of people will do that every month. otherwise you can log each day the software get's started and verify agains that list of days :)

JP Hellemons
This breaks the basic requirements in the question, that we canät trust the system time.
Emil Vikström
but by storing the systemtime each startuptime you can validate if people set back the systemtime. by checking the current systemtime which can't be less then the previous one and can't be larger then the first launchtime + 30 days. there are not many other options if the pc running it does not have an internet/network connection
JP Hellemons