0

I'm making a C# (winforms) app that I want user to be able to execute only for a defined number of times (say 100 times). I know its possible to add an xml or a text file to store a count but that would be easy to edit or "crack"... is their any way to embed the counter in the code or maybe any other way that might not be easy to crack? and that its also easy later to "update" the membership for another period of 100 executions?

Thanks in advance

4 Answers4

5

There are lots of ways to store a variable. As you've noted, you can write it to a text or xml file. You could write it to the Registry. You could encrypt it and write it in a file somewhere.

Probably the most secure method is to write it on a server and have the application "call home" whenever it wants to run.

Preventing copying is a difficult balancing act - treat your legitimate customers too much like criminals and they'll leave you.

Dan Pichelman
  • 2,312
  • 2
  • 31
  • 42
0

If you're talking about memberships, your application may be web connected. If that is the case, you could verify the instance against a web service on your server that holds and increments the count and issues a "OK/Not OK to run" reply.

If you don't want to do this, I have heard of an application that uses steganography to hide relevant details in certain files - you could hide your count in some of your image resources.

Monty Wild
  • 3,981
  • 1
  • 21
  • 36
0

Create multiple files containing the counter or the number of times your app will run. Name these files with different file names and store it in different location so that it will be hard to locate,delete and crack by user. The reason why it is not just one file because if the user found one of your file and alter or delete it, you still have other files which contains the valid information about your app.

Kyle Kanos
  • 3,257
  • 2
  • 23
  • 37
Jervie Vitriolo
  • 398
  • 5
  • 17
0

If your application is a commercial product it might be worth to have a look at security products from other commercial vendors like SafeNet.com, for example.

A few years ago I used the HASP HL hardlock for a project, which worked just fine.

They offer hardware dongles for software protection as well as software based protection (using authentication services over the internet), and combinations of both.

Their products allow for very fine grained control of what you want to allow your users, e.g. how many times an application may be started before it expires (which would be just what you want) or time-expiration, or feature packages, or any combination of it all.

The downside is, that they have very "healthy" licensing prices. If this is worth it will depend on the size and price of your own application.

Jens H
  • 4,590
  • 2
  • 25
  • 35