Question How to add a product key / activation code to prevent piracy or illegal copies?

Engicoder13

New member
Joined
May 29, 2021
Messages
4
Programming Experience
3-5
Does anybody know how I can add a product key / activation code to my Visual C# application to prevent people from making illegal copies of it?
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
3,122
Location
Chesapeake, VA
Programming Experience
10+
Unless you know what you are doing with regards to anti-cracking, rolling your own solution will be a waste of time at best, and a so a better cost of action would to be to use a well reviewed and battle proven library. And even then, a determined attacker would still likely be able to get around those defenses, but most attackers will likely move on to easier prey. On the other hand, if your goal is to just deter casual piracy where one "friend" hands a copy to another "friend" along with their keys, then go ahead roll your own. There are a few good StackOverflow posts regarding this with some well thought out answers on doing the key generation and validation. If you are paying attention to their discussions, you will likely avoid the common mistakes made.
 

Sheepings

Well-known member
Joined
Sep 5, 2018
Messages
2,038
Programming Experience
10+
A year on, I highly recommend using an API for your software to talk too. Do all your checking on the server side app. Give your client app a client for receiving command messages. I think protecting your keys is easy to do. Not so easy to protect your code yet though.
 

Engicoder13

New member
Joined
May 29, 2021
Messages
4
Programming Experience
3-5
Unless you know what you are doing with regards to anti-cracking, rolling your own solution will be a waste of time at best, and a so a better cost of action would to be to use a well reviewed and battle proven library. And even then, a determined attacker would still likely be able to get around those defenses, but most attackers will likely move on to easier prey. On the other hand, if your goal is to just deter casual piracy where one "friend" hands a copy to another "friend" along with their keys, then go ahead roll your own. There are a few good StackOverflow posts regarding this with some well thought out answers on doing the key generation and validation. If you are paying attention to their discussions, you will likely avoid the common mistakes made.
Thanks for your reply and yes, I am trying to deter casual piracy. My app is just a game and I am planning to put it on sale at a cheap price but I would like to prevent piracy anyways as much as possible. I will go check out StackOverflow and see what I can do. Thanks again.
 

Engicoder13

New member
Joined
May 29, 2021
Messages
4
Programming Experience
3-5
A year on, I highly recommend using an API for your software to talk too. Do all your checking on the server side app. Give your client app a client for receiving command messages. I think protecting your keys is easy to do. Not so easy to protect your code yet though.
Thanks for your reply, I will check on this as well.
 
Top Bottom