How can you make your software expire after certain Days ??

Hello All,

I have an application which I want to expire after the trial period and only works after you eneter the key.

Any suggestions, piece of code which I can use to secure my application.

Thanks,

Harsimrat



Answer this question

How can you make your software expire after certain Days ??

  • szelee

    Hello Ryan,

    Can you please tell me how can I store in Config File....I'm using Net 2.0......This is first time I'm doing something like this.....


  • MarioMurillo

    Eduardo is right. Anyone with enough time, tools, $$, and skills can decompile your app. The trick is making it hard enough that it's not worth the time or hassle to do it.

    If you really care, then you need to obfuscate your code. There are several free and commercial obfuscation tools on the market. Some of the commercial products are:

    As far as the time bomb for your software, I would probably add a file to the project where I would store an encrypted phrase to denote that the software had not ran yet. I would add code to check this file when the application started up. If the "has not run" phrase is there, I would replace it with a time and date (encrypted). If the software had been run previously (time and date exists) I would test it against the current date. Once your time period has run out, direct the user to "trial expired form".

    If you're using .Net 2.0, you could store this info in a config file, just encrypt the value.

    There is also a Shareware Starter Kit at http://msdn.microsoft.com/vstudio/downloads/starterkits/ and it's support page is at http://www.sharewarestarterkit.com/.

    - Ryan


  • Ratheesh

    Well, you need to store the date the software was installed, that date needs to stay if someone does an uninstall, and then you may want to write some code that detects if users have been playing with the system date.

    As for entering a key, you have all sorts of options there. Do you want a key tied to a machine Do you want to generate a response key



  • SteveInHampshire

    You store it where-ever you choose. The config file is obviously a bad idea, the registry is a better one, but even then, you want to obsfucate it a bit, so that users don't find it. I've been known to store it in files I place in the System32 folder, but I'm not recommending that.

    You store the date every time the program is run, and if it ever goes backwards, then someone played with the date.

    The trial version can generate machine info and give it to you as a key, which you then use to generate the response key, so you end up with a pair, and one won't work without hte other, nor will it work on a different machine.

    To be honest, it's literaly years since I wrote any keygen code, I don't have a sample to offer.



  • trknssr

    no matter what you do, white a decompiler anyone can view you code and find a way to crack you .net program.
  • MrWebber

    Thing is 70% wont be able to crack...30% will....so lets get something from that 70%....
  • James Collett

    Hello cgraus,

    Thanks for the quick response.

    When you say save the date the software was installed, where to save all that information, and secondly how can you detect if someone changed the system date......

    Entering key basically when user downloads the software or buys the full version matbe generate from the persons name or so on as at that point wont have any machine information....

    If you can give me a small piece of code, how to do it and this is the first time I will do something like this.......

    Thanks,

    Harsimrat


  • How can you make your software expire after certain Days ??