Crazyd22
Crazyd22

Reputation: 771

Lock usb when plugged in c#

I am trying to make a program that when a usb is plugged into the computer it will lock the usb, so it is not accessable, and then when the user enters the correct password the usb will be accessable.

Is this possible?

Any help would be appreciated, Thanks.

Upvotes: 2

Views: 2400

Answers (4)

cmw
cmw

Reputation: 894

I've noticed in other secure USB thumb drives that the encrypted, inaccessible portion is not considered a removable device (it shows up as another hard drive). The part that launches the executable to "login" to the encrypted drive is on a removable device.

FYI the device is a Imation PivotPlus.

Upvotes: 0

David
David

Reputation: 73594

I found several articles by googling "usb policy c#". Here's the first one and it looks straightforward. The results also showed some CodeProject hits, which you can usually download and learn from.

Upvotes: 3

Jakob Borg
Jakob Borg

Reputation: 24515

What you are talking about is called "device control" in the security world. Commercial solutions exist in many flavours (Google it or take the question to SF/SU) but unfortunately I think it's quite complicated to implement on your own. In particular I think you would need to modify the device drivers in the USB layer, which in turn might disqualify C#. You would also need to whitelist certain devices or types of devices, for example your keyboard.

You could perhaps disable USB completely (in the BIOS for example), if it's a notebook and you don't strictly need USB for a keyboard or anything.

Upvotes: 1

Will
Will

Reputation: 1591

Use something like http://www.truecrypt.org/ - it ensures all data is inaccessible until correct password is entered.

Upvotes: 0

Related Questions