Bind a license to a key the device holds
A hardware fingerprint feels like it binds a license to a machine. It does not. It binds the license to a string the machine computed about itself — a hash of the machine GUID, the volume serial, the CPU — and then sends that string to your server. Your server can only do one thing with it: check that the string it received equals the string it stored at activation. It cannot tell whether the…
A hardware fingerprint appears to bind a license to a specific machine. However, it doesn't; instead, it links the license to a data string generated by the machine itself. This string is a hash of the machine's GUID, volume serial, and CPU. The hardware fingerprint merely sends this string to the server, which checks whether the received string matches the one it stored during activation.
The fingerprint is just data, and data can be copied. The crucial question Node-locking seeks to answer is whether the device presenting the license is the same one it was originally issued to. The fingerprint answers a weaker question about the presence of the correct string, which is insufficient if the string can be obtained by an attacker.
The stronger solution is for the device to prove it possesses something it cannot easily copy, such as a private key. During activation, the client generates an asymmetric key pair, keeping the private key securely stored on the device and only transmitting the public key to the issuing service. Notably, the private key remains on the device.
At activation, the client generates an ECDsa key pair and saves the private key to secure storage. It then sends the public key to the issuing service as part of an ActivationRequest. The issuing service incorporates the public key into the signed license, along with other claims like product, tier, and expiration date. The license file can then be safely copied since it doesn't contain the private key.
Verification occurs through a challenge-response handshake. The server generates a random, single-use challenge with a short lifetime and stores it. The client signs the challenge with its private key and sends the signature back to the server. The server checks two things: the authenticity of the license (verified by the vendor's signature) and the possession of the private key bound to the license by the device. If both conditions are met, the license is valid for the specific device.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to