views:

206

answers:

1

I need to protect software using a USB key. Can I just query a USB drive with WMI and obtain the PnPDeviceId from Win32_DiskDrive Class, and compare it with one already hashed and hard coded in the application? How secure is this? Can the PNPDeviceID property be modified? Is hardware coded? Any other idea?

Logically the USB drives are going to be carefully selected.

Thanks

+1  A: 

It can probably be faked with a device driver layer, I don't know if it can be changed in the device - I have never seen anything to do it.
I was thinking of this as a cheap alternative to a dongle and a way to distribute the software.

One thing to be careful of - the very cheap USB keys don't implement this they just send a random (?) key when plugged in, so they get a new id when inserted in different ports.

Martin Beckett
Thanks for the advice, the USB drives are going to be selected carefully and buyed by myself. The USB dongle is not a solution because we need also to put part of the application in it.
backslash17
I meant I was planning on using cheap 1Gb USB keys with their unique ID instead of $50 deskey dongles. Probably not as secure but crackers will just get around it in the app anyway.
Martin Beckett