如何生成注册密钥(用于安全性) [英] How to Generate Registration Key (for Security)

查看:72
本文介绍了如何生成注册密钥(用于安全性)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的主席先生,我想根据处理器ID生成一个注册密钥.
我需要代码来生成与处理器ID相对应的任何字符串:BFEBFBFF00010001A

Dear Sir, I want to Generate a Registration Key on the Basis ofProcessor ID.
I require code to generate any string corresponding to Processor ID:BFEBFBFF0001067A

推荐答案

我不确定要做什么,但我认为您可以计算您的处理器ID字符串的哈希,如下所示:
I''m not entirely sure what you want to do, but I would think you could just calculate a hash of your processor id string, like so:
SHA512 sha = new SHA512Managed();
byte[] hash = sha.ComputeHash(Encoding.UTF8.GetBytes(myProcessorIdAsString));
StringBuilder sb = new StringBuilder(128);
foreach (byte b in hash)
    sb.Append(b.ToString("X2"));
string meKey = sb.ToString();


将应用程序连接到处理器是一个坏主意.如果有人为您的软件付费,那么他们应该可以将其安装在自己拥有的任何计算机上.您应该做的是实施一个在线注册验证系统.这样,您可以a)跟踪谁在使用您的软件,以及b)允许用户进行N次安装.
Tying an application to a processor is a bad idea. If someone paid for your software, they should be able to install it on any machine they own. What you should do is implement an online registration verification system. This allows you to a) track who''s using your software, and b) allow the user to have N number of installs.


这篇关于如何生成注册密钥(用于安全性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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