Skip to content
/ yamid Public
forked from vsrs/yamid

Yet Another Machine ID

Notifications You must be signed in to change notification settings

mdyring/yamid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A lightweight crate for retrieving the unique machine ID without needing root/admin privileges. Uses OS APIs only and does not spawn new processes!

IDs sources

  • Windows: the MachineGuid value from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography (Identifying Unique Windows Installation)
  • Linux: /etc/machine-id with a fallback to /var/lib/dbus/machine-id (man page)
  • macOS: IOPlatformUUID
  • FreeBSD: CTL_KERN : KERN_HOSTUUID sysctl(3) with a fallback to /etc/hostid
  • Other Unix: like FreeBSD, requires testing!
  • Not yet implemented:
    • iOS
    • Android

Security Considerations

A machine ID uniquely identifies the host and should be treated as confidential, avoiding exposure in untrusted environments. If your application requires a stable unique identifier, avoid using the machine as it is. Instead, hash the machine ID securely with a fixed, application-specific salt.

Warning

Hashing IDs is not only a best practice today, if you store the ID somewhere (like your remote server), you actually must do it by law according to GDPR (see identifiers) and similar regulations.

Tip

Virtual machines deployed from the same template often share the same machine ID. To differentiate them, include the MAC address when hashing.

About

Yet Another Machine ID

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%