算法独特的CD-KEY生成与验证 [英] Algorithm for unique CD-KEY generation with validation

查看:241
本文介绍了算法独特的CD-KEY生成与验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个独特的CD-KEY就摆在我们的产品中,就像一个普通的CD-KEY的用户使用注册产品标准的软件盒中。

I am trying to create a unique CD-KEY to put in our product's box, just like a normal CD-KEY found in standard software boxes that users use to register the product.

不过,我们不是卖软件,我们销售的DNA采集盒的刑事和医疗目的。用户将收到唾液采集盒通过邮件与它的CD-KEY,他们将使用CD-KEY建立在我们网站上的帐户,并得到他们的结果。从测试的结果将被链接到的CD-KEY。这是我们必须将结果链接到患者的唯一途径。因此重要的是,它并没有失败:)

However we are not selling software, we are selling DNA collection kit for criminal and medical purposes. Users will receive a saliva collection kit by mail with the CD-KEY on it and they will use that CD-KEY to create an account on our website and get their results. The results from the test will be linked to the CD-KEY. This is the only way that we will have to link the results to the patients. It is therefore important that it does not fail :)

一的要求,将是对CD-键列表中必须有足够的S $ P $垫分开,这样有一个人进入一个不正确的CD-KEY的可能性,仍然有它批准了别人套件,从而混淆了两个包。这可能会花费我们数千美元的债务。

One of the requirements would be that the list of CD-KEYs must be sufficiently "spread" apart so that there is no possibility of someone entering an incorrect CD-KEY and still having it approved for someone else kit, thereby mixing up two kits. That could cost us thousands of dollars in liability.

例如,它不可能是数字的增量序列如
00001
00002
00003
...
其理由是,如果有人接收到套件00002,但其注册为000003由意外,那么他的结果将被匹配给其他人。因此,它必须像信用卡号码...除非一个有效的顺序进入,你的随机打一个有效的数字机会是1百万...

For example, it cannot be a incremental sequence of numbers such as
00001
00002
00003
...
The reason is that if someone receives the kit 00002, but registers it as 000003 by accident, then his results will be matched to someone else. So it must be like credit card numbers... Unless a valid sequence is entered, your chances of randomly hitting a valid number is 1 in a million...

此外,我们每年销售超过50000套各类供应商,所以我们不能维持pviously发行的CD-键检查重复所有$ P $名单(谁将会使用我们的算法生成自己的CD-键)。该算法必须生成唯一的CD-键。

Also, we are selling over 50,000 kits annually to various providers (who will generate their own CD-KEYS using our algorithm) so we cannot maintain a list of all previously issued CD-KEYS to check for duplicate. The algorithm must generate unique CD-KEYs.

我们还需要验证CD-KEY是有效使用快速检查的算法,这样我们就可以告知用户,如果code他进入无效的能力。这使得了许多哈希或MD5算法,我相信。它不可能是128位,因为,将采取那个时候给它输入了电脑屏幕上的是谁呢?

We also require the ability to verify that the CD-KEY is valid using a quick check algorithm, so that we can inform the user if the code he enters is invalid. This leaves out many hashing or MD5 algorithms I believe. And it cannot be a 128 bit because, who would take that time to type it out on the computer screen?

到目前为止,这是我想最后的CD-KEY的结构会是什么样

(4炭产物code) - (4字符经销商code) - (12字符独特的,可核查的CD-KEY)

例384A - GTLD - {4565 - FR54 - EDF3}

So far this is what I was thinking the final CD-KEY structure would look like

(4 char product code) - (4 char reseller code) - (12 char unique, verifiable CD-KEY)

Ex. 384A - GTLD - {4565 - FR54 - EDF3}


以确保钥匙的唯一性,吾人可包括当前的日期(20090521)作为源的一部分。我们不会生成唯一密钥每周一次都比较多,所以这个值的变化往往不够了独特的初始值的目的。


To insure the uniqueness of the KEYS, I could include the current date (20090521) as part of the source. We wont generate unique keys more than once a week, so this value changes often enough for the purpose of unique initial value.

我可以使用哪些可能的算法生成唯一键?

What possible algorithm can I use to generate the unique keys?

推荐答案

创建的字符串<的providerName> 000001 <的providerName> 000002 等,或任何与公钥加密它们,这就是你的CD-KEY的用户输入。解密的CD-KEY与私钥和验证解密,当你得到一个有效的提供程序名称的有效字符串。

Create the strings <providername>000001, <providername>000002, etc. or whatever and encrypt them with a public key, and that's your "CD-KEY" that the user enters. Decrypt the CD-KEY with the private key and validate that when decrypted you get a valid string with a valid provider name.

这篇关于算法独特的CD-KEY生成与验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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