Most DRM solutions are trivial to bypass and generate "valid" keys once folks get even a basic sampling of keys.
Any decent DRM system will use public key cryptography to make sure that the only practical way to generate valid keys is to have the private key.
Of course that doesn't stop someone hacking the code to remove the check or replace the public key, but at least it lets you easily and reliably identify pirates.
I don't see how that is applicable. If you do not require online validation the program itself needs to validate the key and any decent hacker can extract whatever counts as the private key from the executable.
If you require online validation you don't need public/private keys, it's much simpler and safer in the long run to create completely random keys and store them in a database, together with whatever usage information accumulates.