如何创建一个产品密钥我的C#应用​​程序? [英] How can I create a product key for my C# application?

查看:107
本文介绍了如何创建一个产品密钥我的C#应用​​程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建一个产品密钥我的C#应用​​程序?

我需要创建一个产品(或许可证)关键,我每年更新。此外,我需要创建一个试用版本。

  

相关报道:

     
      
  • <一个href="http://stackoverflow.com/questions/501988/how-do-i-best-obfuscate-my-c-product-license-verification-$c$c">How我最好的模糊我的C#产品许可证的验证code?
  •   
  • 基于Web的许可证激活
  •   
  • <一个href="http://stackoverflow.com/questions/109997/how-do-you-protect-your-software-from-illegal-distribution">How保护你的软件非法传播?
  •   
  • <一个href="http://stackoverflow.com/questions/118031/best-activation-key-software-for-net-application">Best激活密钥的软件.NET应用程序?
  •   
解决方案

您可以做一些像创建一个包含要验证的应用程序中的数据记录。这可以包括任何你想要的 - 例如,程序功能启用,有效期,姓名的用户(如果你想将其绑定到用户)。然后加密使用一些加密算法使用固定键或哈希它。然后,你只是你的程序中进行验证。分发许可文件(在Windows上)的一种方法是将它作为其更新注册表文件(保存不必键入它的用户)。

谨防虚假的安全感,但 - 迟早有人会简单地修补程序,以跳过检查和分发补丁的版本。或者,他们将制定出通过了所有检查钥匙和分发,或者回溯时钟等,这不要紧,你是如何错综复杂让你的计划,你做什么的,这将最终通过隐藏的安全,他们将永远能够将此。即使他们不能有人会,并分发入侵的版本。亦如即使你提供一个适配器 - 如果有人愿意,他们可以修补了检查这一点。数字签名的code不会帮助,他们可以删除该签名,或辞职了。

您可以通过使用技术,以prevent在调试器等运行程序问题复杂化了一点,但即使这不是防弹。所以,你应该只难以足够,一个诚实的用户不会忘记付钱。另外要非常小心,你的计划不会成为突兀给付费用户 - 最好是有一些扯掉副本比你的付费用户不能够使用他们已经支付了

另一种选择是有一个在线检查 - 只是提供了一个独特的ID的用户,并以该ID应该有什么样的能力在网上查询,并缓存了一段时间。所有相同的警告也适用,但 - 人们可以避开这样的事

也考虑不必处理谁也忘记了自己的钥匙,等用户的支持费用。

编辑:我只想补充,没有太多的时间在此投资或认为某种方式的令人费解的计划会有所不同,破解的。它不会,不能,只要人们控制程序运行于硬件和操作系统。开发商一直在试图想出这个越来越复杂的方案,认为如果他们开发自己的系统,它那么它将只知道他们,因此更安全。但它确实是编程相当于试图建立一个永动机。 : - )

How can I create a product key for my C# Application?

I need to create a product (or license) key that I update annually. Additionally I need to create one for trial versions.

Related:

解决方案

You can do something like create a record which contains the data you want to authenticate to the application. This could include anything you want - e.g. program features to enable, expiry date, name of the user (if you want to bind it to a user). Then encrypt that using some crypto algorithm with a fixed key or hash it. Then you just verify it within your program. One way to distribute the license file (on windows) is to provide it as a file which updates the registry (saves the user having to type it).

Beware of false sense of security though - sooner or later someone will simply patch your program to skip that check, and distribute the patched version. Or, they will work out a key that passes all checks and distribute that, or backdate the clock, etc. It doesn't matter how convoluted you make your scheme, anything you do for this will ultimately be security through obscurity and they will always be able to this. Even if they can't someone will, and will distribute the hacked version. Same applies even if you supply a dongle - if someone wants to, they can patch out the check for that too. Digitally signing your code won't help, they can remove that signature, or resign it.

You can complicate matters a bit by using techniques to prevent the program running in a debugger etc, but even this is not bullet proof. So you should just make it difficult enough that an honest user will not forget to pay. Also be very careful that your scheme does not become obtrusive to paying users - it's better to have some ripped off copies than for your paying customers not to be able to use what they have paid for.

Another option is to have an online check - just provide the user with a unique ID, and check online as to what capabilities that ID should have, and cache it for some period. All the same caveats apply though - people can get round anything like this.

Consider also the support costs of having to deal with users who have forgotten their key, etc.

edit: I just want to add, don't invest too much time in this or think that somehow your convoluted scheme will be different and uncrackable. It won't, and cannot be as long as people control the hardware and OS your program runs on. Developers have been trying to come up with ever more complex schemes for this, thinking that if they develop their own system for it then it will be known only to them and therefore 'more secure'. But it really is the programming equivalent of trying to build a perpetual motion machine. :-)

这篇关于如何创建一个产品密钥我的C#应用​​程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆