Generating Cryptographically Secure License Keys in 2021
keygen.sh
keygen.sh
A system that requires keys to not only be algorithmically valid but also pre-registered at time of purchase with a central authority (buy online and we'll email you your key) makes key generators implausible, because you don't just need to generate something that matches the algorithm, you need to hit an exact target from a set of keys that happen to currently exist in a presumably secured central database of customer keys.
At that point the kind of key you use is completely irrelevant, because algorithmic generation of valid keys is meaningless when faced with pinpointing which of umpty gazillion key possibilities actually exist in a remote database before the server cuts off your access for spamming invalid keys or for providing a key that 10000 other people have also provided. You could concatenate a few calls to rand() for all it matters then.
Also, this comparison is flawed:
> "It's also worth mentioning that keygens are much more valuable to bad actors than cracks, because a keygen can be used on the real application, vs the bad actor having to distribute a modified, cracked version of the application."
You don't have to distribute the cracked application. You can distribute the binary patching tool which also can be used on the real application. (What does "real" mean here anyway?)
A keygen is only more valuable if applying the binary patch is harder than discovering the key algorithm across version updates. I guess this is where OS application certificates have to step in. Hurray for our code-signing gatekeeper overlords.
This would seem true to most people, and I had the same assumption over 5 years ago when I started Keygen. But you would surprised at how many software vendors, and end-users, do not consider an online-only licensing system a viable option. Take Sublime Text -- as far as I know, they do not use a licensing server that "calls home" (I'd bet their user base revolt against such a thing.)
There is a sizeable portion of my customer base that rarely even uses the API -- they use Keygen to generate signed offline-first license keys which they distribute to end-users. They only use the API for customer support and reporting purposes.
I like having the best of both worlds -- an online-first, offline-capable licensing system. But to be offline-capable, your key algorithm has to be secure, otherwise bad actors will just go offline to avoid the part of your system that works.
With all due respect this service seems to alleviate the most simple to implement parts of a licensing scheme while not solving the actually challenging parts. Even combined with a sophisticated obfuscating tool it leaves a lot of holes to be filled by the end user.
[0]: https://github.com/keygen-sh/example-cpp-license-validation
Edit:I guess this is slightly offtopic since the article talks about the offline activation method not the online one.
That particular C++ example does not include signature verification, but there is another example repo [0] for that.
[0]: https://github.com/keygen-sh/example-cpp-request-signature-v...
Of course this requires the attacker to purchase at least one license so its a partial victory :^)
But it is worth mentioning -- I am working on improving the request signature header to include more info such as current token and date. Just need to finish some other stuff on the roadmap first.
And these are the facts:
1. The new version of the application no longer verifies the 0th subkey.
2. The new version of the application now verifies the 1st subkey.
3. The 1st subkey is located at indices 10 and 11: 0000-0000-00XX-0000-0000.
4. We possess the parameters to generate a valid 1st subkey: 10, 0, 56.
See a pattern?
Oddly, this gave me goosebumps. Very well written. I was happy to see Ed25519.