C#: How to Make it Harder for Hacker/Cracker to Get Around or Bypass the Licensing Check?
c#, licensing
Solution
The #1 law of software licensing: You don't control your software once you allow it to be installed on a computer you don't control.
If you want to keep control over your code, you need to make it a web service and give the end user just a thin client that interfaces to that web service.
In many scenarios, this is unacceptable, because users want to be able to use their software even when they don't have an internet connection.
In almost all cases, you should focus on making the user experience better, and all forms of copy protection make it worse instead. Once you get to the point where the experience of downloading from a warez site and running it through several virus scans is better than doing the license setup for the legit version, you've lost.
Problem
First of all, I understand that almost all applications can be cracked (especially written in C#). My question here is to make it a little bit harder to crack. Suppose that the user has saved the License file under the Application.StartupPath, where all users can read. And then, every time when the application starts, it will check if it can find and verify the license file. If the application can find and verify, we let the user to continue with full functionalities. If not, we prompt a MessageBox showing "Unlicensed, continue to use with trial version, functionalities limited." My question is, if I'm a hacker/cracker, I would try to get around or bypass the licensing check instead of cracking the license file, because, if we use RSA signature, it's very difficult to crack a license file. So where should we put the license check? P.S.: and also, is it safe if I put a global variable IsLicensed (true / false) to limit the functionalities? Is it easy for a hacker to change IsLicensed = true?