一台机器的唯一ID应该是什么?它的主板ID? Windows 产品 ID?

发布于 2024-09-16 12:19:41 字数 443 浏览 8 评论 0原文

我想检索机器的唯一ID。

和其他人一样,我也做了很多研究,发现唯一 ID 生成过程没有一个完美。

对于主板序列号(ID):它是唯一的;它无法改变。但是,如果制造商未在内存位置上添加信息,则在某些机器中可能找不到它。然后我发现它没有给出唯一的 ID .. 哈哈,

“处理器 ID”、“BIOS ID”也类似。

不敢使用PC的其他硬件信息。

MAC 和 Windows 产品 ID 可以通过软件更改。

“Windows 产品 ID”是唯一的吗?

一种选择是将它们组合起来,但是如果应用上述条件,组合不唯一怎么办?

还有其他方法可以找到机器的唯一ID吗?


编辑: 我想根据该唯一 ID 生成序列密钥,以防止软件盗版。 机器是指我要安装软件的目标PC。 @Guge:谢谢您的提及。

I want to retrieve the unique ID of a machine.

Like others I also did a lot of research, and found none of the process of Unique ID generation works perfectly.

For Motherboard Serial Number (ID): It is Unique; it can't be changed. However, it may not be found in some machines if Manufacturers didn't put information on Memory Location. Then I found it gives no Unique Id .. lol

Similarly for "Processor ID", "BIOS ID".

Afraid to use other hardware information of PC.

MAC and Windows Product ID can be changed by a software.

And is "Windows Product ID" unique?

One option is there to combine those but what if combination is not unique if above conditions applied?

Any other way to find the Unique ID of a machine?


Edit:
I want to generate serial key based on that unique ID for software piracy protection.
Machine means target PC I've to install software.
@Guge: Thanks for mentioning.

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

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

发布评论

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

评论(4

蓝眼泪 2024-09-23 12:19:41

机器的唯一ID?

正如您所发现的,不存在“机器的唯一 ID”这样的东西。

您需要定义您的要求,并使用满足这些要求的 ID(可能是您自己分配的)。例如,对于 Web 应用程序,带有 GUID 的 cookie 可能足以区分其他匿名用户(可以忽略使用多个浏览器或“私密”模式的少数用户)。

对于系统管理来说,在系统级别分配 GUID 应该足够了(无论如何,需要单独跟踪具有多重引导的多个操作系统安装)。

...

the Unique ID of a machine?

There is no such thing as "The Unique ID of a machine", as you have found.

You need to define your requirements, and use an ID (possibly allocated by yourself) that meets those requirements. E.g. for a web app, a cookie with a GUID might be sufficient to distinguish otherwise anonymous users (the small number of users who use multiple browsers or "in private" mode can be ignored).

For systems management assigning a GUID at the system level should be enough (multiple OS installs with multi-boot need to be tracked separately anyway).

...

酒绊 2024-09-23 12:19:41

由于其中一些 ID 可能会丢失,并且用户可以更换组件,因此您需要确定“机器”的含义。

例如,我会查看主板 ID、处理器 ID 和 BIOS ID,因为这些是最不可能更改的。然后我会查找所有三个,并允许自上次以来丢失和/或更改一个。如果满足这些条件,则允许软件运行。

如果两个甚至全部三个都丢失了,我不知道你会怎么做,因为正如你所说,MAC 地址等其他内容可以通过软件更改,而硬盘 ID 可能不是唯一的,并且会更频繁地更改。

Because some of these IDs might be missing and users can swap out components you need to decide what you mean by "a machine".

For example, I'd look at motherboard id, processor id and bios id as these are the least likely to change. Then I'd look for all three and allow one to be missing and/or changed since the last time. If those conditions are met then allow the software to run.

What you do if two or even all three are missing I don't know, because, as you say, other things like MAC address can be changed by software and hard disk ID probably isn't unique and subject to more frequent change.

故事和酒 2024-09-23 12:19:41

如果您试图在计算机所有者故意试图绕过您的唯一检查的情况下跟踪唯一的计算机,例如,您只需要每个玩家一个帐户的免费电脑游戏,我已经看到了上面提到的类似方法,但使用使用一些加密。

收集或尝试收集几条相对稳定的 PC 信息(主板 ID / MAC 地址 / BIOS),将它们与盐前缀结合起来,然后使用简单的免费算法对其进行加密。该密钥是您为该玩家存储的内容及其用户 ID,类似于密码的加密方式。该密钥将是“机器”的一个非常好的唯一标识符,您可以在每次登录时检查它。

您可以跟踪几条计算机信息,具体取决于您希望普通人更改其密码的风险有多大组件,但只要您检查的所有内容都没有出现空白,您就应该非常安全。

If you are trying to track unique computers in a situation where the computer owner is intentionally trying to bypass your unique check, for example a free computer game where you only want one account per player, I have seen a similar approach mentioned above but with the use of some encryption.

Gather, or try to gather, several pieces of relatively stable PC information (The MotherboardID / MAC Address / BIOS) combine them with a salt prefix and then encrypt it using a simple free algorithm. That key is what you store for that player along with their UserID similar to the way passwords are encrypted. That key will be a pretty good unique identifier for "The machine" which you can check every time they log in.

There are several pieces of computer information you can go after, depending on how risky you want to get with normal people who change their components, but as long as you don't get blanks for everything you are checking for you should be pretty safe.

若沐 2024-09-23 12:19:41

我创建了这个 python 脚本来做同样的事情。您只需决定保存文件的路径即可。如果存在,则会显示 uuid,如果不存在,则会创建一个并保存以供以后使用。我想你是在 Windows 版的 bat 中冷重写的。

from pathlib import Path
import uuid

seedfile = Path(".HOST_UUID")
if not seedfile.exists():
    UUID = uuid.uuid4()
    seedfile.write_text(str(UUID))
else:
    UUID = seedfile.read_text().strip()
print(UUID)

I created this python script to do the same thing. you just have to decide what path to save the file. If it exists the uuid will be displayed if not it will create one and save it for later. I suppose you cold rewrite in bat for windows.

from pathlib import Path
import uuid

seedfile = Path(".HOST_UUID")
if not seedfile.exists():
    UUID = uuid.uuid4()
    seedfile.write_text(str(UUID))
else:
    UUID = seedfile.read_text().strip()
print(UUID)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文