Software license registration file issuance and control

Asked

Viewed 1,209 times

6

I have a system to control and issue electronic license registration files, so I have control of how many machines my software can run. My teacher advised me to use the CPUID processor to validate and generate a license file (get the CPUID and make a calculation on top of it, so the result would be unique to each processor) and the validation would be made at the time of installation, the requests would be made to the server that would request the CPUID from the machine and return the license file.

Are there other ways to do this license registration control? Is there an API or feature? And how can the implementation be done?

Here follows my basic prototype that gets the CPUID and performs a calculation. There are two functions string getCPUID() and double CalculaCpuId(string cpuid) is the basis for generating the electronic license record file.

Function getCPUID:

private string getCPUID()
{
    String cpuid = "";
    try
    {
        ManagementObjectSearcher mbs = new ManagementObjectSearcher("Select ProcessorID From Win32_processor");
        ManagementObjectCollection mbsList = mbs.Get();

        foreach (ManagementObject mo in mbsList)
        {
            cpuid = mo["ProcessorID"].ToString();
        }

        return cpuid;
    }
    catch (Exception) { return cpuid; }
}

Function CalculaCpuId:

private double CalculaCpuId(string cpuid) 
{
    if (string.IsNullOrEmpty(cpuid))
        return 0;

    double resultado = 0;
    int soma = 0;
    string digito;

    for (int i = 0; i < cpuid.Length; i++)
    {
        digito = cpuid[i].ToString();
        soma += Convert.ToInt32(digito, 16);
    }

    resultado = (soma / ((Math.Pow(2, 2)) + 4));

    return resultado;
}

I am using Visual Studio to develop my system that needs license registration control.

  • 1

    A simple method that I have successfully used to limit machines that can run software is the "hardlock" (gives a googlada). Other methods I’ve used involve using a license manager server - either on the client’s network or in the cloud (depending on the constraints of the client’s environment); or a simple counter of simultaneous access to the system’s application server (if there is an application server; also, if the server allows farm, you have to worry about the centralized count of accesses).

1 answer

2


Taking the processor ID is not a solution, this information may not even be available. And this was not even done to identify which is the individual processor. Any solution trying to identify the machine has potential to fail.

One that they use and usually works better in some situations is take the serial number of the disk. It is far from being a perfect solution, on the contrary, it has its own flaws. I don’t like WMI much but if you want to continue using search for DeviceID.

There are ready-made software that can do this for you.

  • In this case to implement would be the same logic as mine, take the serial number of the disk and check with the server at the time of software installation, and after installation whenever the software starts and would redo the calculation generate the license number and see if it matches the number that was generated for the first time that was treated in the served, this?

  • Yeah, until something goes wrong. If you’re thinking about protecting the software, that doesn’t solve much except for someone who just wants to hack in if there’s nothing to protect. If software is not worth it, no one will hack it. If it is worth it, it is given a way even with this measure.

  • I want to prevent it from being copied msm. Like, if the customer bought to use on two machines, he will have to buy another license to use on a third machine, so that he does not install the software on a lot of machine.

  • I’m no lawyer, but I’m telling you, this is illegal.

  • What you suggest, to do the control, like how it should be done, or how it’s done?

  • I didn’t know this was illegal, I’ve witnessed many companies use this model, I thought it was part of the software contract.

  • Control is one thing, prohibiting the person from installing where they want is something else. The only time I saw anything like this described in the commentary was Microsoft, and it stopped doing it quickly. Apart from this, there may be some unsuspecting and unknown companies. My suggestion is not to worry about this. Piracy does not usually occur as one thinks it will occur.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.