LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 03-13-2005, 03:52 AM   #1
Soltis
LQ Newbie
 
Registered: Dec 2003
Posts: 22

Rep: Reputation: 15
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.
 
Old 03-13-2005, 05:42 PM   #2
thorn168
Member
 
Registered: Oct 2004
Location: USA
Distribution: Vector Linux 5.1 Std., Vector Linux 5.8 Std., Win2k, XP, OS X (10.4 & 10.5)
Posts: 344

Rep: Reputation: 42
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
 
Old 03-13-2005, 05:58 PM   #3
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
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.
 
Old 03-16-2005, 02:25 AM   #4
Soltis
LQ Newbie
 
Registered: Dec 2003
Posts: 22

Original Poster
Rep: Reputation: 15
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.
 
Old 03-16-2005, 11:02 AM   #5
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
I think you need to unmount the loopback device first, then unmount the device itself.
 
Old 03-19-2005, 02:34 AM   #6
Soltis
LQ Newbie
 
Registered: Dec 2003
Posts: 22

Original Poster
Rep: Reputation: 15
Yeah, that's what I figured, but I wanted to avoid that extra step, if possible...
 
Old 03-19-2005, 11:02 AM   #7
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
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.
 
Old 03-21-2005, 03:57 AM   #8
Soltis
LQ Newbie
 
Registered: Dec 2003
Posts: 22

Original Poster
Rep: Reputation: 15
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?
 
Old 03-21-2005, 01:35 PM   #9
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
No idea. 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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting removable media matthewa Linux - Hardware 2 11-12-2005 09:44 PM
How to mount a removable media using C skie_knite007 Programming 1 10-02-2005 12:49 AM
Encrypted Filesystems using Loop Device erktrek Linux - Security 0 12-16-2004 01:57 PM
How to boot an encrypted filesystem from removable medium? Vincent_Vega Linux - Security 2 11-19-2004 02:54 PM
Encrypted filesystems and util-linux thebell Linux - General 2 05-31-2004 10:16 AM


All times are GMT -5. The time now is 02:50 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration