-1

I'm building an application, where the user needs to buy a serialkey.

But how do I structure the key?

My scenarios are:

There is a Main application, which needs to be secured by a serialkey.

Then there are different types of plugins, and they also need to be secured.

But how can I struct my keys, when the number of plugins allowed should be stricted by the serial key?

Ex. 152t6g9-rr6g4gd2d-g4r5r4hy8

Has access to the main program and plugin 4

66jgf-5tgj5ii-55f21r

Has access to the main program and plugin 2,3 and 4

And also the manin program, should be locked on the larger version numbers..

How could I achieve that?

theodox
  • 12,028
  • 3
  • 23
  • 36
Jesper TP
  • 137
  • 2
  • 11
  • Check this out http://stackoverflow.com/questions/715251/out-of-curiosity-how-are-serial-numbers-generated-hints-algorithms – Ahmad Al Sayyed Sep 17 '14 at 16:57
  • that doesn't address the question. He wants the key to identify the number of allowed plugins. That requires cryptography, not just a GUID. – Nicholas Terry Sep 17 '14 at 17:08

1 Answers1

0

Thats a very general question that can be implemented any number of ways.

the simplest solution off the top of my head would be using Rijndael to encrypt an xml document that has the number of plugins you will allow and other information. Have a shared secret key that is encrypted into the program (using dotfuscator or something) and decrypt the "encrypted' xml. Finally, examine the decrypted xml and allow whatever the document says to

For example:

heres a sample (unencrypted) xml-doc:

<document>
  <allowed-plugin-count>12</allowed-plugin-count>
  <some-other-secret-property>foo</some-other-secret-property>
</document>

then, encrypt the xml-doc using your compiled-in shared secret key and rijndael, heres the 'serial key' (this is a sample, not real):

skdghdfgert34568lkdfsgh09456kl6fhfdhjyhjyfj

issue that key to someone and when they plug it in, run the decrypt using the compiled-in shared secret key to get the xml-doc

Finally, allow or disallow plugins based on the document.

just as a note, my example links c# code.... use rijdael (or any other symmetric cipher available for your chosen language)

Nicholas Terry
  • 1,812
  • 24
  • 40