tags:

views:

210

answers:

3

For C# in a winForms environment, I've licensed my classes by writing specifics to the regestry, encrypted.

Under Mono there are some facilities that are not available to you. The Registry is one of those. What method would you use to license your code under Mono?

I don't want a malicious user to be able to delete the application directory, to reset the trial timer or to copy a .LIC file and suddenly have access to the program.

Any ideas would be appreciated.

+2  A: 

Any kind of encrypted certificate license ought to be at least as secure on Mono as it is on Windows. Deploy the app without the certificate. If it doesn't detect the certificate, its in 'reduced functionality' mode. If it does, then its in 'full mode'. Only issue certificate on purchase. For full-functionality-time-limited trials you run into a bigger problem, but at the end of the day, there was nothing stopping the user from messing with their registry, even to the extent of running your app in a VM or using System Restore liberally.

GWLlosa
+1  A: 

The registry is available to you using the standard .Net Registry classes. You can write your encrypted values there, and retrieve them later.

However, the registry on Linux is just a file in the user's home directory, so what you can't really do is modify it from outside Mono, like from a .msi (as an example, .msi's don't exist on Linux).

jpobst
I've read that Mono dies if you try to use a RegistryKey class. Is this not true???
Jerry
Have you tried it with the latest mono release? :)
Robert P
Support for the Registry has been in Mono for about two years now. If Mono dies when using it, please file a bug as this needs to be fixed.
jpobst
+1  A: 

You could always encrypt a file based on the CPUID and store it in the directory. I am not sure how storing a file on the hard drive is different than storing something in the registr. A user could still find the registry key export / import it as needed. It would be restricted to that machine only if you use the CPUID or Motherboard information to encrypt the data with.

bdwakefield