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!
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:
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.
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.
Rex is correct, internal sealed class
won't hide anything. Use a one-way encryption hash (e.g. MD5CryptoServiceProvider) to protect passwords and keys.