开发者

Protecting a USB drive in java

I'm going to create a Java开发者_C百科 program that allows "locking" a USB drive by making it's files accessible only with a password. Similar software that does this is USB safeguard.

Here is what I am thinking of doing:

  1. Store all files into a single archive on the USB.

  2. Encrypt the archive using AES or blowfish

  3. Hide the archive.

The problem is, how can I "unlock" the USB? What approach can I take here? Here is what I have thought of:

  • Ramdisk: It is very hard, if not impossible, to load a Ramdisk from an encrypted arhive. While it may be plausible in c++, I think it may be much harder in Java and might involve messing with the system classes, which would kill the compatibility of the software and defeat the whole purpose of using Java.

  • Loading the unencrypted archive onto the USB - Nobody likes waiting 10 minutes just to view a file on a USB. Copying all the files might take some time. Also, what about free space on the USB?

  • Loading unencrypted archive onto harddrive - While being very unsecure and error-prone, this looks like the only possible way to get it done.

  • Creating a custom file browser allowing the user to browse the archive - Do you use winrar to browse your files? Would you like doing it? No. Creating a custom file browser will take alot of time to create, and again, is an error-prone and user-unfriendly approach.

I can't think of any other way of doing this. Can anyone think of a better way? Note that this is going to be free and open-source software.


TrueCrypt is Free Open-Source software for storing encrypted files on a storage device (i.e. USB drive). It runs on Windows, Linux, and MacOS. TrueCrypt even allows hidden volumes. I would start with their source code, and proceed from there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜