Clavem

Machine fingerprint

A machine fingerprint is a hash computed from one or more attributes of a computer, used as a stable identifier so a licensing server can recognise the same device again without storing the raw attributes.

How it works

The app reads one or more identifiers from the machine, joins them with a fixed salt, and hashes the result. The hash goes to the server with the activation request. When the same machine activates again, the same hash comes out, and the server can treat it as the same device instead of a new one.

import { createHash } from 'node:crypto';

const fingerprint = (rawId) =>
  createHash('sha256').update('inkwell:v1:' + rawId).digest('hex');

fingerprint('564D1C3E-2A0B-4C5A-9E21-7F3B8D6A0C11');
// fd4a38a3b2a4f07228852c753bfe66119ede8b52e527d361fdad8a3e37556deb

The id above is made up. The output is 64 characters, inside Clavem’s 200-character limit.

Stable and unstable inputs

Input Problem
Operating system machine id Stable across reboots. Changes on a reinstall, and cloned disks copy it.
Hostname The user renames it. Many machines share defaults.
Disk serial number Changes when the drive is replaced.
Network adapter address Changes with adapters, docks and virtual interfaces.
CPU model and RAM Not unique. Identical laptops give identical values.

One stable id beats five unstable ones. Every extra input is another reason for the hash to change and lock out an honest customer.

Collisions and drift

Two failures matter. A collision is two machines producing the same fingerprint. Example: a studio buys 40 identical laptops and the app hashes only CPU model and RAM. The server sees one device. A drift is one machine producing a new fingerprint. Example: a customer swaps their disk and burns a seat. Collisions give away extra use. Drift costs you support tickets. Tolerating a rare collision is usually cheaper than locking out a paying customer.

Machine fingerprint versus hardware ID

A hardware ID is the raw value read from the machine. A fingerprint is what you derive from it: salted, hashed and safe to send. The raw id never leaves the device.

How Clavem handles it

fingerprint is an optional parameter on POST /v1/licenses/activate, up to 200 characters. The docs say to send a hash, not a raw id.

  • Activating again with a fingerprint already active on that license returns that seat with its name updated. It does not use another seat.
  • The token returned carries the fingerprint as fp, so your app can compare it with the local value. The token is not bound to a device by itself.
  • Without a fingerprint, every activation call takes a new seat.

The repo’s guides use a hash of the Mac’s hardware UUID in Swift and node-machine-id, which returns a SHA-256 hash, in Electron. The WordPress guide hashes the site URL, because a plugin’s identity is the site, not the machine. Python has no portable stable machine id, so its sample sends none. See the Electron activation guide, the API reference and fingerprinting pitfalls.

Questions

What should a machine fingerprint be made from?

A value that is stable for the life of the installation and different on every machine, such as an operating system machine id, hashed with a salt that is specific to your product.

Should the fingerprint be sent as plain text?

No. Send a hash. The raw ids are private to the machine, and a per-product salt stops one vendor's fingerprint from matching another's.