Legacy algorithms

Before standardizing the hardware ID algorithms, different LicenseSpring SDKs used to compute slightly different hardware IDs. Each platform that SDKs run on had a default algorithm and alternative algorithms.

Default Algorithm

1

Windows

The default hardware ID algorithm uses WMI to fetch Model, Manufacturer, Name, SerialNumber of the motherboard, processor and the system disk. Afterwards, it encodes them to provide a unique string that represents the current device.

2

Linux

The default device id reads the machine id from the /etc/machine-id file. This file contains the unique machine ID of the local system that is set during installation or boot. If this id is not found, it tries to read the /var/lib/dbus/machine-id file. If it still fails to get the id, it writes a generated UUID.

3

MacOS

The C++ SDK uses the gethostuuid() system call to get a unique identifier of the device. The .Net SDK gets the IOPlatformUUID value. The Swift SDK gets the machine UUID.

4

iOS

The Swift SDK gets UIDevice.current.identifierForVendor.

Windows Algorithms

C++ SDK

1

Gen2

Gen2 algorithm is similar to the default algorithm. It is safer and shorter than default. This algorithm retrieves the Manufacturer and SerialNumber of the motherboard, CPU name and id, and disk model and serial number. This algorithm can be useful for air gap licenses.

2

WinCSProductId

An alternative algorithm for Windows. It gets the UUID of the Windows machine using Computer System Product Id through WMI.

3

WinCryptographyId

An algorithm for Windows that doesn't use WMI. It gets Microsoft Cryptography MachineGuid from the Windows registry.

.Net SDK

1

Gen1

Includes minor improvements for ID calculation on Windows; on other platforms it is the same as Default.

2

Gen2 and Gen3

Safer device id algorithms on Windows; on other platforms they are the same as Default. Gen3 is a shorter form that can be useful for air gap licenses.

3

WinAlternative

This algorithm tries to get Microsoft Cryptography MachineGuid from the Windows registry. If this request fails or the .Net Framework version is earlier than 4.0, it tries to get the UUID of the Windows machine using Computer System Product Id.

Cloud Platform Algorithms

1

CloudPlatformsId

Useful when the software runs on Azure, AWS or GCP. It is a good option when the application will be used only on these platforms. If the application can be installed on other platforms as well, the AutoId algorithm should be used.

2

AutoId

Uses different approaches depending on your platform. If the application is running on Azure, AWS or GCP, it is the same as CloudPlatformsId; otherwise it is the same as Default.

3

AutoIdWinCloud

Also uses different platform-dependent approaches. If the application is running on Azure, AWS or GCP, it is the same as CloudPlatformsId; otherwise it is the same as WinCSProductId. This algorithm should only be used on Windows computers.

Hardware ID Usage

Configuration

After choosing an algorithm, set it in ExtendedOptions or LicenseSpringConfiguration.

C++
LicenseSpring::ExtendedOptions options;
options.setDeviceIdAlgorithm(AutoId);

The .NET SDK allows specifying the timeout for cloud platforms ID requests. It is useful when AutoId takes too long on a regular machine. This value is specified in milliseconds; the default is 200.

The SDK allows overriding hardware ID. For instance, you can use the MAC address as the hardware ID:

Was this helpful?