产品密钥的实施

发布于 2024-07-15 11:45:32 字数 1436 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

献世佛 2024-07-22 11:45:32

对称算法是有限的,因为任何具有反汇编程序的新手破解者都可以找到您的密钥(或用于生成密钥的算法)并制作“密钥生成器”。

因此,非对称密码学是最佳选择。 基本前提是这样的:

  • 当用户向您购买许可证时,您会收集有关用户和/或其环境的某些识别详细信息(通常,这只是全名;有时也是公司)。
  • 您对该信息进行 128 位 MD5 哈希。
  • 使用 128 位椭圆曲线加密,使用私有 服务器上的密钥。
  • 128 位密文可以向用户表示为由字母和数字组成的 25 个字符的字符串(加上分隔破折号以提高可读性)。 请注意,26 个字母 + 10 个数字 = 36 个离散值,并且 36^25 > 2^128。
  • 用户将该产品密钥键入您的注册对话框中。 客户端软件将其转换回 128 位数字(16 字节),使用 EC 加密的公钥对其进行解密,并将结果与​​用户个人信息的 MD5 哈希值进行比较,该哈希值必须与注册时使用的信息相匹配。

当然,这只是基本想法。 有关更多详细信息和源代码,请参阅 基于椭圆曲线加密技术的产品密钥

Symmetric algorithms are limited, in that any novice cracker with a disassembler can find your key (or the algorithm used to generate one) and make a "keygen".

For this reason, asymmetric cryptology is the way to go. The basic premise is something like this:

  • When the user purchases a license from you, you collect certain identifying details about the user and/or their environment (typically, this is just a full name; sometimes a company, too).
  • You make a 128-bit MD5 hash of this information.
  • Using a 128-bit Elliptic Curve crypto, encrypt this hash using the private key on the server.
  • The 128-bit cipher text can be represented to the user as a 25-character string consisting of letters and digits (plus separating dashes for readability). Notice that 26 letters + 10 digits = 36 discrete values, and that 36^25 > 2^128.
  • The user types this product key into your registration dialog. The client software converts it back to a 128-bit number (16 bytes), decrypts that using the public key of your EC crypto, and compares the result to an MD5 hash of the user's personal information, which must match what was used for registration.

This is just the basic idea, of course. For more details and source code, see Product Keys Based on Elliptic Curve Cryptography.

白馒头 2024-07-22 11:45:32

如果您只需购买解决方案,生活就会变得更简单。

http://www.kagi.com/kagisolutions/index.php

Kagi 允许您收取付款,他们帮助您管理钥匙。

Life is simpler if you simply purchase a solution.

http://www.kagi.com/kagisolutions/index.php

Kagi allows you to collect payments and they help you manage the keys.

只为一人 2024-07-22 11:45:32

一个人在博客中讲述了他如何处理注册号问题。 他的博客条目之一是 生成唯一注册号

A guy has blogged about how he handled the question of registration numbers. One of his blog entries is Generating Unique Registration Numbers.

清风不识月 2024-07-22 11:45:32

是的,RSA 和 AES 是两种截然不同的东西:

  • RSA 是公钥加密技术,涉及公钥和私钥,并且速度相当慢。 主要用途是建立对称加密会话密钥的安全交换。
  • AES 是对称加密,快速且安全。

由于您的应用程序不通过公共渠道进行通信,并且加密技术的使用仅限于产品激活/注册,因此您需要使用对称密码。 公钥密码的好处在于密钥管理,您将在网站或通过电子邮件进行处理。

请注意,您不必为每个客户分配相同的密钥。 您可以生成一些注册信息的哈希值,并将其与其他信息(也许是固定的会话密钥)进行异或。 将其发送给客户,程序可以生成相同的哈希值,并对您发送的密钥进行异或以生成原始固定密钥。

处理密码学并不是一件容易的事。 正如您提到的,您希望这个问题能够被破解。 如果你自己做的话,这几乎肯定会发生。 您仍然可以使用自己的实现来“让诚实的人保持诚实”,但要意识到这只是您所能得到的。 如果您需要更强大的东西,那么您应该在对解决方案进行彻底研究后购买解决方案。

Yes, RSA and AES are two very different things:

  • RSA is public key cryptography, involving a public key and a private key, and is fairly slow. The primary use is to set up a secure exchange of a symmetric encryption session key.
  • AES is symmetric encryption, which is fast and secure.

Since your app does not communicate over public channels and the use of cryptography is limited to product activation/registration you'll want to go with a symmetric cipher. The benefits of public key ciphers is in key management, which you will be handling on your web site or through email.

Note that you do not have to distribute the same key for every customer. You could generate a hash of some of the registration info and XOR it with something else (a fixed session key, perhaps). Send that to the customer, and the program could generate the same hash and XOR will the key you sent to produce the original fixed key.

Dealing with cryptography is not something to be done lightly. As you mention, you expect this to be cracked. If you're doing your own this will almost certainly happen. You can still use your own implementation to "keep honest people honest," but realize that's as far as you'll get. If you need something stronger then you should purchase a solution after doing thorough research on the solutions.

榕城若虚 2024-07-22 11:45:32

您可以查看这篇代码项目文章。 它描述了基于执行软件的机器的 MAC 地址的软件密钥的实现。 正如作者本人所承认的,该方法并不理想,并且与您正在寻找的有点不同,但也许它可以帮助您。

You can check out this Code Project article. It describes an implementation of a a software key based on the MAC address of the machine where the software is executed. The method is not ideal, as the auteur himself admits, and it is a little bit different from what you are looking for, but maybe it can help you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文