I have written some software that I wish to sell to end-users and I'm investigating license servers. Keygen-sh mentions on their website (https://keygen.sh/docs/validating-licenses/) what to do when the user is offline while trying to validate their license with keygen's server. I'm interested in option three:
Validation request failed e.g. timeout
The failure could be for a number of reasons, but the most likely culprit is that your user doesn't have an active internet connection. You could handle this in a variety of ways, but here are a few ideas:
Begin a grace period (e.g. 30 days or 5 additional product usages), where you disallow access to the product if a license validation has not been successful after that timeframe. You should clearly tell your users that they should connect to the internet when possible and be upfront about the grace period.
Immediately disallow access to the product. This should be used with care, and is not recommended unless your product relies on an active internet connection.
Fallback to offline license key validation if you're utilizing cryptographically signed or encrypted license keys (see the API reference for more information).
In case of option 1, how am I supposed to check that 30 days have past since their last active internet connection? If I store the last date in a .txt file, they could simply delete that file.
That brings me to option 3. But how does the cryptographic check validate for expiration? The code (https://github.com/keygen-sh/example-python-cryptographic-verification) doesn't seem to use the system time.
I'm aware that I can't prevent my software from being cracked. But it shouldn't be as easy as deleting a file or cutting the internet connection. Let's assume they don't tamper with their system time and they won't decompile my code.