There are a lot of questions relating to license keys asked on Stack Overflow. But they don't answer this question.
Can anyone provide a simple license key algorithm that is technology independent and doesn't required a diploma in mathematics to understand?
The license key algorithm is similar to public key encryption. I just need something simple that can be implemented in any platform .NET/Java and uses simple data like characters.
Answers written as Pseudo code are perfect.
So if a person presents a string, a complementary string can be generated that is the authorisation code. Below is a common scenario that it would be used for.
Don't be afraid to describe your answer as though you're talking to a 5yr old as I am not a mathematician.
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.
A license key gives an authorized user/purchaser a data string that, upon installation, unlocks a software product and makes it available for use. Without the key, the software cannot be used. This prevents users from loading copies of the software to different devices.
To generate a code, simply set the SerialNo , ProductID , and OptValue properties, and read the result with the KeyCode property: Optionally, you can set the Salt property to make your keys more unique than the default.
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.
There is no reliable licensing algorithm. Really. Not even one. For the most popular, most expensive proprietary software you can buy, you can also find "key generators" and hacked versions that don't require licensing.
Instead of worrying about making it "unbreakable", just do something simple. A popular mechanism is to, at purchase, ask for the user's name, and then give him a license key that's derived from a cryptographic hash (e.g. MD5 sum) of the user's name, or some variation on it. Then, in the software you ask for their name again, plus the registration key (that MD5-derived thing); you check to see that they match, which activates the software.
Can this be hacked? Absolutely. Once someone figures out how you're generating the license keys, they can generate their own. But if you keep a database of the "official" license keys you've generated so far, at least you'll be able to identify the fraudsters later on (perhaps when they try to download "premium" content or something).
But don't worry so much about stopping the hackers from cracking your code. It's going to happen, but they're such a tiny part of the market that it won't significantly affect your overall sales.
I use a system like this:
• create a string from windows licence key + trial period end date
• generate a hash (Sha/md5) from the string
• convert the trial end date to an int (e.g. Number of days)
• the key becomes trial end date + some part of the hash
• convert the key to only uppercase characters to make it easier to enter
ABCD-DEFG-HIJK...
the validation works like
• convert key to bytes again
• extract trial end date
• create string from windows licence key + trial end date
• hash
• compare hash with rest of key
this makes it difficult enough for my audience.
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