I’m trying to decide how to implement a very basic licensing solution for some software I wrote. The software will run on my (hypothetical) clients’ machines, with the idea being that the software will immediately quit (with a friendly message) if the client is running it on greater-than-n machines (n being the number of licenses they have purchased). Additionally, the clients are non-tech-savvy to the point where “basic” is good enough.
Here is my current design, but given that I have little to no experience in the topic, I wanted to ask SO before I started any development on it:
- A remote server hosts a MySQL database with a table containing two columns: client-key and license quantity
- The client-side application connects to the MySQL database on startup, offering it’s client-key that I’ve put into a properties file packaged into the distribution (I would create a new distribution for each new client)
- Chances are, I’ll need a second table to store validation history, so that with some short logic, the software can decide if it can be run on a given machine (maybe a sliding window of n machines using the software per 24 hours)
- If the software cannot establish a connection to the MySQL database, or decides that it’s over the n allowed machines per day, it closes
- The connection info for the remote server hosting the MySQL database should be hard-coded into the app? (That sounds like a bad idea, but otherwise they could point it to some other always-validates-to-success server)
I think that about covers my initial design. The intent being that while it certainly isn’t full-proof, I think I’ve made it at least somewhat difficult to create an easily-sharable cracking solution. Also, I can easily adjust the license amount for a given client/key pair.
I gotta figure this has been done a million times before, so tell me about a better solution that’s just as simple to implement and provides the same (low) amount of security. In the event that external libraries are used, I prefer Java, as that’s what the software has been written in.
I’d suggest it probably isn’t worth the trouble. The clients may not be all that tech-savvy, but if it is worth their while, they’ll hack around it, and if it isn’t they won’t be using your software anyway.
You don’t discuss the configuration process – how do you know which machine contains the MySQL database. You don’t discuss what happens if the MySQL database goes down.
Frankly, the first time there’s a problem, they’ll probably work out that either they don’t like the software enough to continue using it or they will work out how to circumvent the system. Even if the end users aren’t tech savvy, they probably have in-house tech support who will be.
I would not waste your time on that. If you want a licence management system – use a professional one. Otherwise, work on trust and sensible legal terms.