Software licensing mechanism without internet [closed]

六眼飞鱼酱① 提交于 2019-12-08 09:57:29

I think you have several options:

  1. As described in the comment, don't make your license floating but machine specific by incorporating the unique IDs of all allowed machines in the key. Upon startup check the unique ID of the current machine against the key
  2. Use your current approach but with the difference that the server is not on your side but on customers premise, i.e. a license server the customer needs to install somewhere.
  3. Implement some kind of self check: Each running instance sends its unique ID into the network and in turn listens for the unique IDs of other running instances. The first instance that receives more than four unique IDs via the network shuts itself down. I guess this could be implemented using UDP broadcasts. The implementation of this is not that trivial:

    • You need to make sure that exiting one instance and starting a new one right afterwards doesn't lead to a shutdown elsewhere.
    • Furthermore, you might want to implement a check that the machine is indeed networked

    If I were to implement something like that, I would introduce the following three package types:

    • Start: Instance just started and broadcasts its ID for the first time. All other instances need to broadcast their own ID as an answer. The reason for this is twofold:
      1. Fail fast
      2. Ideally, the instance that has been started last should exit if the maximum number of allowed instances has been exceeded. It would not be ideal if one of the already running instances would shut down.
    • Periodic: All instances periodically send their unique ID, just in case a previous transmission was missed
    • Exit: If one instance is closed it tells this fact the other instances

In all cases, you should think about encoding the number of allowed instances into the key, so you can later hand out differently sized keys.

Make it a requirement to have central licensing server. Each program on startup registers with that server. The server tells the client if it can start or not. In case of 5 programs are already started, the program refuses to start.

when the program stops, it tells the licensing server again that it's license is not needed any longer.

Job done. No internet required.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!