This is just to keep honest customer honest.
Is there any operation system limitations? I think following approach will be quite simple:
Choose a way of getting machine id. For example this can be MachineGuid
registry entry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography
. (Generating a unique machine id)
Define features which you are planning to licence and the way to identify them. You can just name them. If your product is simple it can be a feature itself.
Create public/private key pair.
Retrieve customer's machine id in some way. You can ask him to send it manually or you can create a simple utility or it can be a special command in your application.
Combine feature id and machine id in some way and sign result with your private key. For example you can make that combination by concatenation. In that case result string may look like this: "YourApplicationName-12345678-9abc-def0-1234-56789abcdef0"
Signature will be a sequence of bytes, so if you want to pass it in text form you should make some conversion to it. For example you can convert signature to Base64 string. The combination of feature id, machine id and signature of their combination will be a licence key!
Include public key in your application distribution and add logic for licence verification. If licence is valid then you should check that it's being used on correct machine and in correct application.
More on public/private key operations here.
Please tell if something is unclear and I will try to provide detailed answer.
EDIT: I'm sure that implementation of all of this can be done in 1 day, but I agree with others who suggest you to use existing solutions. There are plenty for different platforms and programming languages.
Why don't you just get one from someone else. If you are only willing to put one day in, you aren't going to get a good product.
A license key won't stop the customer from installing you software several times unless the key is tied to a hash of the server name etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With