Coding a Complex Key?

Dar Scott dsc at swcp.com
Thu Jun 13 00:36:01 EDT 2002


On Wednesday, June 12, 2002, at 10:42 PM, Josh Dye wrote:

> I noticed that RunRev's Licensing system is VERY complex. And I want
> something like that for my upcoming software. What I basically 
> want is a Key
> Generator.

Try this.

Break your key into the clear portion (including fixed characters), 
the encrypted portion, the random portion, and the hash portion.  
You can make the last three parts all look like digits or some code 
so the boundaries are not clear.  You might want to include 
serialization to make sure keys are unique or use a large random 
number.

Here is how to make the hash.  Take the first three parts as a 
single string and run them through your secret per-product 
string-to-string function.  A simple function that simply 
concatenates your string to your secret product code can work for 
most cases.  Run that through the Revolution md5Digest() function.  
Convert that to text in some way.  That is the hash.

Here is how you generate the key:  Make the complete key by 
concatenating the first three portions with the hash.

At the product extract any clear and encrypted data you need.  
Also, take the first three portions and make the hash in the same 
manner as the key generator.  Check that it matches.

You might want to handle case and leading and trailing spaces or 
other input variation.

(Perhaps for your needs encrypted is too strong of a word; encoded 
might be better.)

Dar




More information about the use-livecode mailing list