License keys are the defacto-standard as an anti-piracy measure. To be honest, this strikes me as (in)Security Through Obscurity, although I really have no idea how license keys are generated. What is a good (secure) example of license key generation? What cryptographic primitive (if any) are they using? Is it a message digest? If so, what data would they be hashing? What methods do developers employ to make it difficult for crackers to build their own key generators? How are key generators made?
当前回答
所有的CD拷贝保护算法给诚实的用户带来不便,同时没有提供任何防止盗版的保护。
“盗版者”只需要获得一张合法的cd及其访问代码,他就可以制作n份拷贝并分发它们。
无论代码的加密安全性如何,都需要以明文形式提供CD,否则合法用户无法激活该软件。
Most secure schemes involve either the user providing the software supplier with some details of the machine which will run the software (cpu serial numbers, mac addresses, Ip address etc.), or, require online access to register the software on the suppliers website and in return receive an activitation token. The first option requires a lot of manual administration and is only worth it for very high value software, the, second option can be spoofed and is absolutly infuriating if you have limited network access or you are stuck behind a firewall.
总的来说,与客户建立信任关系要容易得多!
其他回答
您可以在使用它的软件项目中非常容易地使用和实现安全许可API(您需要从https://www.systemsoulsoftwares.com/下载创建安全许可的桌面应用程序)。
Creates unique UID for client software based on System Hardware(CPU,Motherboard,Hard-drive) (UID acts as Private Key for that unique system) Allows to send Encrypted license string very easily to client system, It verifies license string and works on only that particular system This method allows software developers or company to store more information about software/developer/distributor services/features/client It gives control for locking and unlocked the client software features, saving time of developers for making more version for same software with changing features It take cares about trial version too for any number of days It secures the License timeline by Checking DateTime online during registration It unlocks all hardware information to developers It has all pre-build and custom function that developer can access at every process of licensing for making more complex secure code
cd - key对于任何非网络的东西都不是很安全,所以从技术上讲,它们不需要安全生成。如果你使用的是。net,你几乎可以使用guide . newguid()。
它们现在主要用于多人游戏组件,服务器可以在其中验证CD Key。因此,生成它的安全性并不重要,因为归根结底就是“查找传入的任何东西,并检查其他人是否已经在使用它”。
话虽如此,你可能想要使用算法来实现两个目标:
Have a checksum of some sort. That allows your Installer to display "Key doesn't seem valid" message, solely to detect typos (Adding such a check in the installer actually means that writing a Key Generator is trivial as the hacker has all the code he needs. Not having the check and solely relying on server-side validation disables that check, at the risk of annoying your legal customers who don't understand why the server doesn't accept their CD Key as they aren't aware of the typo) Work with a limited subset of characters. Trying to type in a CD Key and guessing "Is this an 8 or a B? a 1 or an I? a Q or an O or a 0?" - by using a subset of non-ambigous chars/digits you eliminate that confusion.
话虽如此,你仍然需要一个大的分布和一些随机性,以避免盗版只是猜测一个有效的密钥(在你的数据库中是有效的,但仍然在商店货架上的一个盒子里),并欺骗碰巧买了那个盒子的合法客户。
所有的CD拷贝保护算法给诚实的用户带来不便,同时没有提供任何防止盗版的保护。
“盗版者”只需要获得一张合法的cd及其访问代码,他就可以制作n份拷贝并分发它们。
无论代码的加密安全性如何,都需要以明文形式提供CD,否则合法用户无法激活该软件。
Most secure schemes involve either the user providing the software supplier with some details of the machine which will run the software (cpu serial numbers, mac addresses, Ip address etc.), or, require online access to register the software on the suppliers website and in return receive an activitation token. The first option requires a lot of manual administration and is only worth it for very high value software, the, second option can be spoofed and is absolutly infuriating if you have limited network access or you are stuck behind a firewall.
总的来说,与客户建立信任关系要容易得多!
密钥系统必须具有以下几个属性:
只有很少的键是有效的 即使给定用户拥有的一切,有效的键也必须是不可派生的。 一个系统上的有效密钥在另一个系统上不是有效密钥。 其他人
One solution that should give you these would be to use a public key signing scheme. Start with a "system hash" (say grab the macs on any NICs, sorted, and the CPU-ID info, plus some other stuff, concatenate it all together and take an MD5 of the result (you really don't want to be handling personally identifiable information if you don't have to)) append the CD's serial number and refuse to boot unless some registry key (or some datafile) has a valid signature for the blob. The user activates the program by shipping the blob to you and you ship back the signature.
潜在的问题包括,你提供的签名几乎是任何东西,所以你需要假设有人会运行选定的纯文本和/或选定的密文攻击。可以通过检查提供的序列号并拒绝处理来自无效序列号的请求,以及拒绝在一段时间内(例如每年2次)处理来自给定s/n的超过给定数量的查询来缓解这一问题。
我应该指出几件事:首先,一个熟练和坚定的攻击者将能够绕过他们拥有无限制访问权限的部分(即CD上的所有内容)的任何和所有安全性,您对该帐户所能做的最好的事情是使其更难获得非法访问而不是获得合法访问。其次,我不是专家,所以这个提议的方案可能存在严重的缺陷。
对于老式的CD键来说,这只是一个容易生成和验证CD键(可以是任何字符串)的算法的问题,但是有效CD键与无效CD键的比例是如此之小,以至于随机猜测CD键不太可能得到有效的CD键。
错误的做法:
《星际争霸》和《半条命》都使用了相同的校验和,即第13个数字验证了前12个数字。因此,您可以为前12位输入任何数字,并猜测第13位(只有10种可能),从而得到臭名昭著的1234-56789-1234
验证算法是公开的,看起来像这样:
x = 3;
for(int i = 0; i < 12; i++)
{
x += (2 * x) ^ digit[i];
}
lastDigit = x % 10;
正确的方法
Windows XP收集了相当多的信息,对其进行加密,然后将字母/数字编码放在贴纸上。这允许MS同时验证您的密钥并获得产品类型(家庭、专业等)。此外,它需要在线激活。 完整的算法相当复杂,但在德国发表的这篇(完全合法的!)论文中很好地概述了它。
当然,无论你做什么,除非你提供的是在线服务(如《魔兽世界》),任何类型的版权保护都只是一种拖延:不幸的是,如果这是一款有价值的游戏,就会有人破坏(或至少绕过)CD-key算法和所有其他版权保护。
真正正确的做法:
对于在线服务来说,情况要简单一些,因为即使使用二进制文件,你也需要通过服务器的身份验证才能使用它。拥有一个WoW账号)。魔兽世界的CD-key算法——例如,在购买游戏卡时使用——可能看起来像这样:
生成一个非常大的加密安全随机数。 储存在我们的数据库中,并打印在卡片上。 然后,当有人输入游戏时间卡号时,检查它是否在数据库中,如果是,将该号码与当前用户关联,以便它永远不会再被使用。
对于网上服务,没有理由不使用上述方案;使用其他任何方法都可能导致问题。
推荐文章
- 在php中生成一个随机密码
- java.util.Random和java.security. securerrandom的区别
- Docker和安全密码
- 准备好的语句如何防止SQL注入攻击?
- 为什么人们会写“throw 1;<不要邪恶>”和“for(;;);”在json响应前?
- 非加密用途的最快哈希?
- SHA512 vs. Blowfish和Bcrypt
- cer、pvk和pfx文件有什么区别?
- Django设置“SECRET_KEY”的目的是什么?
- 如何从命令行重置Jenkins安全设置?
- 如何通过SFTP从服务器检索文件?
- SecureString在c#应用中实用吗?
- 密码盐如何帮助对抗彩虹表攻击?
- 浏览器会通过https缓存内容吗
- 在git存储库中处理密码的最佳实践是什么?