简体   繁体   English

如何生成和验证软件许可证密钥?

[英]How to generate and validate a software license key?

I'm currently involved in developing a product (developed in C#) that'll be available for downloading and installing for free but in a very limited version.我目前正在开发一个产品(用 C# 开发),可以免费下载和安装,但版本非常有限。 To get access to all the features the user has to pay a license fee and receive a key.要访问所有功能,用户必须支付许可费并获得密钥。 That key will then be entered into the application to "unlock" the full version.然后将该密钥输入应用程序以“解锁”完整版本。

As using a license key like that is kind of usual I'm wondering:由于使用这样的许可证密钥很常见,我想知道:

  1. How's that usually solved?一般是怎么解决的?
  2. How can I generate the key and how can it be validated by the application?如何生成密钥以及如何通过应用程序对其进行验证?
  3. How can I also avoid having a key getting published on the Internet and used by others that haven't paid the license (a key that basically isn't "theirs").我怎样才能避免密钥在 Internet 上发布并被未支付许可证的其他人使用(密钥基本上不是“他们的”)。

I guess I should also tie the key to the version of application somehow so it'll be possible to charge for new keys in feature versions.我想我也应该以某种方式将密钥与应用程序的版本联系起来,这样就可以对功能版本中的新密钥收费。

Anything else I should think about in this scenario?在这种情况下我还应该考虑什么?

Caveat: you can't prevent users from pirating, but only make it easier for honest users to do the right thing.警告:你不能阻止用户盗版,而只能让诚实的用户更容易做正确的事情。

Assuming you don't want to do a special build for each user, then:假设您不想为每个用户进行特殊构建,则:

  • Generate yourself a secret key for the product为自己生成产品的密钥
  • Take the user's name取用户名
  • Concatentate the users name and the secret key and hash with (for example) SHA1将用户名和密钥以及哈希与(例如)SHA1 连接起来
  • Unpack the SHA1 hash as an alphanumeric string.将 SHA1 哈希解包为字母数字字符串。 This is the individual user's "Product Key"这是个人用户的“产品密钥”
  • Within the program, do the same hash, and compare with the product key.在程序中,做同样的散列,并与产品密钥进行比较。 If equal, OK.如果相等,OK。

But, I repeat: this won't prevent piracy但是,我再说一遍:这不会阻止盗版


I have recently read that this approach is not cryptographically very sound.我最近读到这种方法在密码学上不是很合理。 But this solution is already weak ( as the software itself has to include the secret key somewhere ), so I don't think this discovery invalidates the solution as far as it goes.但是这个解决方案已经很弱了(因为软件本身必须在某处包含密钥),所以我认为这个发现并没有使解决方案无效。

Just thought I really ought to mention this, though;不过,我只是觉得我真的应该提到这一点; if you're planning to derive something else from this, beware.如果您打算从中获得其他东西,请注意。

There are many ways to generate license keys, but very few of those ways are truly secure.生成许可证密钥的方法有很多,但真正安全的方法很少。 And it's a pity, because for companies, license keys have almost the same value as real cash.很遗憾,因为对于公司而言,许可证密钥的价值几乎与真实现金相同。

Ideally, you would want your license keys to have the following properties:理想情况下,您希望许可证密钥具有以下属性:

  1. Only your company should be able to generate license keys for your products, even if someone completely reverse engineers your products (which WILL happen, I speak from experience).只有您的公司应该能够为您的产品生成许可证密钥,即使有人完全对您的产品进行逆向工程(这会发生,我根据经验说)。 Obfuscating the algorithm or hiding an encryption key within your software is really out of the question if you are serious about controlling licensing.如果您认真对待控制许可,那么在您的软件中混淆算法或隐藏加密密钥真的是不可能的。 If your product is successful, someone will make a key generator in a matter of days from release.如果您的产品成功,那么在发布后几天内就会有人制作密钥生成器。

  2. A license key should be useable on only one computer (or at least you should be able to control this very tightly)许可证密钥应该只能在一台计算机上使用(或者至少您应该能够非常严格地控制它)

  3. A license key should be short and easy to type or dictate over the phone.许可证密钥应该简短且易于通过电话输入或口述。 You don't want every customer calling the technical support because they don't understand if the key contains a "l" or a "1".您不希望每个客户都致电技术支持,因为他们不知道密钥是包含“l”还是“1”。 Your support department would thank you for this, and you will have lower costs in this area.您的支持部门会为此感谢您,您将在这方面降低成本。

So how do you solve these challenges ?那么您如何解决这些挑战呢?

  1. The answer is simple but technically challenging: digital signatures using public key cryptography.答案很简单,但在技术上具有挑战性:使用公钥加密的数字签名。 Your license keys should be in fact signed "documents", containing some useful data, signed with your company's private key.您的许可证密钥实际上应该是签名的“文档”,其中包含一些有用的数据,并使用您公司的私钥签名。 The signatures should be part of the license key.签名应该是许可证密钥的一部分。 The product should validate the license keys with the corresponding public key.产品应使用相应的公钥验证许可证密钥。 This way, even if someone has full access to your product's logic, they cannot generate license keys because they don't have the private key.这样,即使有人可以完全访问您的产品逻辑,他们也无法生成许可证密钥,因为他们没有私钥。 A license key would look like this: BASE32(CONCAT(DATA, PRIVATE_KEY_ENCRYPTED(HASH(DATA)))) The biggest challenge here is that the classical public key algorithms have large signature sizes.许可证密钥看起来像这样: BASE32(CONCAT(DATA, PRIVATE_KEY_ENCRYPTED(HASH(DATA)))) 这里最大的挑战是经典的公钥算法有很大的签名大小。 RSA512 has an 1024-bit signature. RSA512 具有 1024 位签名。 You don't want your license keys to have hundreds of characters.您不希望您的许可证密钥有数百个字符。 One of the most powerful approaches is to use elliptic curve cryptography (with careful implementations to avoid the existing patents).最强大的方法之一是使用椭圆曲线密码术(谨慎实施以避免现有专利)。 ECC keys are like 6 times shorter than RSA keys, for the same strength. ECC 密钥比 RSA 密钥短 6 倍,强度相同。 You can further reduce the signature sizes using algorithms like the Schnorr digital signature algorithm (patent expired in 2008 - good :) )您可以使用 Schnorr 数字签名算法等算法进一步减小签名大小(专利于 2008 年到期 - 好:))

  2. This is achievable by product activation (Windows is a good example).这可以通过产品激活来实现(Windows 就是一个很好的例子)。 Basically, for a customer with a valid license key, you need to generate some "activation data" which is a signed message embedding the computer's hardware id as the signed data.基本上,对于拥有有效许可证密钥的客户,您需要生成一些“激活数据”,它是嵌入计算机硬件 ID 作为签名数据的签名消息。 This is usually done over the internet, but only ONCE: the product sends the license key and the computer hardware id to an activation server, and the activation server sends back the signed message (which can also be made short and easy to dictate over the phone).这通常是通过 Internet 完成的,但只有一次:产品将许可证密钥和计算机硬件 ID 发送到激活服务器,然后激活服务器发回已签名的消息(也可以使消息简短且易于指示)电话)。 From that moment on, the product does not check the license key at startup, but the activation data, which needs the computer to be the same in order to validate (otherwise, the DATA would be different and the digital signature would not validate).从那一刻起,产品在启动时不再检查许可证密钥,而是检查激活数据,这需要计算机相同才能验证(否则,DATA 将不同,数字签名将无法验证)。 Note that the activation data checking do not require verification over the Internet: it is sufficient to verify the digital signature of the activation data with the public key already embedded in the product.请注意,激活数据检查不需要通过 Internet 验证:使用已嵌入产品中的公钥验证激活数据的数字签名就足够了。

  3. Well, just eliminate redundant characters like "1", "l", "0", "o" from your keys.好吧,只需从您的键中消除诸如“1”、“l”、“0”、“o”之类的冗余字符。 Split the license key string into groups of characters.将许可证密钥字符串拆分为字符组。

Simple answer - No matter what scheme you use it can be cracked.简单的回答——无论你使用什么方案都可以破解。

Don't punish honest customers with a system meant to prevent hackers, as hackers will crack it regardless.不要用旨在防止黑客的系统惩罚诚实的客户,因为无论如何黑客都会破解它。

A simple hashed code tied to their email or similar is probably good enough.与他们的电子邮件或类似内容相关联的简单散列代码可能就足够了。 Hardware based IDs always become an issue when people need to reinstall or update hardware.当人们需要重新安装或更新硬件时,基于硬件的 ID 总是会成为一个问题。

Good thread on the issue: http://discuss.joelonsoftware.com/default.asp?biz.5.82298.34关于这个问题的好帖子: http : //discuss.joelonsoftware.com/default.asp?biz.5.82298.34

When generating the key, don't forget to concatenate the version and build number to the string you calculate the hash on.生成密钥时,不要忘记将版本和构建号连接到您计算散列的字符串。 That way there won't be a single key that unlocks all everything you ever released.那样的话,就没有一个钥匙可以解锁您发布的所有内容。

After you find some keys or patches floating in astalavista.box.sk you'll know that you succeeded in making something popular enough that somebody bothered to crack.当您在astalavista.box.sk 中找到一些密钥或补丁后,您就会知道您成功地制作了一些足够受欢迎的东西,以至于有人不屑于破解。 Rejoice!麾!

Besides what has already been stated....除了已经说过的......

Any use of .NET applications are inherently breakable because of the intermediate language issues.由于中间语言问题,.NET 应用程序的任何使用本质上都是易损坏的。 A simple disassembly of the .NET code will open your product to anyone. .NET 代码的简单反汇编将向任何人开放您的产品。 They can easily bypass your licensing code at that point.那时他们可以轻松绕过您的许可代码。

You can't even use hardware values to create a key anymore.您甚至不能再使用硬件值来创建密钥。 Virtual machines now allow someone to create an image of a 'licensed' machine and run it on any platform they choose.虚拟机现在允许某人创建“许可”机器的映像并在他们选择的任何平台上运行它。

If it's expensive software there are other solutions.如果是昂贵的软件,还有其他解决方案。 If it's not, just make it difficult enough for the casual hacker.如果不是,就让它对普通黑客来说足够困难。 And accept the fact that there will be unlicensed copies out there eventually.并接受最终会有未经许可的副本的事实。

If your product is complicated, the inherent support issues will be create some protection for you.如果您的产品很复杂,那么固有的支持问题将为您提供一些保护。

I'm one of the developers behind the Cryptolens software licensing platform and have been working on licensing systems since the age of 14. In this answer, I have included some tips based on experience acquired over the years.我是Cryptolens软件许可平台背后的开发人员之一,从 14 岁起就一直在研究许可系统。在这个答案中,我根据多年来获得的经验提供了一些技巧。

The best way of solving this is by setting up a license key server that each instance of the application will call in order to verify a license key.解决此问题的最佳方法是设置一个许可证密钥服务器,应用程序的每个实例都会调用该服务器以验证许可证密钥。

Benefits of a license key server许可证密钥服务器的好处

The advantages with a license key server is that:许可证密钥服务器的优势在于:

  1. you can always update or block a license key with immediate effect.您可以随时更新或阻止许可证密钥并立即生效。
  2. each license key can be locked to certain number of machines (this helps to prevent users from publishing the license key online for others to use).每个许可证密钥可以锁定到一定数量的机器上(这有助于防止用户在线发布许可证密钥供其他人使用)。

Considerations注意事项

Although verifying licenses online gives you more control over each instance of the application, internet connection is not always present (especially if you target larger enterprises), so we need another way of performing the license key verification.尽管在线验证许可证可以让您更好地控制应用程序的每个实例,但互联网连接并不总是存在(特别是如果您的目标是大型企业),因此我们需要另一种执行许可证密钥验证的方法。

The solution is to always sign the license key response from the server using a public-key cryptosystem such as RSA or ECC (possibly better if you plan to run on embedded systems).解决方案是始终使用公钥密码系统(例如 RSA 或 ECC)对来自服务器的许可证密钥响应进行签名(如果您计划在嵌入式系统上运行可能更好)。 Your application should only have the public key to verify the license key response.您的应用程序应该只有公钥来验证许可证密钥响应。

So in case there's no internet connection, you can use the previous license key response instead.因此,如果没有 Internet 连接,您可以改用以前的许可证密钥响应。 Make sure to store both the date and the machine identifier in the response and check that it's not too old (eg. you allow users to be offline at most 30 days, etc) and that the license key response belongs to the correct device.确保在响应中存储日期机器标识符,并检查它是否太旧(例如,您允许用户最多离线 30 天等)以及许可证密钥响应是否属于正确的设备。

Note you should always check the certificate of license key response, even if you are connected to the internet), in order to ensure that it has not been changed since it left the server (this still has to be done even if your API to the license key server uses https)请注意,您应该始终检查许可证密钥响应的证书,即使您已连接到 Internet),以确保它在离开服务器后未被更改(即使您的 API 到许可证密钥服务器使用 https)

Protecting secret algorithms保护秘密算法

Most .NET applications can be reverse engineered quite easily (there is both a diassembler provided by Microsoft to get the IL code and some commercial products can even retrieve the source code in eg. C#).大多数 .NET 应用程序都可以很容易地进行逆向工程(Microsoft 提供了一个反汇编程序来获取 IL 代码,一些商业产品甚至可以在例如 C# 中检索源代码)。 Of course, you can always obfuscate the code, but it's never 100% secure.当然,您可以随时混淆代码,但它永远不会 100% 安全。

I most cases, the purpose of any software licensing solution is to help honest people being honest (ie that honest users who are willing to pay don't forget to pay after a trial expires, etc).在大多数情况下,任何软件许可解决方案的目的都是帮助诚实的人诚实(即愿意付费的诚实用户不要忘记在试用期到期后付费等)。

However, you may still have some code that you by no means want to leak out to the public (eg. an algorithm to predict stock prices, etc).但是,您可能仍然有一些您绝对不想泄露给公众的代码(例如,预测股票价格的算法等)。 In this case, the only way to go is to create an API endpoint that your application will call each time the method should be executed.在这种情况下,唯一的方法是创建一个API 端点,您的应用程序将在每次执行该方法时调用该端点 It requires internet connection but it ensures that your secret code is never executed by the client machine.它需要互联网连接,但它可以确保您的密码永远不会被客户端机器执行。

Implementation执行

If you don't want to implement everything yourself, I would recommend to take a look at this tutorial (part of Cryptolens )如果您不想自己实现所有内容,我建议您查看本教程Cryptolens 的一部分)

The C# / .NET engine we use for licence key generation is now maintained as open source:我们用于许可证密钥生成的 C#/.NET 引擎现在作为开源维护:

https://github.com/appsoftware/.NET-Licence-Key-Generator . https://github.com/appsoftware/.NET-Licence-Key-Generator

It's based on a "Partial Key Verification" system which means only a subset of the key that you use to generate the key has to be compiled into your distributable.它基于“部分密钥验证”系统,这意味着只需将用于生成密钥的密钥子集编译到可分发文件中。 You create the keys your self, so the licence implementation is unique to your software.您自己创建密钥,因此许可证实施对您的软件来说是唯一的。

As stated above, if your code can be decompiled, it's relatively easy to circumvent most licencing systems.如上所述,如果您的代码可以反编译,则绕过大多数许可系统相对容易。

I've used Crypkey in the past.我过去使用过Crypkey It's one of many available.它是许多可用的之一。

You can only protect software up to a point with any licensing scheme.您只能使用任何许可方案在一定程度上保护软件。

I don't know how elaborate you want to get我不知道你想要多详细

but i believe that .net can access the hard drive serial number.但我相信 .net 可以访问硬盘序列号。

you could have the program send you that and something eles ( like user name and mac address of the nic)你可以让程序给你发送一些东西(比如用户名和网卡的mac地址)

you compute a code based off that and email them back the key.你根据它计算一个代码,然后通过电子邮件将密钥发回给他们。

they will keep them from switching machines after they have the key.拿到钥匙后,他们会阻止他们切换机器。

I've implemented internet-based one-time activation on my company's software (C# .net) that requires a license key that refers to a license stored in the server's database.我已经在我公司的软件 (C# .net) 上实现了基于 Internet 的一次性激活,该软件需要一个许可证密钥,该许可证密钥是指存储在服务器数据库中的许可证。 The software hits the server with the key and is given license information that is then encrypted locally using an RSA key generated from some variables (a combination of CPUID and other stuff that won't change often) on the client computer and then stores it in the registry.该软件使用密钥访问服务器并获得许可证信息,然后使用从客户端计算机上的某些变量(CPUID 和其他不会经常更改的东西的组合)生成的 RSA 密钥在本地加密,然后将其存储在注册表。

It requires some server-side coding, but it has worked really well for us and I was able to use the same system when we expanded to browser-based software.它需要一些服务器端编码,但它对我们来说效果很好,当我们扩展到基于浏览器的软件时,我能够使用相同的系统。 It also gives your sales people great info about who, where and when the software is being used.它还为您的销售人员提供有关谁、何地以及何时使用该软件的重要信息。 Any licensing system that is only handled locally is fully vulnerable to exploitation, especially with reflection in .NET .任何仅在本地处理的许可系统都完全容易受到利用,尤其是在 .NET 中的反射 But, like everyone else has said, no system is wholly secure.但是,就像其他人所说的那样,没有系统是完全安全的。

In my opinion, if you aren't using web-based licensing, there's no real point to protecting the software at all.在我看来,如果您不使用基于 Web 的许可,那么保护软件根本没有任何意义。 With the headache that DRM can cause, it's not fair to the users who have actually paid for it to suffer.由于 DRM 可能引起的头痛,对于实际为此付出代价的用户来说是不公平的。

I strongly believe, that only public key cryptography based licensing system is the right approach here, because you don't have to include essential information required for license generation into your sourcecode.我坚信,只有基于公钥加密的许可系统才是正确的方法,因为您不必在源代码中包含生成许可证所需的基本信息。

In the past, I've used Treek's Licensing Library many times, because it fullfills this requirements and offers really good price.过去,我曾多次使用Treek 的许可库,因为它满足了这一要求并且提供了非常优惠的价格。 It uses the same license protection for end users and itself and noone cracked that until now.它对最终用户和自身使用相同的许可证保护,直到现在还没有人破解它。 You can also find good tips on the website to avoid piracy and cracking.您还可以在网站上找到避免盗版和破解的好技巧。

The only way to do everything you asked for is to require an internet access and verification with a server.完成您所要求的一切的唯一方法是要求访问互联网并使用服务器进行验证。 The application needs to sign in to the server with the key, and then you need to store the session details, like the IP address.应用程序需要使用密钥登录到服务器,然后您需要存储会话详细信息,例如 IP 地址。 This will prevent the key from being used on several different machines.这将防止密钥在多台不同的机器上使用。 This is usually not very popular with the users of the application, and unless this is a very expensive and complicated application it's not worth it.这通常不太受应用程序用户的欢迎,除非这是一个非常昂贵和复杂的应用程序,否则不值得。

You could just have a license key for the application, and then check client side if the key is good, but it is easy to distribute this key to other users, and with a decompiler new keys can be generated.您可以只拥有应用程序的许可证密钥,然后检查客户端是否密钥良好,但是很容易将此密钥分发给其他用户,并且可以使用反编译器生成新密钥。

Like a few others mentioned, I'm a huge opponent of being hostile to customers by default—something that the licensing industry is notorious for. 就像提到的其他一些人一样,我是默认情况下对客户怀有敌意的巨大反对者 -许可行业众所周知。 So I'll expand on a good solution for your problem that also offers a good customer UX . 因此,我将为您的问题扩展一个好的解决方案,该解决方案还提供良好的用户体验

To start off, you mentioned that you have a "limited" version of your software that you're using to try and convert customers to "upgrade" for additional features. 首先,您提到您有一个软件的“有限”版本,用于尝试将客户转换为“升级”以获得其他功能。 So what you're looking for are feature licenses for your product eg a customer can purchase a license for feature-X or feature-Y . 因此,您要查找的是产品的功能许可证 ,例如,客户可以购买功能X功能Y的许可证。

I built Keygen with this type of licensing in mind. 我在构建Keygen时就考虑到了这种许可类型。 Keygen is a licensing REST API that allows you to manage user accounts, licenses and also track machine usage/associations. Keygen是许可的REST API,可让您管理用户帐户,许可证并跟踪计算机的使用情况/关联。

What I would do is set up 2 license types (a policy within Keygen) where one is a base policy for the limited free version, and the other is a policy for the paid version. 我要做的是设置两种许可证类型 (Keygen中的一种策略 ),其中一种是有限免费版本的基本策略,另一种是付费版本的策略。

I'm not sure what you're using for payments, but let's assume you're using something like Stripe (pretty standard nowadays) that offers webhooks . 我不确定您使用的是什么付款方式,但让我们假设您使用的是诸如Stripe(如今相当标准)之类的提供webhooks的东西 Keygen also has webhooks (whether you use it or not, all this is still applicable). Keygen也有webhooks(无论您是否使用它,所有这些仍然适用)。 You can integrate Keygen to talk with your payment provider using webhooks from both sides (think: customer.created ->create base license for customer, license.created ->charge customer for the new license). 您可以使用双方的网络钩子集成Keygen以与您的付款提供商进行对话(请考虑: customer.created >为客户创建基本许可证, license.created >为新许可证向客户收费)。

So by utilizing webhooks, we can automate license creation for new customers. 因此,通过利用Webhook,我们可以自动为新客户创建许可证。 So what about license validation within the application itself? 那么,应用程序内部的许可证验证又如何呢? This can be done in a variety of ways, but the most popular way is by requiring your customer to enter a long license key into an input field which you can then validate; 这可以通过多种方式完成,但是最流行的方式是要求客户在输入字段中输入长许可证密钥,然后您可以进行验证; I think this is a terrible way to handle license validation in your application. 我认为这是在您的应用程序中处理许可证验证的糟糕方法。

Why do I think that? 我为什么这么认为? Well first off, you're requiring your customer to input a tediously long license key that is meant for machine consumption, and second your requiring you and your customer to keep track of said tediously long license key . 首先,您需要让客户输入一个冗长的许可证密钥,以供机器使用,其次, 您需要您和您的客户跟踪冗长的许可证密钥

Okay, so what's an alternative? 好吧,那有什么选择呢? I think the best alternative is doing something all of your customers are used to: allowing them to create an account for your product using an email/password . 我认为最好的选择是做所有您的客户都习惯的事情: 允许他们使用电子邮件/密码为您的产品创建一个帐户 You can then associate all of their licenses and their machines with that account. 然后,您可以将其所有许可证和计算机与该帐户关联。 So now instead of inputting a license key, they can simply log in using their credentials. 因此,现在他们无需输入许可证密钥,只需使用其凭据登录即可。

What advantage does that give you? 那给你什么好处? Firstly, it gets rid of the need for you and your customers to keep track of license keys, since it's all handled behind-the-scenes inside of their user account and most importantly: you can now offer your customers self-serve license and machine activation! 首先,它消除了您和您​​的客户跟踪许可证密钥的需要, 因为它们都是在其用户帐户内部进行的幕后处理 ,最重要的是: 您现在可以为客户提供自助式许可证和机器激活! ie since all of their licenses and machines are associated with their user account, you can prompt them to purchase a license when they fire up your application on an unrecognized machine. 即,由于他们的所有许可证和计算机都与他们的用户帐户相关联,因此当他们在无法识别的计算机上启动您的应用程序时,您可以提示他们购买许可证。

Now onto license validation : whenever your customer logs into your application with their email/password, you can query their user account for the licenses they own to determine if they can use feature-X or feature-Y . 现在进入许可证验证 :每当客户使用其电子邮件/密码登录到应用程序时,您都可以查询其拥有的许可证的用户帐户,以确定他们是否可以使用feature-Xfeature-Y And since your application is now self-serve , you can allow your customers to purchase additional features directly from within your application! 而且,由于您的应用程序现在是自助服务 ,因此您可以允许客户直接从应用程序内购买其他功能!

So we've introduced a ton of automation to our licensing system, we can license individual features (ie a limited vs. full version), we've offered an awesome UX for our customers and we've also alleviated one of the biggest reasons for support requests: license key recovery. 因此,我们已经推出了一的自动化我们的发牌制度,我们可以授权个人特征 (即限制对完整版),我们提供我们的客户一个真棒 UX,我们也已经缓解的最大原因之一对于支持请求: 许可证密钥恢复。

Anyways, this got long but hopefully it helps somebody! 无论如何,这很长,但希望可以对某人有所帮助!

It is not possible to prevent software piracy completely.完全防止软件盗版是不可能的。 You can prevent casual piracy and that's what all licensing solutions out their do.您可以防止随意盗版,这就是所有许可解决方案所做的。

Node (machine) locked licensing is best if you want to prevent reuse of license keys.如果您想防止重复使用许可证密钥,则节点(机器)锁定许可是最好的选择。 I have been using Cryptlex for about a year now for my software.我已经为我的软件使用Cryptlex大约一年了。 It has a free plan also, so if you don't expect too many customers you can use it for free.它也有一个免费计划,所以如果您不希望有太多客户,您可以免费使用它。

You can use a free third party solution to handle this for you such as Quantum-Key.Net It's free and handles payments via paypal through a web sales page it creates for you, key issuing via email and locks key use to a specific computer to prevent piracy.您可以使用免费的第三方解决方案来为您处理此问题,例如 Quantum-Key.Net 它是免费的,并通过它为您创建的网页销售页面通过贝宝处理付款,通过电子邮件发出密钥并将密钥使用锁定到特定计算机以防止盗版。

Your should also take care to obfuscate/encrypt your code or it can easily be reverse engineered using software such as De4dot and .NetReflector.您还应该注意混淆/加密您的代码,否则可以使用 De4dot 和 .NetReflector 等软件轻松对其进行逆向工程。 A good free code obfuscator is ConfuserEx wich is fast and simple to use and more effective than expensive alternatives.一个很好的免费代码混淆器是 ConfuserEx,它快速且易于使用,并且比昂贵的替代品更有效。

You should run your finished software through De4Dot and .NetReflector to reverse-engineer it and see what a cracker would see if they did the same thing and to make sure you have not left any important code exposed or undisguised.你应该通过 De4Dot 和 .NetReflector 运行你完成的软件来对其进行逆向工程,看看如果他们做了同样的事情,破解者会看到什么,并确保你没有留下任何暴露或未加掩饰的重要代码。

Your software will still be crackable but for the casual cracker it may well be enough to put them off and these simple steps will also prevent your code being extracted and re-used.您的软件仍然是可破解的,但对于普通破解者来说,这可能足以让他们望而却步,这些简单的步骤也将防止您的代码被提取和重用。

https://quantum-key.net https://quantum-key.net

How to use ConfuserEx? 如何使用 ConfuserEx?

https://github.com/0xd4d/de4dot https://github.com/0xd4d/de4dot

https://www.red-gate.com/dynamic/products/dotnet-development/reflector/download https://www.red-gate.com/dynamic/products/dotnet-development/reflector/download

I solved it by interfacing my program with a discord server, where it checks in a specific chat if the product key entered by the user exists and is still valid.我通过将我的程序与 Discord 服务器连接来解决它,如果用户输入的产品密钥存在并且仍然有效,它会在特定聊天中检查。 In this way to receive a product key the user would be forced to hack discord and it is very difficult.以这种方式接收产品密钥的用户将被迫破解不和谐,这是非常困难的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM