Results 1 to 6 of 6

Thread: how to generate license keys

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    how to generate license keys

    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

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    There are several software products designed to do that, try a simple google search

  3. #3
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575
    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.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784
    You are right Lithia ... do you have any suggestion for this purpose?


    Regards
    Winanjaya

  5. #5
    Junior Member kylek's Avatar
    Join Date
    Oct 2003
    Posts
    21
    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.
    INDEMNITY a legal exemption from liability for damages.
    VBForum Name: kylek
    BLOG | FORUMMARK | VENTURE CREW | DORMLIFE

  6. #6
    New Member
    Join Date
    Jan 2004
    Location
    New South Wales, Australia
    Posts
    3
    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:
    1. Public Function KeyHandler(Un As String)
    2. For xt = 1 To Len(Un)
    3.     Ua = Asc(Mid$(Un, xt, 1))
    4.     Ua = (Ua / 2) \ 2 + 15
    5.     If xt = 1 Then Key2 = (Ua * 20) & "-"
    6.     If xt <> 1 Then KeyHandler = KeyHandler + (Ua * A Number)
    7. Next xt
    8. KeyHandler = Key2 & KeyHandler
    9. End Function

    The just call it:
    if text2.text = KeyHandler(text1.text) then goto OK:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width