Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secure algorithm for creating license keys?

Tags:

I would like to distribute an application, but have license key that they can enter to unlock. What is a good algorithm to create a concise key that contains information about what version they have purchased, as well as additional things such as duration of license, etc.

I realize this protection can be cracked, but it keeps honest people honest. I may or may not implement online activation, but I am mainly concerned with a good way to generate these keys.

We have all seen this situation, what algorithm works best? Should I ask for a plaintext name of the user and use that to create a unique product key based off of their own information?

Is there a system that can be used to make it near impossible to generate a valid key?

Perhaps a public/private keypair encryption situation where only the manufacturer has the private key and the data can be validated by a public key, but the public key cannot be hijacked to create valid keys.

As this is a product key, it would be great if it were fairly short, 64 characters or maybe 128 max, but the shorter the better, 32 or less would be great.

like image 965
Kekoa Avatar asked Jun 18 '09 22:06

Kekoa


People also ask

How are license keys generated?

License keys are typically created and delivered via a license generator once a software user has paid for the software and has agreed to the terms and conditions set out in the End-User License Agreement.

What is license key management?

Through the issued License Key, LicenseKey Manager allows you to have full control over the distributed software. With the provided limits and options, you can easily license your software in many different ways.

Where are license keys stored?

You can try finding the license key location in the registry for a product using the following instruction: Open the RegEdit program. Please check this path in the registry: "HKEY_LOCAL_MACHINE\SOFTWARE\<Vendor_name >\<Product_name or Product_name_version>\"

Why is a license key important?

To put it simply: license keys protect software and software creators to guarantee that software isn't being used improperly without a license. A product that doesn't use a license key as part of the activation process, will be subject to illegal use, impacting the company's profits.


1 Answers

You didn't say what platform you are on, but here's one in Microsoft .Net:

Really Simple Licensing Scheme for .NET

This page documents a very simple licensing scheme that you can use with your .NET application. It is intended to be fairly secure, easy to implement and easy to extend. The sample version allows you to provide license files with a client name embedded in them but you can easily extend it to add other identifying information, machine bindings, expiry dates, etc.

This scheme makes use of Microsoft's RSA library and XML Signing. Basically you put whatever you want into an XML Document and sign that document. Then you can provide that file to your customer and the application can read the license information out of that file. Since the file is digitally signed the license file can NOT be tampered with unless you release your private key (which you really shouldn't do).

like image 199
Robert Harvey Avatar answered Oct 06 '22 23:10

Robert Harvey