how to generate license keys (such as the CD keys on the case of most Microsoft software) based on user name ? any idea and or suggestion would be greatly appreaciated and many thanks in advance
Regards
Winanjaya
Printable View
how to generate license keys (such as the CD keys on the case of most Microsoft software) based on user name ? any idea and or suggestion would be greatly appreaciated and many thanks in advance
Regards
Winanjaya
There are several software products designed to do that, try a simple google search
i think he meant how to do it through code, so his app can generate the keys - that would be interesting to know how, I woudln't mind hearing it.
You are right Lithia ... do you have any suggestion for this purpose?
Regards
Winanjaya
In my understanding, the most common way is to hash the username, and some other piece of qualifying information as the hash key. For example if you wanted the program to be specific to a single computer you can use a username and the HDD #. Alternativly if you wanted it to be a bit more portable you can give a serial number with the product and use that with a username to create the hash.
There are lots of hashing algorithms, MD5 is probably the most popular because it is inpractical to reverse the hashing process (making for good password hashing), but I'd probably stay away from it if you are seriously trying to protect your software, a hacker would likely try it first. I would recomend taking a stab at making up your own algorythim.
Try thise links for more info:
The Secure Hash Algorithm Directory
Google Search
The Code Project Search
reHash (an open source project with lots of hashing algorithms)
That should get you more than started.
A good way to do this is to get the ASCII value of every character in the Registration Name and then times or divide that number by some other number.
For Example place this in your module and call it with the value you want to encrypt.
VB Code:
Public Function KeyHandler(Un As String) For xt = 1 To Len(Un) Ua = Asc(Mid$(Un, xt, 1)) Ua = (Ua / 2) \ 2 + 15 If xt = 1 Then Key2 = (Ua * 20) & "-" If xt <> 1 Then KeyHandler = KeyHandler + (Ua * A Number) Next xt KeyHandler = Key2 & KeyHandler End Function
The just call it:
if text2.text = KeyHandler(text1.text) then goto OK: