Thread: how would i generate a product license with options and key with set char lengh?

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    4

    Question how would i generate a product license with options and key with a set char lengh?

    hey guys/girl,

    please could you help me with this. I have been searching around and found some ideas but need some more input. Here is what I am trying to achieve.

    We currently sell machines with options, currently you need a password to dis/enable the options. Sometimes wrong ones get turned on, and the password also gets passed around. Each machine has a mac address.

    What i want to do is, the customer would go to a screen on the machine which would give them a key based on there calculation on there mac address, this key would be similar to a product licence key xxxxx-xxxxx-xxxxx-xxxxx

    The customer would then phone the office, we would use this key with desktop software and enable the options they need. Give this new key to the customer and it would then enable the options.

    I do not need strong encryption, so what i was thinking of was something link this:

    options by me an array, default would be 0

    example: mac add + current array of options x 56 / 3 + private key (some simple calculation)

    this would give me answer A

    but how would i make answer A in the alphanumeric xxxxx-xxxxx-xxxxx-xxxxx format?

    then i would need to do the reverse on the pc side, using the same private key, then set the options i need.

    Then pass the new public key to the customer.
    When entered into the machine use the public key with the private key, work out new values of the options then enable or set them, if the mac address matches.

    i hope this makes sence..

    if you can think of a better way please advice, or if i have made a mistake.

    thanks

    I need to do the above in C, once I learnt the method, am sure I can do it in C# or Java on the pc side.

    (the os is VxWorks, which i don't think makes a difference, but here for reference)
    Last edited by Equal; 05-18-2011 at 06:30 AM.

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    First of all, unless you have control over the machine itself, whatever you do has to make sense to it ... not you. There's no point going through all this if you end up not being able to converse with the machine.

    This sounds more like a database problem... build a database keyed to MAC addresses with the password and options on record ... Customer calls, look up the MAC addres... "Ok enter the following..."

  3. #3
    Registered User
    Join Date
    May 2011
    Posts
    4
    Quote Originally Posted by CommonTater View Post
    First of all, unless you have control over the machine itself, whatever you do has to make sense to it ... not you. There's no point going through all this if you end up not being able to converse with the machine.

    This sounds more like a database problem... build a database keyed to MAC addresses with the password and options on record ... Customer calls, look up the MAC addres... "Ok enter the following..."
    thanks for your reply.

    I don't building the database is going to work here, we have trouble with IT trying to get medi wiki installed at the moment.

    Also this all depends on the guys building the machine reading the mac address, generating the keys, and then saving them.

    Either way how would i get a value say in the format 123456789 into xxxxx-xxxxx-xxxxx-xxxxx?
    This is the bit I cannot seem to find the answer too, or get my head round. It would also have to work in reverse.

    thanks.

  4. #4
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    *installs virtual (software) shared network driver across all network computers*

    *installs IP filtering driver across all network computers*

    *installs server level firewall and routing software on spare machine*

    *executes 38 character command*

    I've now punned the MAC address visible to installed software on all my machines.

    Using only a MAC address or even a MAC address and "a very simple calculation" will not get you very far if you want to control access to software features.

    Neither, I'm sorry to say, will any other strategy do much for you.

    Do yourself a favor, keep your "DRM" simple and you may accidentally keep your customers happy.

    Soma

  5. #5
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Either way how would i get a value say in the format 123456789 into xxxxx-xxxxx-xxxxx-xxxxx?
    Considering that you've said you need to be able to "reverse this on the pc", you'll probably want to look at a simply encryption mechanism with a padding strategy and the original license key and MAC address as "seeds".

    Yea, I know, "seeds" is a bad word here, but I could really think of a better hint.

    Soma

  6. #6
    Registered User
    Join Date
    May 2011
    Posts
    4
    Quote Originally Posted by phantomotap View Post
    O_o

    *installs virtual (software) shared network driver across all network computers*

    *installs IP filtering driver across all network computers*

    *installs server level firewall and routing software on spare machine*

    *executes 38 character command*

    I've now punned the MAC address visible to installed software on all my machines.

    Using only a MAC address or even a MAC address and "a very simple calculation" will not get you very far if you want to control access to software features.

    Neither, I'm sorry to say, will any other strategy do much for you.

    Do yourself a favor, keep your "DRM" simple and you may accidentally keep your customers happy.

    Soma
    Quote Originally Posted by phantomotap View Post
    *executes 38 character command*
    no idea what this is, but will google it later.

    the machines are not "normally" on a network, these are machines used for weighing in the industry. Trust me when i say simple will work. We have service engineers and customer who find it difficult to change the ip address of the machine and to ping it, never mind anything you may have said. There is nothing valuable to steal from the machine.

    I understand your concerns and appreciate your time, but am just after something as mentioned above.

    thanks for your input though.

  7. #7
    Registered User
    Join Date
    May 2011
    Posts
    4
    Quote Originally Posted by phantomotap View Post
    with a padding strategy and the original license key and MAC address as "seeds".
    padding sounds like something i could read into, thanks! Not sure how, but will think about.

  8. #8
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Look into base32 encoding if you want to get a string of letters and digits from binary data. libmcrypt is a decent, free encryption library that you can probably use for whatever DRM you end up with.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GPL license when using another's code
    By OakRand in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 05-11-2006, 06:03 PM
  2. Picking a license
    By Hannwaas in forum Tech Board
    Replies: 4
    Last Post: 07-01-2005, 05:59 AM
  3. MS Academic License for VS.NET Pro
    By lightatdawn in forum Tech Board
    Replies: 4
    Last Post: 03-27-2004, 08:48 AM
  4. License agrement
    By Barjor in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 03-18-2002, 05:32 PM
  5. License Question (GNU/GPL)
    By Isometric in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 11-25-2001, 12:03 AM

Tags for this Thread