Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I best obfuscate my C# product license verification code?

Tags:

c#

.net

How do I best obfuscate my C#.net app Product Key verification code?

Is it enough to place it in a "INTERNAL SEALED CLASS CLASSNAME { };" or do I need to do more?

Thanks!

like image 803
J3r3myK Avatar asked Feb 02 '09 01:02

J3r3myK


People also ask

Is there a good obfuscator for any source code?

Although obfuscation can make reading and reverse-engineering a program difficult and time-consuming, it doesn't make it impossible. It's important to keep in mind that while code obfuscation does a good job of obscuring source code, there's no obfuscator that guarantees maximum security.

How do you obfuscate in Objective C?

There is no easy way to do code obfuscation in Objective-C. It is possible, but be ready to be extremely limited in how you do your development. There are plenty of posts on the subject if you search for them on StackOverflow or your favorite search engine. You might wish to look at PPiOS-Rename.

Is it possible to obfuscate code completely?

While obfuscation can make reading, writing, and reverse-engineering a program difficult and time-consuming, it will not necessarily make it impossible. It adds time and complexity to the build process for the developers.


2 Answers

Access modifiers like internal and sealed don't have anything to do with obfuscation or code security, they just tell other classes how to interact (or not interact) with them.

At the end of the day, there's nothing you can do to prevent piracy. Anything created by one human can be broken by another. There are loads of questions on SO that deal with product keys, keeping software secure, etc. which you can find if you use the search mechanism in the upper-right. All the answers cover a few basic ideas that anyone with a little sense will tell you:

  1. Only put enough effort into your anti-piracy measures to make cracking the software a little less convenient than breaking out the credit card. If that's really hard to do, you are charging way too much for your customer base.
  2. If you focus on building positive relationships with your customers instead of assuming they are criminals, they will be more willing to give you money.
  3. Most customers - individuals and especially companies - don't have any interest in cracking open your assemblies and trying to figure out how to get away with not paying you. For individuals, they wouldn't pay for it anyway so you're not losing a sale; and companies wouldn't risk mountains of cash in legal problems for the cost of some software licenses.

Research public/private and elliptic key cryptography and you'll find ways to secure your key algorithm, but it will only prevent cracking the key, not bypassing it.

like image 93
Rex M Avatar answered Nov 02 '22 06:11

Rex M


I agree with Rex M, you should consider using an asymmetric encryption algorithm such as elliptic curves cryptography to avoid keygens. And if you are interested in a commercial solution then try Ellipter - it uses elliptic curves and has some useful features like product info and expiration data embedding into generated serial keys.

like image 23
Roland Avatar answered Nov 02 '22 04:11

Roland