I’m working on a copy protection function for my upcoming plugin. Here’s a quick summary of what I have so far:
- When the plugin is instantiated, it calls my copy protection function (this will probably be inlined in my release code, to make things slightly harder to crack).
- The copy protection function looks for an XML nitialization file, which is created by the installer for the plugin, and put in a known place. For OSX, I am using ~/Library/Application Support/[companyName]/[pluginName] for the directory. Not sure about the best path for Windows, as this has changed for Windows 7.
- The XML initialization file is parsed to see if there is a valid serial number/ keyfile there.
- if the serial number/ keyfile is present and validates, then the plugin enters into the active mode
- if the serial number / keyfile isn’t there, a FileChooser window is called (or FileChooserDialogBox), asking the user to provide the path to a file that contains the serial number / keyfile.
- if the serial number isn’t present in the new file, or if the user declines to provide a path to the file, or if the serial number doesn’t validate, the plugin enters demo mode.
- if the serial number in the new file is validated, the program enters active mode, the serial number is put into the XmlElement, and the XmlElement overwrites the original XML file.
- Where is the best place to call my copy protection function from? Right now, it is called when the plugin is instantiated, but this happens when the host starts up. Is there a location that would be better? Is there an AudioProcessor “initialization” function that I should call the code from, rather than instantiation?
- Is it OK to store the serial number / keyfile as an XML attribute, or should it be an element?
- Any advantages to FileChooserDialogBox over FIleChooser?
- What type of encryption would be best?
- Any other tips you can put in a public forum? (feel free to PM me if you have private tips you feel like sharing)