dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: product key help

  1. #1
    Join Date
    Oct 2008
    Posts
    65

    product key help

    say if i were to release a big peice of software, like microsoft products.
    how could i put a product key in it so only the person that has the key can install and run it????

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: product key help

    You mean like put in A=123 somewhere, and the customer has to enter 123 before it will run?

    That's all it takes, although there are better methods.

    How secure do you want to make it? Do you want to answer activation calls at all hours?

    You can also pay someone else to do that for you.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Oct 2008
    Posts
    65

    Re: product key help

    well im talking about like there is a long textbox and if you buy the product you have to put in the key.

    for example, my 30 day trial runs out tomarrow and inorder to keep the program i must purchase a product key. like:

    E8D87-2KDY6-9JHY8-CMN19-RO2H8

    hope this helps you to understand.

    regards!

  4. #4
    Join Date
    Oct 2008
    Posts
    65

    Re: product key help

    any suggestions?

  5. #5
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: product key help

    This is how it usually works...

    - App generates a unique ID string at first start and shows this to the user in the "please register me" window.
    - User copy/paste the unique ID into a form on (your) website.
    - The website uses an algorithm to convert the unique ID into a unique answer and gives that to the user.
    - User copy/paste the answer into the "register me window".
    - Each time the program starts it checks if the answer is correct and then runs as a full version. If the answer is not correct it shows the "register me" window again and runs in demo mode.

    This is of course just a generalisation, but one which you can build upon to make it more secure. In any case a cracker with a debugger could remove the check done at the start of your program and as such bypass your security.

    On which of these steps do you require suggestions?

  6. #6
    Join Date
    Oct 2008
    Posts
    65

    Re: product key help

    i dont know how they get the unique id though. like for each program there is a different one.
    i thought i whent like:
    you open the program and it asks you for the key if you dont have it you can use the unregisterd version. but if you do have it you can put it in and use the full version.
    what i need to know is how to put a different register key into each program that will match one on my site.

  7. #7
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: product key help

    You can calculate a key by using the hardware in the computer. Things like the MAC address and motherboard + HD info can be used for this. You can concatenate all this info in a string and then MD5 it so that you get a binary hash. This hash you then show in the registration window as a key and due to the way you generated it from the hardware components you know it will be unique to that particular system. You can add a simple checksum to it so that if users type it over (instead of using cut/paste) you can detect any possible typing errors in the key when users enter it on your website.

  8. #8
    Join Date
    Oct 2008
    Posts
    65

    Re: product key help

    thanks that explains how to get a key. but i just need to look into this a lot more.
    anyways thaks for your help!

  9. #9
    Join Date
    Mar 2007
    Location
    Argentina
    Posts
    579

    Re: product key help

    Quote Originally Posted by Edders View Post
    ...
    In any case a cracker with a debugger could remove the check done at the start of your program and as such bypass your security.
    (Side note: hey, I would be proud if my program attracted enough interest for a cracker to make a crack )
    Does not simply write a check routine like this:
    Code:
    If UserEnteredKey = MyValidKey then
        'Run the code
    Else
        'Ask the user to enter again a valid key
    end if
    Because it only takes a cracker to change a single bit in your code (the IF evaluation from false to true) without even bother to reverse enginnering your key.
    Instead encript some vital piece of data with the key.
    [Vb.NET 2008 (ex Express)]

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)