I have a requirement to implement a feature (in C#) to lock a folder on a USB drive. After locking, in any PC without my software, this folder is inaccessible (or better inv
Have you had a look at TrueCrypt?
In general you shouldn't try to reinvent the wheel, especially with security requirements. This is a heavy topic and messing around with the file system on your own should be the last option to consider.
TrueCrypt uses two different modes of operation:
- File-hosted (container)
- Partition/device-hosted
Note: In addition to creating the above types of virtual volumes, TrueCrypt can encrypt a physical partition/drive where Windows is installed (for more information, see the chapter System Encryption).
A TrueCrypt file-hosted volume is a normal file, which can reside on any type of storage device. It contains (hosts) a completely independent encrypted virtual disk device.
A TrueCrypt partition is a hard disk partition encrypted using TrueCrypt. You can also encrypt entire hard disks, USB hard disks, USB memory sticks, and other types of storage devices.