I work on an application that is to be sold to businesses. The businesses expect to pay for a given amount of license (eg. 5 licenses for 5 computers).
We have implemented a customer specific license file that enables the software to work, but one could simply reuse this license for any number of machines. This is no good. Imagine you are a company that pays for 5 licenses only to find out you could get by with a single license. Sure it would break the terms of use, but nobody would know.
I believe I can bind the license to a single PC via a MAC address / CPU etc., but if I want to do this I need to authenticate the license as it binds to the PC. So the problem I am having is how to authenticate the license on the initial run?
What I am thinking is, I need an external license server that will receive requests, check if valid by looking up instances that this license has been activated, add instance and return a response that will tell the PC it is ok to authenticate/bind the license. I am able to encode the messages and handle the authentication at the PC side. What I don't know is how to go about setting up the server and the request / response (communication) part. I am a complete novice when it comes to networks and I don't want to waste days or weeks just to find out the approach is wrong.
I see two possibilities:
- using
python socket
on the server and the PC to communicate.
I should be able to write this up in a few lines of code, however I am finding it difficult to find a service that would enable me to host a socket. Eg. PythonAnywhere does not support this ("Can I use websockets, or run my own socket server? I'm afraid not -- we only support Python apps that implement the WSGI protocol" source: https://help.pythonanywhere.com/pages/#im-a-beginner-learning-python), google app engine also seems not to https://cloud.google.com/appengine/docs/standard/go111/sockets and I had similar indications for others.
- have the PC issue a http request (
python requests
) and have the server respond to it dynamically (flask
ordjango
!?).
I have absolutely no experiences using either flask or django and it seems like I would need to commit a lot of time to this. It seems like an over complicated thing to do and I don't even know if it can be done.
Are the approaches valid? What option is the appropriate one? Other options?
I am aware everything can be hacked. I only have to make it so that someone can't simply copy the executable to a different PC and have it run there with no real effort.
Help appreciated!