Hardware-locked licensing
How hardware-locked licenses bind a key to a device: machine IDs per OS, why hardware IDs can be spoofed, device secrets, limits and customer resets.
Licensing concepts
Offline license validation lets software confirm its license without contacting a server at that moment. It works by checking something the vendor signed earlier, usually a time-limited lease cached after the last online check or a license file delivered separately, against a public key built into the application. Signatures stop forgery, but nothing on an offline machine can stop someone from turning the clock back, so offline periods should be limited.
Last updated
| Approach | How it works | Good for | Trade-off |
|---|---|---|---|
| Cached signed lease | After a successful online check, the server returns a signed lease valid for a set number of hours. The application accepts it while the server is unreachable. | Intermittent connectivity | Needs a first online check; a revocation waits for the next contact. |
| Signed license file | The vendor issues a signed file naming the license and its terms. The software verifies the signature with a built-in public key. | Self-hosted and server software, long offline periods | A copy that never connects never learns about a revocation. |
| Request and response files | The software writes a request file with its device ID; the customer carries it to a connected machine, and the vendor returns a signed response file bound to that device. | Air-gapped machines | Manual steps for the customer and the vendor. |
Velsigil’s SDKs implement the first: signed offline leases for your applications. Its panel can also issue signed license files (a feature of Velsigil’s Studio plan), which Velsigil itself uses for its self-hosted installations; the SDKs do not verify them. Velsigil does not implement request-and-response file activation.
Every successful online validation returns a fresh lease when the product allows offline use. A Velsigil lease is a compact signed token:
token = base64url(JSON payload) "." base64url(Ed25519 signature over the first part)
payload = { v, typ: "lease", productId, licenseId, activationId, hwidHash,
plan, features, licenseExpiresAt, iat, exp }
hwidHash = SHA-256(hwid)
exp = min(iat + offlineLeaseHours * 3600, licenseExpiresAt)
Offline, the SDK accepts a stored lease only if, in this order: the signature verifies with the public key built into the application; typ is lease; the product ID matches; hwidHash equals the SHA-256 of this device’s hardware ID; and the current time is before exp. Because exp is capped by the license’s expiry, a lease never outlives the license. Because it is bound to the device, copying a lease to another computer does not work.
The seller sets the offline lease hours per product, from 0 (no offline use) to 8,760 (one year). The default is 24 hours.
Whatever you choose, the lease never runs past the license’s own expiry date.
An offline check has nothing to compare against except the device’s own clock. A signature proves when a lease was issued, not what time it is now. A user who sets the clock back can keep the device’s time before the lease’s expiry for longer than the real lease period. No offline scheme can fully prevent this.
Velsigil’s SDKs use the local clock plus an offset they learned from a signed server answer, and an online check replaces the lease whenever the server is reachable. Beyond that, the defense is keeping lease hours as short as your users can tolerate and validating online whenever possible.
Revoking a license on the server cannot reach a device that stays offline. What matters is what happens the next time it connects. Velsigil’s SDKs delete the stored lease as soon as the server gives a signed, definitive refusal: invalid key; expired, suspended, revoked or banned license; revoked device; failed device verification; device limit reached; device not activated or not found; blacklisted; or product disabled. A successful check without a lease, because the seller turned offline use off, also deletes it.
Other refusals keep the lease, such as maintenance (product_paused), a required update or a temporary activation limit. So a revoked license stops working offline as soon as the application reaches the server once.
The most important rule in an offline design is when to use the cached lease. If an application falls back whenever the online check fails, an attacker only has to block or tamper with the answer to switch it into offline mode. Velsigil’s SDKs for C#, C++, Python and Node.js fall back only on network_error: no connection, a DNS, TLS or timeout failure, or a 502, 503 or 504 from a gateway without a Velsigil error body. Any answer from the server, including an unsigned error, is returned as is, and an answer that fails verification is invalid_response, never an offline pass.
Leases fit applications that are online most of the time. Server software that customers install on their own networks needs something that works without any network call: a signed license file, delivered with the software and verified with a public key built into it.
Velsigil itself, installed on a buyer’s server, is licensed with a signed license file (.lic) instead of a lease. With Velsigil’s Studio plan, the panel can issue such files per product (opt-in):
License files and leases are separate mechanisms. The Velsigil SDKs verify leases, not license files: to use license files in your own software, you would need your own verifier.
Keep reading
How hardware-locked licenses bind a key to a device: machine IDs per OS, why hardware IDs can be spoofed, device secrets, limits and customer resets.
How license keys get shared, forged or replayed, and the defenses that work: signed answers, replay protection, hashed keys, device secrets, rate limits.
What a self-hosted license key server does, what it needs to run, and how to decide between building, renting or running one yourself on Linux or Windows.
Add license key validation to a Python app: verify signed server answers, bind devices, cache offline leases and know the limits of bytecode obfuscation.
Early access
Early access is free. In exchange, we ask for your feedback while we prepare the paid launch. Spots are limited, and we reply to every request by email.
Early access ends when paid subscriptions launch; we will tell members by email before then. To keep using Velsigil after that, you need a subscription. The 30% discount applies to the first 12 months of either plan, paid monthly or yearly.
Opens your email app with a short template: company, what you sell, your platforms and languages, expected license volume and how you plan to deploy. You can also write to hello@velsigil.com.