Summary: License protection for Monkey-made plugins.
The licensing implementation in Monkey plugins has been made to look the same as other Robert McNeel & Associates products, though the security is not as good as with official McNeel license codes. (Please read the disclaimer before you use this feature.)
The licensing system has to cater for the following needs:
When you compile a new Monkey-made plugin, you can check the [Licensed plugin] box on the Compilation page in the Wizard to unlock the license options:
If you do not check the [Licensed plugin] box there will be no licensing code whatsoever. If you do not intend to sell your plugin this is probably what you want. If you do check the box, you'll have to set the license settings before you can complete the Wizard and compile your plugin. Press on the [License options…] button to change the settings. The first time you enable the licensing option, this dialog will be opened automatically.
You have to do two things when making a license protected plugin:
The product password you choose has to be unique and hard to guess since it is the only thing that stops other people from generating valid licenses for your product. You can specify any text, as long as it is safe (your dogs name, your highschool sweethearts dogs name, your aunts dogs name and so on and so forth). You will also need to remember this text if you intend to generate more licenses at a later time (when you save a license table, the product password will be saved for you, so you don't actually have to remember it. Also, if you save your plugin project as an *.mcp file the license password will be stored). Whenever you change the product password a new example key will be generated and displayed on the form. You can copy this key to the windows clipboard (in case you need one quickly) with the [Copy key] button. This example license is only one of many valid license keys that will unlock a plugin protected by your current password.
The product code is merely a decorative item. It helps to determine which product a certain license key is for. For example, if you see a license key like this:
You immediately know it will unlock a copy of Rhinoceros 3.0. As you can see the product code uses two letters and two digits to identify the product name and product version. However, you can pick any combination of letters and/or digits if you are so inclined. The product code has no effect on the license validity and it will be visible on the registration dialog which users have to fill out (see below).
When you are happy with the current product password and code, you can save a textfile with any number (one thousand by default) of unique, valid license keys. (Actually, there is no guarantee they are all unique, that would be impossible since there is only a finite number of valid licenses per password. However the chances of duplicate keys are very small indeed.) If you plan to do the bookkeeping yourself, you'll want to have a Text file, which can be easily opened and edited in notepad. If you plan to make an automated frontend for license distribution, you're probably better of with the XML file, which can be parsed using available tools. Below you see a portion of a Text license table file. (For a description of the License XML format see this page):
When you give a license protected plugin to a customer, you also have to supply a valid key. Your customer will have to enter this key whenever your plugin loads for the first time. He/she will see a registration box with a blank field. The user is allowed to enter 4 invalid keys before the plugin fails to load:
The registration dialog is smart enough to extract the license from a garbled string. It will ignore casing, whitespace, non-alphanumeric characters and the product code. Hence, the following strings will all work:
The instruction message on the registration dialog uses the name and version of the plugin that you specified in the plugin attributes. If you have supplied a valid URL for the Website (not the Update URL) field in the attributes, there will appear a link to your website on the registration dialog. The name of the link will be the Organization you entered in the attributes.
Once the user has entered a correct key and subsequently pressed the [Register] button, the plugin will create a new registry key under HKEY_CURRENT_USER\Software\<YourPluginName>\License which will be used to determine whether or not the plugin has already been registered whenever it is loaded again. If you want to disable the registration you have to delete or change this registry key. As you will notice the key is stored under Current User meaning your plugin must be registered with every user before he/she can use it on the same machine. This registry key contains a value field with a string containing the date and time of registration and value field with a hashcode which makes it impossible to transfer this particular registration flag to another PC.
We put a fair amount of effort into making the Monkey compiler licensing system secure and untransferable, but there are no guarantees whatsoever regarding the uncrackability of compiled *.rhp files. A motivated, experienced cracker will have little problems circumventing the license check. If you desire better security you'll have to use 3^rd^ party obfuscators, installers and/or encrypters.
This software is provided on an “as is” basis without warranty of any kind, expressed or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. The person using the software bears all risk as to the quality and performance of the software. The author will not be liable for any special, incidental, consequential, indirect or similar damages due to loss of data or any other reason.
Copyright © 2007 Robert McNeel & Associates.