Software Licenses
Saturday, June 4th, 2005One of the problems in distributing commercial software is piracy. A certain amount of piracy has to be tolerated for a product to be successful -
1976, First Documented Case Of Software Piracy - Bill Gates writes “An Open Letter to Hobbyists” complaining of first major case of software piracy - Altair BASIC was copied widely even before Microsoft made it available (Bill Gates lost track of a copy on paper tape during a computer show). He backtracked on that letter pretty quickly.
The kinds of clients I deal with would get into more trouble with internal audit through having unlicensed software on their computers than with me personally. Anyway, I developed a licensing mechanism for Studio which is basically very simple.
It relies on public/private key cryptography. I create a text file that contains the license information, such as user, license type, expiry date, domain or ip restrictions, and digitally sign it with my private key. The public key is embedded in Studio, and at some points during the execution of studio it loads the license file and uses the public key to check the signature matches the contents of the file. If the file has changed in any way the check fails. Once I have validated the contents, the rest is easy - I read the contents out as properties, and these are checked at various points in the code, including checking the expiration date against the servers being used. There is also code in there to detect the license being abused on the same network.
To create a license, I simply edit the license file I want, and run a signing program. One day I might get around to releasing it either as freeware or as a product. Or maybe as a product with source.
In addition to the license file, one has to protect java code with obfuscation. Due to the nature of java, the class files can be decompiled exceedingly easily. To make this more difficult, one can use an obfuscator that renames pretty much everything so even if the decompiler did not break, the code would look like garbage.