11-19-2021 07:38 AM
I was wondering if it is possible to password protect my external hard drive or USB flash drive with a LabVIEW executable or VI.
Is there some way to auto-run an executable when the drive is mounted/ plugged in.
any ideas??
11-19-2021 08:05 AM - edited 11-19-2021 08:08 AM
Well, trying to do that with LabVIEW seems a bit of a roundabout way to do things.
Generally if you buy external USB drives from Western Digital or Samsung you also get software with them, usually pre installed that allows you to configure a password that needs to be entered before the USB storage can be mounted as a readable drive. The way this usually works is that the drive basically has two seperate partitions, one small one containing the encryption and decryption tool and another hidden one that the will be mounted by the first tool on starting the decryption tool and entering the correct password. Protection does not count on just the fact that the partition is hidden but it is in fact encrypted using a key generated from the entered password and can only be decrypted with that key, so without password the data on that partition is totally unintelligent, even if you manage to mount it in other ways. All this stuff goes fairly deep into the OS and while LabVIEW as a complete programming language could certainly call the necessary Windows services to do all that too, finding out what needs to be called, how and in which order is a major task with a huge potential to only work for your specific OS version that you test it with.
And while you can make a USB storage device autostart when plugged in, this is a major concern of infecting computers, so in most company managed computers this feature is specifically disabled, so even if your USB drive is prepared to autostart your decryption mounter, it will usually not be executed as the OS has this feature specifically disabled. The user usually will have to go into the visible small partition that is unencrypted, start the mounting program manually and enter the password no matter how much you prepared the drive to autostart.