How to generate CD Keys

Where can I find an algorithm to generate and include CD Keys in my applications?

In C# or C++

CD Keys like Microsoft uses for it's applications (ex. XX35-KJ32-PLKF-K43J)
LVL 2
evo_xAsked:
Who is Participating?
 
AndyAinscowFreelance programmer / ConsultantCommented:
Whatever you wish.

This is one possibility:
http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm

0
 
StephanLead Software EngineerCommented:
Take a look at this: http://ellipter.com/

This will give you an insight how you can generate your keys.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
I don't know if there is a 'standard'.  In fact if one thinks about it then a standard way could be abused.

You will need code to create a key AND code to check the key the user enters is valid.

I suggest you need to think about what information you require in the key.  What format the key has.  What sort of extra padding you want in the key to give a constant length.  Possibly one or two chars for a checksum type of validation.  Finally an encryption routine to then hide things.

I've done things like having an expiry date as 5 digits, the 1st in char 4, 2nd in char 11....
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
evo_xAuthor Commented:
I need to include the product id, version number and reseller id
any method would be good as an example.
0
 
evo_xAuthor Commented:
AndyAinscow: That is what I am looking for but that is a commercial library, I want to implement my own instead of paying $250
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
OK.
What I did was sit down with a piece of paper and list what I required.  Worked out how many digits I needed, then jumbled the digits around.  A couple of hours and everything was coded.
0
 
evo_xAuthor Commented:
And what encryption method should I use? which is free of course for commercial use.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.