hardware – How to safely generate a license related to 1 computer for each user

I'm trying to sell software based on a subscription and I can not find a good way to generate a serial key for this case.

When the user buys the program, he will be asked to open it for the first time on the computer that he will use. When the program is opened for the first time, information from some computers is sent to the server. A key is created from this information and then stored in a database so that the user connects to the server to check whether it is the same computer.

This program is designed to operate ONLY online and ONLY on 1 computer.

The main goal is to operate each license ONLY on 1 computer without creating bad experience for the user. (like reset key every day)

I have already read a lot about hardware information, but as a beginner, I do not know what information can be easily changed, nor what information should NOT be used for this purpose.

In this case they have a button to reset the key, this button can only be used once every 3 days (in order to prevent the user from sharing his license).

I need to design a sufficient key to verify that it is the same computer and that this key can not be different each time the user turns on their computer or after an update. (It does not matter if this changes when the user updates his hardware).

  • Any information related to this that I can read.
  • ANY example, pseudo-code, code, etc.
  • No matter what method to achieve the main goal.
  • Everything you think is useful.

After all, it's more about security than code or programming language. This is to help me find a way to reach my goal, namely a secure method of licensing related to 1 computer.

I've already read how I should ask a question, but in case this question does not belong to the present application or is incorrectly formatted, thank you to report it to me as soon as possible so that I can modify it / delete it.
Thank you in advance.