Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a program that runs only when I insert the USB drive?

Tags:

python

windows

Let me explain what it's like. I want a program that's installed in a PC but you can't run it unless you insert a USB drive where some part of the program is stored. So the point is, the program is useless if you don't have both PC and USB drive. Since I want it to run in Windows, what kind of language shall I use apart of .NET and C#?

Can I done with Python?

like image 470
Devyn Avatar asked Feb 12 '11 12:02

Devyn


2 Answers

If you're trying to do this for copy protection or license management, there are commercial solutions for this that are very difficult (but still not impossible) to beat. For you to develop something that's robust will end up costing you more than it would cost to license a solution from Pace or Aladdin or any of their competitors.

like image 121
bgporter Avatar answered Sep 21 '22 22:09

bgporter


Commercial solutions often have (usb) devices with a microchip that can do public-key cryptography. This rules out faking the device.

Example: program generates a challenge-code, encrypts it with public key -> device decrypts it with it's secret key (stored in microchip) and gives the challenge-code back for verification.

An attacker can only attack the communication between program and device or directly the program. This is were code obfuscation, on-demand code decryption, ... comes into play. Very complicated :) and no system is 100% safe.

like image 36
tauran Avatar answered Sep 19 '22 22:09

tauran