25 个字符的产品密钥如何工作?

发布于 2024-10-05 12:37:08 字数 168 浏览 0 评论 0原文

Microsoft 产品和其他产品通常具有 5 组 5 个字符的产品密钥,如下所示:

ABCDE-12345-ABCDE-12345-VWXYZ

产品如何知道密钥是否有效?某种密码学?如果我想在我的代码中使用这种产品密钥,是否有库?

Microsoft products and other products often have a product key that is 5 groups of 5 characters, like this:

ABCDE-12345-ABCDE-12345-VWXYZ

How does the product know if the key is valid? Some sort of cryptography? Is there a library if I want to use this kind of product key in my code?

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

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

发布评论

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

评论(3

暖心男生 2024-10-12 12:37:09

您可能想看看这个文章介绍如何实现序列号验证功能。它还涉及一些高级技术,例如如何掌握密钥生成、泄露的密钥等。

简而言之,此类密钥中通常包含三个底层字段:

  • 实际序列号,本文将其称为“种子
  • ”验证数据;只有部分验证数据由代码实际检查
  • 校验和、CRC 或其他简单的防错机制

通过在代码中仅实现部分验证数据检查,您可以执行诸如“真正验证”之类的操作(在这种情况下其余的验证发生在您的服务器上)或通过检查新版本中验证数据的不同子集来触发注册机。

You might want to have a look at this article on how to implement a serial number validation function. It also goes into some advanced techniques such as how to keep on top of keygens, leaked keys, etc.

In short, there are typically three underlying fields in such a key:

  • the actual serial number, which the article calls a "seed"
  • some verification data; only part of the verification data is actually checked by the code
  • a checksum, CRC or other simple typo-proofing mechanism

By only implementing part of the verification data checking in your code, you can do things like "genuine validation" (in which case the rest of the verification happens on your server) or trip up keygens by checking different subsets of the validation data in new releases.

七色彩虹 2024-10-12 12:37:09

特别是对于 Microsoft 产品,有一些可用的知识。

Windows XP 上的产品密钥使用自定义字母表进行 base24 编码。它由序列号(消息来源称其为“原始产品密钥”)和数字签名组成。 来源

Windows 8 及更高版本的产品密钥在软件中包含一些文档专利申请WO 2012067888 A1。它仍然是 Base24 编码的(第 57 步等,这实际上意味着“N”的位置用作要解码的第一个字符)。其要点是,Windows 8 及更高版本的产品密钥包含以下部分:

  • 组 ID,指示类型/版本/系列/分销渠道,请参阅第 34 步)
  • 序列号(与组一起形成“原始产品密钥”) ID)
  • 安全值 1 和 2(不同级别的安全性,两者都可能是签名,参见行为 34 及以下、46、55)
  • 校验和(行为 56,实际上是密钥上截断的 POSIX cksum)
  • 升级位

For Microsoft products in particular, is some knowledge available.

Product keys on Windows XP are base24-encoded using a custom alphabet. It consists of a serial number (the source calls it "Raw Product Key") and a digital signature over it. source

Product keys on Windows 8 and above have some documentation in the software patent application WO 2012067888 A1. It is still base24 encoded (act 57 et seq., which in practice means that the position of the 'N' is used as the very first character to decode). The gist of it is that there are these parts to a Windows 8 and above product key:

  • Group ID, which indicates the type/edition/family/distribution channel, see act 34)
  • Serial number (forms "Raw Product Key" together with Group ID)
  • Security values 1 and 2 (of varying grades of security, both are probably signatures, cf. acts 34 et seqq., 46, 55)
  • Checksum (act 56, in practice a truncated POSIX cksum over the key)
  • Upgrade bit
转角预定愛 2024-10-12 12:37:09

有四种方法可以确认密钥。

  1. 与 exe 中的现有字符串进行简单比较(极易破解)
  2. 与输入的字符串进行算法比较(几乎与 #1 一样简单。完全取决于破解者的逆向工程技能)。
  3. 与互联网上的服务器进行比较。 (可以规避)
  4. 硬件加密狗。

根据您从 Microsoft 获得的产品,他们使用上述前 3 种机制之一。例如,他们的操作系统通常会打电话回家;但他们的开发工具要么内置密钥,要么进行算法比较。他们的一些旧操作系统用于执行该算法。

有一个修改后的选项 3,但这只是让应用程序经常打电话回家,通常是基于某些事件。对于操作系统,MS 会验证输入的产品密钥以进行某些 Windows 更新和其他产品下载。此外,根据许可证密钥本身,它可能每月左右打电话回家一次。顺便说一句,中国拥有第一大 IE6 安装基数是有原因的。

第四个选项也可以被绕过。通常破解者只会修补您的产品以绕过执行硬件检查的代码部分。

There are four ways to confirm a key.

  1. Simple compare to an existing string in the exe (extremely easy to crack)
  2. Algorithmic compare to an entered string of characters (almost as easy as #1. Depends entirely on the reverse engineering skills of the cracker).
  3. Compare with a server over the internet. (can be circumvented)
  4. Hardware dongle.

Depending on the product you have from microsoft, they use one of the first 3 mechanisms above. For example, their OS's usually phone home; but their dev tools either have the key baked in or do an algorithmic compare. Some of their older OS's used to do the algorithm.

There is a modified option 3, but that is simply having the app phone home every so often, typically based on some event. In the case of OS's, MS has it validate the entered product key for certain windows updates and other product downloads. Also, depending on the license key itself it might phone home once a month or so. As a side note, there is a reason why China has the #1 installed base of IE6.

The 4th option can also be circumvented. Usually the cracker will just patch your product to bypass the part of the code which does the hardware check.

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