Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac or Motherboard as a unique identifier for licensing purpose?

OK so i was using MAC address as a unique identifier , all went good until i activated a VPN and the mac address changed.....

So, i have 2 options:

1) Get the MAC Address of the actual physical network card

For mac address i found several tips on how to achieve this:

  • Link1
  • Link2

2.) Get the motherboard ID and use that instead, and hope we dont get 2 computer with same id( is that possible? )

public String getMotherBoardID()
{
    String serial = "";
    try
    {
        ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT SerialNumber FROM Win32_BaseBoard");
        ManagementObjectCollection moc = mos.Get();

        foreach (ManagementObject mo in moc)
        {
            serial = mo["SerialNumber"].ToString();
        }
        return serial;
    }
    catch (Exception)
    {
        return serial;
    }
}

What do you say? Should i try to dig and find code that gets the mac address from the card and not the virtual ones, or should i just switch to motherboard? And i don't need to combine anything, i just need something that is not going to change so easily on the targeted computer.

like image 594
syncis Avatar asked Oct 08 '22 01:10

syncis


2 Answers

Its better if you could use a combination of values from Motherboard, NIC and harddrive.

You may check this article: How To Get Hardware Information (CPU ID, MainBoard Info, Hard Disk Serial, System Information , ...)

like image 151
Habib Avatar answered Oct 09 '22 15:10

Habib


I think an approach similar to the following would be as secure as it can get

  1. you give the user a license key for the software, tied to e.g. customer's name or company
  2. user inputs this data in the program
  3. each time the program is fired, it "phones home" sending licensing info
  4. if license is verified (by your system) to be valid, the software would receive back some data which actually make it able to function. Otherwise it wouldn't work no matter what (some parts would be missing).

An example (i'm thinking C# from now on) of not being able to run unless it's licensed, would be to make some fundamental method extern. You'll send the required assembly in response to a valid license, or fallback to a "Gotcha!" warning.

like image 20
Alex Avatar answered Oct 09 '22 13:10

Alex