LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Encrypted Filesystems on Removable Media (https://www.linuxquestions.org/questions/linux-security-4/encrypted-filesystems-on-removable-media-301020/)

Soltis 03-13-2005 03:52 AM

Encrypted Filesystems on Removable Media
 
I have been reading up on creating an encrypted filesystem, but none of the info I have found tells me how to do this on removable media.

In other words, I want to know how I make the contents of my USB memory stick 100% AES-encrypted so I can store sensitive data on it without fear of losing it and having it compromised.

I haven't seen anything on Google, really, that addresses this question, though I am still looking.

thorn168 03-13-2005 05:42 PM

I found this article on google.

http://www.aplawrence.com/Basics/gpg.html

You may wish to look up your USB drive's information on security. I know that my wife's Sony Drive is very secure with the vendor supplied password protection. Something like that maybe all that you really need.

Encryption requires passkey management so you may want to consider that when you attempt to implement your proposed encryption solution.

Check out MIT's website on PGP for more details about passkey management.

http://web.mit.edu/network/pgp.html

Good Luck,

Thorn

TruckStuff 03-13-2005 05:58 PM

In linux, most encrypted file systems are done via loopback devices. Basically, this creates a transparent layer between the user and the physical disk that encrypts/decrypts the data as it passes through that layer. Because of the nature of this, the underlying media is practically irrelevant. Check out http://sourceforge.net/projects/loop-aes/ for a solid project.

Soltis 03-16-2005 02:25 AM

The problem is that I'll create a file on the device, then set up the loopback for that file, do the encryption, etc...

But I can't unmount the device because it's being 'used' by the loopback. Would deleting and then re-setting up the loopback device every time I want to access the info work? Surely there has to be a better way with removable media; most of the techniques I have seen apply only to NON-removable media.

TruckStuff 03-16-2005 11:02 AM

I think you need to unmount the loopback device first, then unmount the device itself.

Soltis 03-19-2005 02:34 AM

Yeah, that's what I figured, but I wanted to avoid that extra step, if possible...

TruckStuff 03-19-2005 11:02 AM

I don't think you can. As far as linux is conerned, its actually writing to that loopback device, not the disk. The loopback is just a transparent interface to the HDD. Just like linux won't let you unmount a volume its currently using (e.g. /dev/hda), it won't let you unmount this loopback device.

However, you could write a simple script that unmounts both the loopback device and the filesystem in a single shell command.

Soltis 03-21-2005 03:57 AM

What about shredding the actual partition, instead of a file on the partition, and then setting up the loopback device to point to the partition directly?

shred -n 1 /dev/sdc (It's a memory stick, so would do the entire thing)
losetup -e aes /dev/loop0 /dev/sdc
mke2fs /dev/loop0
mount /dev/loop0

What would happen when I removed the memory stick(that being the point of putting data on it in the first place)?

Would I have to unmount, then delete the loopback, then remove the stick?

Or could I just unmount, remove the stick, and have everything work okay when I plugged it back in later?

TruckStuff 03-21-2005 01:35 PM

No idea. :D I've only read about crypt FS, never actually done it myself. Going to someday when I get the time though. ;)

Give it a shot and see what happens. Worst that happens is that you have to reformat your USB drive, right?


All times are GMT -5. The time now is 03:11 AM.