Xelestial

hi everyone!

i have a problem regarding the security of my program (exe).. how can i prevent it from being copied to another computer



Re: Visual C# General prevent exe from being copied

Peter Ritchie

I'm not sure what this has to do with Visual C# General; but the only way to stop a file from being copied is to stop it from being read. For an exe file, this makes it pretty useless.






Re: Visual C# General prevent exe from being copied

boban.s

One common way is to have procedure for creating serial based on user's hardware configuration for which that serial will work. Suitable hardware id that will be base for generated serial is DiskId which is unique. So when you generate serial for that disk id, then you will prevent your application to work if disk id and serial id of your application are not in correct combination. Second way of protection is to use webservice. So user whenever want to use your application will need to login using his login account on your service and only then use the application. You will prevent one user to log-in from different machine (storring again some hardware information), or prevent using application in same moment from two or more machines.






Re: Visual C# General prevent exe from being copied

CalvinR

Not that I'm condoning piracy or anything but you will need to assume that if you create software that becomes in anyway popular that no matter what you do or how you try to protect your software that someone will break the system that you use. The only way your copy protection system will be effective is if your software never becomes popular. As far as I'm concerned your simply going to wasting time trying to implement any sort of copy protection scheme.





Re: Visual C# General prevent exe from being copied

H. Tony

if the user is not allowed to copy the file to any network drive, cannot copy/burn it to any removable storage device, cannot send the file out as attachement in email or upload it any where, I think it's probably safe to say it's prevented to be copied to another computer.

not sure if there's any kind of system event can be hooked up to the file to monitor that kind of activity. I personally know nothing about such mechanism.

just another thought, if the user can only access a shell program, which launches the real program which he cannot access directly through impersonation, is that a safe work around for this problem





Re: Visual C# General prevent exe from being copied

CalvinR

Another reason why I don't like Copy Protection is I don't think it is a good idea to treat your paying users like criminals.




Re: Visual C# General prevent exe from being copied

Xelestial

to Peter Ritchie - I asked in the "Where is the forum for.. " and this is where i was said to post my question since it is in C#...

to Boban S. - Thanks for the suggestion... but could this be done programmatically

to H.Tony - That's one of my problem because it is located at the server and it could be accessed by anyone.

to Calvin R. - I don't have a problem with the users... I am just thinking of this idea because there are other people (third party vendors) who might try to copy it and then use it with our other clients without our permission first.





Re: Visual C# General prevent exe from being copied

Jones the Code

Your problem won't be fixed with a technical solution. It can be mitigated with appropriate application of an I.P. attorney, however.





Re: Visual C# General prevent exe from being copied

H. Tony

first you need to make sure the file on the server can only accessed by administrator or privileged users. then you can consider the 'shell' possibility where every user of the program can access this shell to launch the applicatoin but wont be able to read the application directly.

Xelestial wrote:

to H.Tony - That's one of my problem because it is located at the server and it could be accessed by anyone.






Re: Visual C# General prevent exe from being copied

boban.s

Xelestial wrote:

to Boban S. - Thanks for the suggestion... but could this be done programmatically



Of course, but It's not ten lines of code and have several functional parts.
What you need is to get the information about client machine. You can get several information about it's hardware, first of them is DiskId which can be retrieved with API function GetVolumeInformation (search for code in codeproject). You can also get NIC adress of network card, motherboard id, processor id. These id's are not unique but you can use them too. Next you need to create procedure for generating Serial Key for your application which will be generated based on those hardware id's retrieved. On application start you will always check if combination of hardware and active serial number is correct and if it's not you will ask user to get new license. Only problem is how to get that info from users machine. Simplest way is to force user to create request for new license from your application. So when first he will not have a serial, a dialog will be shown for entering user personal info, and a button for Request. You will send this infos, but also you will gather all machine info, and send that to your webservice, or to create a file that he will need to send to you as mail. When you will recieve this info, you will run the provided machine info trough serial key generation procedure and you will have a serial. After you check that user have paid for the application (some payment service or some other way), you will send the serial using mail or letter.
If you use webservice for serial validation, then you can change licensing a litle. You will have request license form on client application, where user will fill personal data and send a license request filled also with machine info. When he pay for the license, you will just activate it. Client application will just call some license function on your webservice on every application start and always in the request will send also machine info. You will just validate combination of license and machine info and return a result. If result is valid license, then you will start the main application form, otherwise you will give user an invalid license message and close the application.


Hope this is a good starting point.