如何许可自己的程序? [英] How to license my own program?

查看:83
本文介绍了如何许可自己的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



好吧,我想保护我的程序,使其不能轻易在其他计算机上复制..到目前为止,我想出了从可以运行该程序的计算机上获取一些唯一ID的方法,例如:
1.获取MAC地址,
2.获取处理器ID,
3.获取硬盘驱动器ID和
4.获取BIOS序列号.
现在:
1.通过很少的研究,我发现拥有用于识别PC的Mac地址是一个坏主意,主要是因为它易于更改.
2.接下来,我认为处理器ID是一个好主意(对我来说),这是我用来获取它的代码:

Hi,

Well i want to make a protection for my program that it can''t be easily copied on other machines.. So far i have come up with getting some Uniques ID''s from the machine where the program could run, such as:
1. Getting the MAC address,
2. Getting the Processor ID,
3. Getting the Hard Drive ID and
4. Getting the BIOS Serial number..

Now:
1. By little researching i have seen that having the mac address to identify a PC is a bad idea, mostly because it is easy changed.. So it is out..

2. Next, Processor ID i see as a good idea (by me), and here is the code i use to get it:

string sProcessorID = "";
string sQuery = "SELECT ProcessorId FROM Win32_Processor";
ManagementObjectSearcher oManagementObjectSearcher = new ManagementObjectSearcher(sQuery);
ManagementObjectCollection oCollection = oManagementObjectSearcher.Get();
foreach (ManagementObject oManagementObject in oCollection)
{
    sProcessorID = (string)oManagementObject["ProcessorId"];
}
return (sProcessorID);string sProcessorID = "";
string sQuery = "SELECT ProcessorId FROM Win32_Processor";
ManagementObjectSearcher oManagementObjectSearcher = new ManagementObjectSearcher(sQuery);
ManagementObjectCollection oCollection = oManagementObjectSearcher.Get();
foreach (ManagementObject oManagementObject in oCollection)
{
    sProcessorID = (string)oManagementObject["ProcessorId"];
}
return (sProcessorID);


就我已经在两台计算机上测试过而言,它工作得很好.但是,问题是我读到并非所有主板都将在该属性中填充序列号,如果确实发生,那么有人会知道是什么.它实际上返回了吗? (例如字符串"Null"或类似的东西?)

3.获取硬盘驱动器ID也是一件好事,我找到了一个代码,下面是代码的样子:


And so far as i have tested on two machines, it works just fine.. But the problem for this is that i read that not all motherboards will have the serial number populated in the property, and if that does occurs than does someone knows what does it actually returns? (like a string of "Null" or something similar?)

3. Getting the hard drive id is also a good thing, i found a code and here is how the code is:

ststring drive = "C";
ManagementObject dsk = new ManagementObject(@"win32_logicaldisk.deviceid=""" + drive + @":""");
dsk.Get();
string volumeSerial = dsk["VolumeSerialNumber"].ToString();


但是这里的问题是,格式化PC之后,此值是否相同",以及可能是某些硬盘驱动器没有其唯一ID"?

4.好吧,我不知道这是否真的是个好主意,因为当我想在PC上读取Bios ID时说要由O.E.M.填充" ...



所以这是我保护程序的想法:
首先读取ProcessorID和HardDriveID(因为这两个似乎仅是可靠的),然后将其写入我的数据库中.然后,每次程序启动时,在加载时它都会检查数据库中的字符串是否与从当前计算机获取的当前信息相同.但是为此,我首先必须知道如果存在,它将返回什么字符串没有写为处理器ID或HardDriveID的内容(例如"000000"或未知"或其他)...

还是有一种更好的方法来保护我到目前为止尚未发现的软件..

希望我能得到答案,
谢谢前进...


But the problem here would be, ''does this value is the same after the pc has been formated'', and ''is it probably some hard drive not to have its unique id''?

4. Well i don''t know if this is actually a good idea, cause when i wanted to read on my PC the Bios ID it says "To Be Filled By O.E.M."...



So here is my idea for protecting my program:
First to read the ProcessorID and HardDriveID (as those two only seems reliable) and write then in my database. Then every time when the programs starts, on load it checks if the string in the database is the same as the current information taken from the current machine.. But for this to make i first have to know what string would it return if there is nothing written as a Processor ID or HardDriveID (like is it ''000000'' or ''unknown'' or something else)...

Or is there even better way to protect my software that i haven''t found so far..

I hope i get an answer,
Thank you in forward...

推荐答案

毫无意义的练习.

0)可以欺骗MAC地址,并且如果包装箱中没有活动的NIC卡,或者计算机在任何给定时间可以使用许多NIX卡,该怎么办?

1)处理器ID merelu标识CPU的功能.没有独特之处.

2)每次格式化驱动器时,硬盘ID都会更改.

3)并非所有主板都具有可检索(或未报告)的BIOS序列号.

如果您坚持要采取措施防止未经授权的使用,那么购买/实施第三方解决方案会更好.
Pointless exercise.

0) MAC address can be spoofed, and what if there is no active NIC card in the box, or the machine has a number of NIX cards that could be in use at any given time?

1) Processor ID merelu identifies the capabilities of the CPU. No unique.

2) Hard drive ID changes every time the drive is formatted.

3) Not all motherboards have a BIOS serial number that can be retrieved (or is not reported).

If you insist on doing something to prevent unauthorized use, you''re just plain better off buying/implementing a 3rd party solution.


我对项目有类似的要求,但同样不确定关于它.就像您提到的那样,由于NULL或空值,我最终使用了多个数字.我使用主板序列号,BIOS序列号和UUID.我将它们与SHA2一起哈希在一起,使其成为一个字符串,并将该字符串用作该计算机的唯一ID代码.到目前为止,我还没有遇到任何问题,但是我只有369个用户.这是我在谈论管理对象的属性/集合:

属性收集
SerialNumber-Win32_BaseBoard
SerialNumber-Win32_BIOS
UUID-Win32_ComputerSystemProduct

我合并所有这些值,并使用此方法对它们进行哈希处理,以使一个64个字符长的字符串成为可能. (很抱歉,在vb中)

I had a similar requirement for a project and felt equally unsure about it. I ended up using several numbers because of NULLS or empty values just like you mentioned. I use the motherboard serial number, the BIOS serial number, and the UUID. I hash them all together with SHA2 to make it one string and use that string as the unique id code for that computer. So far I haven''t run into any problems, but I only have 369 users. Here are the property/collections I''m talking about for the management object:

Property-Collection
SerialNumber-Win32_BaseBoard
SerialNumber-Win32_BIOS
UUID-Win32_ComputerSystemProduct

I concat all those values and hash them with this method to make the one 64 character long string. (sorry it''s in vb)

Public Function HashString(ByVal instrString As String) As String
       '   This function will:
       '       - Create a SHA2 hash of the incomming parm and return it.
       '         (Hash will be 64 characters long)

       'Create an encoding object to ensure the encoding standard for the source text
       Dim Ue As New System.Text.UnicodeEncoding()

       'Retrieve a byte array based on the password
       Dim ByteSourceText() As Byte = Ue.GetBytes(Trim(instrString))

       'Instantiate an SHA2 Provider object
       Dim SHA2 As New System.Security.Cryptography.SHA384Managed

       'Compute the hash value from the source
       Dim ByteHash() As Byte = SHA2.ComputeHash(ByteSourceText)

       'And convert it to String format for return
       Dim strSha2 As String = Convert.ToBase64String(ByteHash)

       Return Convert.ToBase64String(ByteHash)

   End Function




希望对您有所帮助.




Hope this helps.


您可以尝试使用IntelliLock工具,这样可以解决您的问题.
You can try to use IntelliLock tools,It can solute your problem.


这篇关于如何许可自己的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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