6

I have a C# program that I would like to sell and I want to offer a 14 day trial, I understand that all piracy prevention schemes are overcome so I don't want to waste much time doing this. Could anyone offer any suggestion and even some sample code?

Thanks

0

9 Answers 9

7

My choice would be to store the date of the install (encrypted with a key) in the registry or config file. Look at this each time the application starts.

You can protect your app.config file using something like the RsaProtectedConfigurationProvider .

Obviously if they decompile the source they'll find the key in it, obfuscating might help this a bit, or using public/private key but that is probably an overkill for what you need.

4
  • Couldn't they just delete the key entry from the registry?
    – GONeale
    Jan 6, 2009 at 1:00
  • Nevermind, the program should check that a valid encrypted key exists in the registry first, or then terminates.
    – GONeale
    Jan 6, 2009 at 1:02
  • 1
    How could you decrypt the code without having the private key in the program? Wouldn't they see it if they decompile just the same way as if you don't use public / private keys?
    – Juan
    Dec 6, 2010 at 9:57
  • @JuanLuisSoldi you can disguise the decryption code in Runtime to make it difficult to follow you decryption algorithm or methodology Sep 21, 2012 at 11:27
6

A thief can always turn back the clock to within 14 days of the install, as well as virtualization to achieve the same end. Can you count on net access and have the program phone home for a key?

HASP is one company that does this full time.

Also, depending on factors such as the size of your target market, your purchase price, your competition, and the ecosystem you're selling to, you might consider that some amount of priracy might be your best marketing tool. Which is the greater risk: that your software is widely pirated, or that your software is lost in the noise and few ever even try it? Some software allegedly owes it success to wide spread piracy (WordStar, dBase, Lotus 1-2-3, iirc). A quick google shows that Chapter 13 of "in search of stupidity" touches on this.

It's a tough question, good luck.

4

Store the date of the install encryped as mentioned.

Also store todays date every time the app starts. If the day suddenly has gone back in time, you know they've cheaten and you close the program.

3

I would use .NET Reactor over at www.eziriz.com

3

Just do a nag screen if it's not registered. People are going to steal your software, whether you like it or not. Wasting time on a copy protection system is just going to make it more frustrating when people steal your software.

A gentle reminder that it's still in the trial stage will probably suit you better, ala WinRar.

1

Only save way of doing this would insult an online registration of the software, to one of you servers. The software should generate an id on install with fixed system ids used, so the server may identify the software on that system.

Well, I would recommend not to build a trial version, but a free version with limited functionality.

1

Honestly since you are using C# i'd say don't waste time on licensing. If someone wants your program without paying, they will simply open it up with any IL reader and remove your licensing system or just nop it.

As another user said make a free version with limited functinality. Sell the full version hope it's not spreaded too fast on torrent sites.

Or simply remake your application in another language e.g. c++ and use a licensing system that has to connect to a server. Making it slightly harder to reverse engineer.

Just take notice that whenever your program becomes somewhat popular it will be hacked/cracked.

Simply rely on the honest people or people who use it commercialy and cannot afford to "get caught" using illegal software.

EDIT* Someone said to use .NET Reactor over at www.eziriz.com If it works as advertised this will only stop people to easily read your code. It won't stop people to reverse engineer it and hack it anyway. The question is how much do you want to pay for protection? (This is basically rewriting it in another programming language only you pay for it. (less time consuming though), again does it work as advertised?)

0

If you do not want to waste time in designing a licensing scheme, consider a ready-to-use system like CryptoLicensing - it supports X day trials among other things.

DISCLAIMER: I work for LogicNP Software, the developers of CryptoLicensing.

-1

To get the present 'Time' in C you have to use the header file stdlib.h and the function:

system("echo %time%");

Program:

main(){
  system("echo %time%");
  getch();
}
1
  • This is an answer relating to C and not C#, how do you think this will help the person who asked the question?
    – DavidG
    Nov 18, 2015 at 13:27