Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
Hi, for my future programs i would like to learn how can i protect my applications. My idea is that when i install my program on the client computer, the program should only work when a specific USB is inserted on the same computer (that contains some.. hmm files? (later more)). Lets say i have gave him a calculator made by me (just a simple example), well when he opens it i want first to check if the correct USB is plugged and if it contains the right informations in it (something like a secret code?)...

Well i think that is it for now, if i think of something more I'll let you know..
Thanks in forward.

P.S. I am working on C# in VisualStudio 2008..
P.P.S. I hope i am not asking too much, and if i wasn't understandable enough, please tell me so (i ll try to be as much as I can :))


Edit:

Well this is what i am thinking now. I can put a simple text file in the USB drive, with some code written in it (e.g. 89asd70a98d), and when the programs run it will open the text file from the usb and check if it is as it should be.. Now cause i wouldn't like that text file to be accessed by others, i could simply hide this file (so far i come to this free software winmend, if you have used any other softwares that hide files on the usb and are satisfied by it, please share it with me :)). But now i would not know how to determine the real path of the usb, cause sometime it can be d:\ e:\ etc.. Is there a way with using a code to determine on what usb is the file? (as there could be inserted more then one usb at the same time..)
Thanks again :)
Posted
Updated 24-Mar-11 1:31am
v2

Hey!

There are a couple of solutions available to accomplish that. If you want a real secure solution, you'll need to have USB-Dongles with a public & private key pair. You may for example use this[^] hasp.

If you don't want a real secure solution you can develop something yourself (for example, check for existance of a certain file on your USB drive).

Eduard
 
Share this answer
 
Personally, I would never use a piece of software that required a dongle be plugged in so that it would run.

You'd be better off having it verify itself over the internet, which could be easily configured to allow the software to run a certain number of times without an internet connection before it prompts the user if the server can't be connected to. You could use the MAC address as a machine ID, and whenever the mac address changes, just prompt the user to re-enter his product key, and update a remote database.

Hardware dongles are so 1980's.
 
Share this answer
 
Comments
Eduard Keilholz 24-Mar-11 8:00am    
The MAC address is easy to spoof...
Sergey Alexandrovich Kryukov 24-Mar-11 15:36pm    
Agree with you, my 5. (And I also would avoid such software, this is good point.)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900