Easiest way to limit executable to running on a ce

2019-04-08 04:33发布

问题:

I am trying to create an executable that will only run on one machine. What is the easiest way to achieve this? A license file? Or is there a machine address much like the MAC for network connections I could hardcode into the executable?

回答1:

If it will run on only one machine, then... simply secure the machine and only store the executable on this machine.

That's, unfortunately, about the only reliable method.


Longer answer:

  • bits can be copied
  • programs can be dissassembled
  • dissassembly can be reverse engineered (though it's sometimes long)
  • the cost of reverse engineering can be made higher than the value produced by the program, possibly at a higher cost that the value produced by the program.

If you look long enough at the software industry:

  • DRM: fail
  • Licenses: fail
  • Licenses with web activation: fail

If it's worth cracking, it'll get cracked.



回答2:

The easiest way would be to make it illegal via licencing. Trying to enforce this technically is impossible, and only hurts your users (user?): What if they reinstall the OS, or change their network card, or upgrade their CPU?



回答3:

There is no solution that is 100% effective, and there is no solution that is "easiest" and also "highly effective." There typically is a continuum of "effective" and "drives users crazy" that you need to be very careful about.

The MAC address is not a horrible place to start. It's not that difficult to change your MAC address, but if you have multiple instances of the same MAC on the same subnet, their machine won't work, so it's good for keeping many people on the same subnet from running your product without licenses. The problem with MAC is that on desktops, the MAC changes if the network card changes; that ticks off your paying users.

A license file is generally better than modifying the binary. You should sign the license file, however, so that it can't be easily modified.

Your application itself is always the weakest link. A dedicated attacker will just remove the test from your application. There is no universal solution to this problem. A good approach is always around "keeping honest people honest" by making it easy to license your application correctly, and easy for the user to determine if they've done so. You can easily spend huge amounts of money trying to annoy people who will never pay you anyway.



回答4:

I think my answer to another question applies here.

This is a legal issue, not a technological issue. Your goal should be to make it easy for people who want make sure they have valid licenses to your software. Rather than securing your code against people who want to steal it, you should focus on helping customers that are worried about accidentally using it without a proper license.

I'll also repeat my comment from yet another question:

I think "keeping honest people honest" is the right mind set to approach this problem. Nothing can be cryptographically secure, but having some sort of unique key or number for each license can actually make it easier for business customers to account for their software, and that adds value to your product. Onerous DRM (that doesn't work) aimed at thwarting criminals (who'd never pay anyway) is just an obstacle to paying customers.



回答5:

If you want to create only one copy of your executable file and if you have access to the machine on which you have to install the executable file, then it is okay to hardcode the MAC address into your executable file. In case you want to distribute more than one copies of your executable file and if you don't have access to all the machines, then you might code the executable file to demand a license file which is generated form the MAC address of the machines. It is a sort of software activation.



标签: c++ security