I'm considering an environment in which I will have to identify a computer.

In this scenario all hardware parts (CPU, HDDs, RAM, etc) won't change, while I'd like to consider a changing OS.

The goal is not to have to rely on any additional software or hardware other than the computer I want to identify and the plug-in software (like an executable on a usb key).

The goal is to have a unique identifier of the computer that isn't easily guessed and ideally can be manipulated to obtain an identifier with entropy high enough to be used to encrypt a message.

I can't find a better solution than obtaining the UUID of the computer and hash it.

I would obtain the UUID in Python in this way:

import uuid

I was hoping there would be a better way to identify a computer.

  • 1
    Random and unique? You have a rather unusual choice of words there. Furthermore, "the UUID" of a machine does not exist. A simple device like a mouse may lack uniqueness altogether A complex device like a PC has multiple unique parts, and these may even change somewhat dynamically (laptop/docking station).
    – MSalters
    Sep 17, 2019 at 14:27
  • You're right I will rephrase, more than randomic I'd need something with a high entropy or anyway hard to guess or replicate. Regarding the UUID that's the point I'm not sure about
    – kknickkk
    Sep 17, 2019 at 14:32
  • 1
    You had me until you want this as a default key instead of an identifier. It seems like you have an X/Y problem. You can solve the key problem without the "static id with high-enough entropy".
    – schroeder
    Sep 17, 2019 at 14:37
  • 2
    If it's fully random, it is indeed hard to replicate. But then it doesn't identify the hardware anymore. The two concerns are fundamentally at odds. To identify hardware, the process must be fully replicatable.
    – MSalters
    Sep 17, 2019 at 14:38
  • 3
    @kknickkk: "...I can circumvent the entropy problem hashing the ID..." - hashing is deterministic. I does not "generate" entropy. Sep 17, 2019 at 14:52

1 Answer 1


uuid.getnode() in python returns the MAC address of one of the network interfaces installed - if there are none, it returns a random 48-bit number with the eight bit set to none as per RFC 4122.

That's as likely as good as you'll get. The UUID of the computer doesn't exist but often certain pieces of hardware have unique identifiers such as the CPU and any network cards. Of course, any of those bits of hardware could be swapped out. Since uuid.getnode() returns a random 48 bits on failure, and those 48 bits aren't secure, then you are much better off just using something like Crypto.Random.random.getrandbits(N).

All that said, you can identify a Windows computer to a small group, even if it's not unique, by looking at the key. How you do this will depend on your language, but it is definitely possible. You could also look at all the drivers currently loaded and use that as a method, which Windows itself has used and means a hard drive taken and inserted in another system won't work. Of course it also utilises information in TPM etc.

As stated in my comment, if you want a repeatable seed for running experiments then set it manually. If you want a random string, use various options available that have a high degree of entropy such as mouse movement.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .