Where to save the activation key

I am using C # and have a key that the user enters to activate my program. I don't want the user to be able to see the key after entering it. Do you have any recommendations for preserving it?


source to share

5 answers

You can save the key as a separate file. Encrypt the key and save it. Therefore, even if the user tries to tamper with it, you can deactivate the application.

You may be interested in this project at codeplex: http://licenser.codeplex.com/

Edit: some questions for you.



Forget about trying to hide where you store your license key - you won't be able to stop certain users and you'll only piss with sysadmins if you try to store license information in weird places. Forget all about trying to save in your executable executable, it is difficult to do in a safe way and will cause a lot of antivirus programs.

If you want something that is protected from unauthorized access, go for one of the commercial solutions; sorry if that sounds tough, but you're not going to come up with anything that's even remotely difficult to break, given that you are asking such a question.



Of course you can store the Excutable resource key, its quite a long procedure, there are several APIs available like OpenResource, GetResourceData and UpdateResource, resources are not easily available if you don't have visual studio tools.

But you cannot change the resources of the executable that is currently running, but you can create another activation program that can load your main executable, change the resource, and save it.



Assuming a Windows computer is running your application, you can also use the registry to store an encrypted key (MD5 perhaps?).

Thus, it is not in a "file" that can be viewed by the user (although it can be viewed / modified / deleted by the user).
In my opinion, users (standard ...) generally don't look in the registry - you can hide your key.

Actually, the first link @Shoban where-should-i-store-my-applications-activation-key discusses this issue more - you should read it ...



I know this looks more like cryptographic keys, but what about the Windows key container ?



All Articles