DotNetShannon wrote:
Otis,
What do you recommend? How would you store the public key?
Just in your assembly.
It works as follows:
- encrypted with PRIVATE key is decryptable with PUBLIC key
- encrypted with PUBLIC key is decryptable with PRIVATE key.
so reading your public key is not making them able to create a signed xml file which is then read by your app, as public key encrypted messages aren't decryptable with the public key.
So, they then have to alter the assembly, for example to store their own public key. This then violates the signing, i.e.: they have to remove the signatures using ildasm -> to file -> remove signatures -> ilasm -> go, or add their own.
In your code, you then have at a lot of random places checks on the signature of the assembly. If thats still the same as the one initially added to the assembly, i.e.: your public token is still the public token of the assembly.
Do this in obscure code, not with a string compare against a string read from a resource file, but with obscure byte compare code which uses several code snippets accros the assembly. Also don't use a single routine, use the check code everytime, no calls to a single routine.
As I said before: if the check fails, simply do something like _membervar = null; or _membervar.Collection.Clear();
this is a very obvious statement and not suspicious to a person using reflector. However because of the action, the app fails, perhaps 5 minutes later. it's then almost impossible to track down where the error originated. If you make it obvious where the error originated, you can track down where the stack trace originates and thus find the check code. Then you can find the rest of the check code and your app is cracked.
To make life more hard for them, also obfuscate code. Program for obfuscation, thus make all forms, all methods of a .exe project internal or private. When you do that, an obfuscator will produce very horrible to read code (check the llblgen pro demo .exe assembly for example ).
It's then even harder to find the check code.
Though, if a cracker has too much time on his/her hands, it will be broken. Though: if your app is not something that has a very high 'coolness' factor and if it's hard to crack, no cracker will spend time on it.
Most copy protection breaches for professional software is done on the workplace: a co-worker has a license for app X and you want to use it too. You check a few things, if you can break it, cool, if you can't (i.e.: it takes 3 full days) you wont bother.