How to write protect a USB key?

Solution 1:

Your findings are correct and there is no general solution that can help. Sorry.

I can only rephrase what you said:

Either they have a write protector switch or they don't

File System level protection that can vary between OSs and implementations

Microchip/key specific features, no easy way to know in advance - typically you would ask and get it manufactured to the specification e.g. I had one client who purchased some that were locked to read only after being duplicated. There was no way around this.

Solution 2:

Here are some ideas that may help fill your needs.

Software Tricks – Last Resort

There are a few software approaches that you can use in a pinch, but they’re mostly Windows-specific and it may be possible to bypass them – even if it seems unlikely.

Looking for a USB Flash Drive with Read Only or Write Protect Switch describes how to create a customized U3 partition based on an ISO file that will mount as a virtual CD-ROM. This will prevent items from being deleted from that virtual CD, but is not ideal for a system cleaning disk because the second partition can still be written to and infected. In addition, changing the contents of the protected area is a multi-step process that involves creating/updating an ISO file that is then used to re-create the U3 area on the flash drive.

USB Flash Drive Write Protection describes how the Windows Registry DWORD value WriteProtect in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies key controls whether USB devices are writable or write-protected. A value of 0 (zero) allows writing to USB devices; a value of 1 blocks writing to USB devices. Changes may take effect after a logoff/logon, but will certainly take effect after a restart. There are several drawbacks to this approach: it might be possible for software to bypass it, it blocks writing to all USB devices, it doesn’t take effect immediately – it requires at least a logoff/logon and possibly a system restart and you have to undo your changes because it affects all USB devices not just your flash drive.

Several applications (shareware and free) and instruction sets simplify the process of write protecting by filling up the disk by simply creating temporary files to consume all available free space on the drive. If there’s no space to create even a small autorun.inf file, it’s difficult to infect the drive since it won’t run items by default when the drive is connected to a PC. This is probably better than nothing since it will stop some infections, but it may also give a false sense of security – it’s not complete security. One of the several sites with instructions for this is Raymond.CC’s Create Fake Dummy File on USB Flash Drive to Enable Write Protect and Prevent Modification.

I’ve seen instructions for protecting the files on a drive by reformatting to NTFS, then removing all permissions except a very limited set. Much like filling the drive to capacity, this may work against some malware but it’s not 100% protection. Setting this up also depends on the which version of Windows you’re running (assuming that’s what you’re using) – non-business versions may not provide access to the security settings needed, and non-Windows systems will likely either ignore the security or not be able to read the drive. This also makes it more important to tell Windows to eject the drive before removing it, because it’s more likely that Windows will be waiting before writing changes to the drive.

http://www.fencepost.net/2010/03/usb-flash-drives-with-hardware-write-protection/