4

Im building a small winforms app using: ayende rhino licensing. The licensing is working fine, I can create licences and distribute them as I choose.

The problem is, How do I make each license work on just one machine? I know there is a class in ayende's project called LicensingService which I believe does something like what I'm trying to do, but I just cant figure it out. I've done quite a bit of searching and couldnt really find any tutorials except this one.

Maybe someone has implemented this, or has some tips on how I could accomplish this? I do have access to a webserver, if that helps.

Any help is much appreciated, as always.

JDx
  • 2,615
  • 3
  • 22
  • 33

2 Answers2

1

I do not know what exactly is a rhino licensing. To tackle your need generally there are two approaches.

  1. Either give some randomly generated password to the client machine, and maintain a pool of passwords in your server. Each time a password is entered to register the application in a local machine, check if it was already registered elsewhere by connecting to your server via internet.

  2. Or, what we do is, generate a code unique to that machine (perhaps a hash of some unique machine id, say mac id) and get the client sent it to you. You would then rehash the code and send it back using some logic. Now when the client enters this code to his machine do the same thing: fetch the very machine id, do the same rehashing using the same some logicand check if it matches.

I cant think of anything else

nawfal
  • 70,104
  • 56
  • 326
  • 368
  • Thanks for your reply. Number 1 sounds like the best solution for this particular app, i'm going to use it in combination with denied66's answer. – JDx Apr 02 '12 at 12:16
  • 1
    @JDx I think you missed the point. The accepted answer by denied66 is the same as my 2nd option. How do you use both option 1 and 2 to tackle your problem? – nawfal Apr 02 '12 at 12:35
1

Depends how annoying you want to make it for your users to be honest. You could implement a HWID (see How to fast get Hardware-ID in C#? on how to generate them) which will be unique from system to system, then have your program check if the HWID matches the ID found to the place you store them on-line (usually by using a database).

Needless to say, this will make your application require internet connection in order to run which might be a bit frustrating for your users.

Or you can merge the HWID with the serial and have your application do the same to verify if they match, but that would be easily cracked by the average cracker.

In the end of the day, .net isn't the best as far as security goes since you can easily get the source code and modify the assemblies as needed to patch certain protections. Keep that in mind when deciding what route you want to take to protect your software.

Community
  • 1
  • 1
denied66
  • 644
  • 7
  • 18
  • Thanks for your reply, this sounds like a good idea. I'll give it a try, I realise .net is not the best for security but I just want to stop users being able to copy the app from machine to machine and it still working. Thanks again. – JDx Apr 02 '12 at 12:16