• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Program will expire x days

 
Ranch Hand
Posts: 97
C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I'm creating an program in java, in that I need put it for expire.
Any ideas ?

Thanks a lot!
 
Ranch Hand
Posts: 41
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some sort of encrypted file with a timer, maybe. Like, you save the number of days left in a file, so it stays there even when the computer shuts down. But encrypted, so you can't edit it.
 
Gustavo Siqueira
Ranch Hand
Posts: 97
C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But, as I can do this ?
 
Jj Hill
Ranch Hand
Posts: 41
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.roseindia.net/java/beginners/java-write-to-file.shtml shows how to save a file. I have a better way to do it - get the date that the program was first downloaded at, save that in the file, then get the current date when the program is opened. Then find how many days are in between and if that amount exceeds your "x" amount of days, disallow access to the program functions.
 
Saloon Keeper
Posts: 14682
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That way won't work at all. Nothing prevents the user from just discarding the file. To make it harder, you can save the data in a hard to find place, like a hidden folder, or the Windows registry, but this won't work against someone who's determined to circumvent your timer.

To make it more reliable, you can try to save the data on a server, by mapping the user's IP address to the time of installation. This can be circumvented using proxy servers however.
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Stephan.

I thought about almost all other options mentioned here, but could not think a way to prevent user from changing the date. E.g. even if someone puts the installation date in a file and encrypt it and put it in secrete place and all, what if user manually changes the date before running the program? It would never expire.

Now, this 'synchronizing time from server' thing would work here

Any idea how to do it problematically? Thanks in advance.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Who will be using your application? For example, if your clients are primarily corporations, your implementation does not need to be very secure. Corporations generally cannot afford (or genuinely do not want to) to use unlicensed software.

If, on the other hand, you plan to offer your application "in the wild" and your application is so splendid that it is worth to be hacked, it will be hacked. It will happen. The best protection I can think about would be to set up a 7/24 server and have your users authenticate online against that server whenever using that application, but even this can be circumvented either by modifying the application, or by setting up a fake authentication server somewhere.

I believe the best approach is implementing a remainder that will not bother so much to make someone expend the effort to remove it. That way, even if your application is pirated, the users will know the author and some of them might actually pay for your app.
 
Jj Hill
Ranch Hand
Posts: 41
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The best protection I can think about would be to set up a 7/24 server


You're right, but not everyone has a server.
 
reply
    Bookmark Topic Watch Topic
  • New Topic