如何最好地混淆我的 C# 产品许可证验证码?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/501988/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 05:50:37  来源:igfitidea点击:

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

c#.net

提问by J3r3myK

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

如何最好地混淆我的 C#.net 应用程序产品密钥验证码?

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

把它放在“INTERNAL SEALED CLASS CLASSNAME { };”就够了吗?还是我需要做更多?

Thanks!

谢谢!

采纳答案by Rex M

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

访问修饰符喜欢internal并且sealed与混淆或代码安全没有任何关系,它们只是告诉其他类如何与它们交互(或不交互)。

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:

归根结底,您无能为力来防止盗版。一个人创造的任何东西都可以被另一个人打破。有很多关于 SO 的问题涉及产品密钥、保持软件安全等。如果您使用右上角的搜索机制,您可以找到这些问题。所有的答案都涵盖了一些稍微有点常识的人都会告诉你的一些基本想法:

  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.
  1. 只要在你的反盗版措施上付出足够的努力,让破解软件比破解信用卡更不方便。如果这真的很难做到,那么您对客户群的收费就太多了。
  2. 如果您专注于与客户建立积极的关系而不是假设他们是罪犯,他们将更愿意给您钱。
  3. 大多数客户 - 个人,尤其是公司 - 对打开您的组件并试图弄清楚如何不付钱给您没有任何兴趣。对于个人而言,他们无论如何都不会为此付费,因此您不会失去销售;并且公司不会因为某些软件许可证的成本而冒着因法律问题而面临大量现金的风险。

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

研究公钥/私钥和椭圆密钥密码学,您将找到保护密钥算法的方法,但它只能防止破解密钥,而不能绕过它。

回答by Bob Nadler

Rexis correct, internal sealed classwon't hide anything. Use a one-way encryption hash (e.g. MD5CryptoServiceProvider) to protect passwords and keys.

雷克斯是对的,internal sealed class不会隐藏任何东西。使用单向加密哈希(例如MD5CryptoServiceProvider)来保护密码和密钥。

回答by Roland

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 M,您应该考虑使用非对称加密算法(例如椭圆曲线密码术)来避免密钥生成。如果您对商业解决方案感兴趣,请尝试Ellipter- 它使用椭圆曲线并具有一些有用的功能,例如产品信息和嵌入到生成的序列密钥中的到期数据。