Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Store files securely on a USB flash drive System
I wanted to securely carry files on a USB flash drive. I wanted a system that would be safe if I lost the drive, but not necessarily encrypt and decrypt every file on it. I found some shareware encryption solutions, but I wanted a way that was free. Here's my solution:
  1. If the flash drive is MS-DOS formatted, use Disk Utility to reformat the USB drive to Mac OS format without the OS 9 drivers.
  2. In Disk Utility, choose File -> New -> Blank Disk Image.
  3. Select a size that is less than the flash drive's maximum size, then select Encryption -> AES-126, then select Format -> Sparse Disk Image. Select Create, you will then be asked for a password. Provide the password and save the image to your hard drive.
  4. Copy the file secure-disk-name.sparseimage to the USB drive.
  5. Open the sparseimage file from the flash drive. You will be asked for the password. A new drive will appear with the name of the sparseimage drive you created. Save your files to that drive.
When you're done working on files, eject the sparseimage drive. Your files can now be seen only by using the password.
    •    
  • Currently 3.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[53,062 views]  

Store files securely on a USB flash drive | 18 comments | Create New Account
Click here to return to the 'Store files securely on a USB flash drive' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Store files securely on a USB flash drive
Authored by: michaelbach on Aug 04, '06 08:05:59AM

Good tip. Since I've been doing likewise for quite a while, I've encountered some of the possible snags:
(1) the sparseimage can only grow to the maximum size entered initially, so I would use a slightly larger size than that memory stick to begin with.
(2) if you pull out the stick without having unmounted first the image, and then the stick itself, it is highly likely that you corrupt that dmg file and you loose _everything_ in it in one fell swoop.
Finally: I do not see the need to reformat the drive, the dmg can also reside in a DOS formatted file system.



[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: jeaginsky on Aug 04, '06 10:09:09AM

i set this up in conjuction with another simple hint on-site to use digital photographs instead of scanning of important documents. putting a folder of these on a password protected flash drive is a good earthquake/emergency kit addition, as seen in the red-tape aftermath on 9/11 and katrina...



[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: tbucks on Aug 04, '06 02:15:25PM

Do you have the link for the hint about using digital photographs instead of scanning of important documents ?



[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: moritzh on Aug 04, '06 12:10:53PM

(1): The problem is that DiskUtility limits the size of the sparse image to the available free space on the volume (USB key drive) where the image is to be saved (which can be at most as much as the size of the volume). So you either have to start with a totally empty volume to be able to create an image with that size, or you have to create the image on another volume with more space free and then move it to the key once it's created.

(2): That's right, be very aware of that. You should always have a backup of your important data. Believe me, it's very frustrating to see the encrypted image rendered useless beyond repair because it had not been unmounted properly.



[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: BrentT on Aug 04, '06 03:39:41PM

I suggested reformatting to MacOS as an extremely weak extra security measure. If the drive is found by a PC user and puts it in a Windows machine the drive won't be recognized and the user will asked to reformat the drive, erasing the dmg file.



[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: Coumerelli on Aug 04, '06 08:29:01AM

so....will this work on my iPod and/or SLVR? hmmmm. I'll have to try it.

---
"The best way to accelerate a PC is 9.8 m/s2"



[ Reply to This | # ]
What about Windows compatibility?
Authored by: jase71ds on Aug 04, '06 08:59:22AM
I've set someone at work up with TrueCrypt http://www.truecrypt.org/
and it seems to work well with Windows and (supposedly) Linux.

Since I work on Windows at work, but Mac at all other times, I wonder if anyone has found a way of securing a USB drive in such a way that it will run on either platform (Win / Mac)?

Anyone know of any programs out there that will do this?

[ Reply to This | # ]
What about Windows compatibility?
Authored by: xSmurf on Aug 04, '06 10:37:10AM
The only one I could ever think of is GnuPG (or PGP for that matter). See the Mac port of GnuPG here: Mac GPG. It could probably also be possible to encrypt it using OpenSSL, but I'm unsure what is the implementation on the Windows side.

---
MacBook Pro 2.16Ghz / 2Gb / 100Gb 7200rpm / CD/DVD±RW
PM G4 DP 800 / 1.25gb / 120Gb+80Gb / CD/DVD±RW/RAM/DL
- The only APP Smurf

[ Reply to This | # ]

What about Windows compatibility?
Authored by: dsouth on Aug 07, '06 10:52:42AM
You can encrypt individual files using the OpenSSL comand line program. It's installed by default under MacOS and Linux, and can be installed under windows as part of cygwin or as a standalone.
To encrypt a file "myfile":
  openssl enc -e -a -aes256 -salt -in myfile -out myfile.aes256
To decrypt
  openssl enc -d -a -aes256 -in myfile.aes256 -out myfile
Example uses AES with a 256 bit key in cypherblock chaining mode. Other ciphers are available.

[ Reply to This | # ]
What about Windows compatibility?
Authored by: nprg on Aug 22, '08 10:41:37AM

Truecrypt is available for Mac anyway...



[ Reply to This | # ]
RAR
Authored by: Typhoon14 on Aug 04, '06 01:00:12PM

I prefer to use an encrypted RAR archive myself. It is fully cross-platform. You get the same effect, except unlike an Apple disc image, the archive is fully cross-platform.



[ Reply to This | # ]
RAR
Authored by: Han Solo on Aug 04, '06 07:02:14PM

What tool(s) is (are) you using to create an encrypted RAR image on each platform -- namely: Mac, Windows and Linux?



[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: azraq27 on Aug 05, '06 10:43:42PM

I haven't done this in a while, so I'm sorry if I'm not getting the details here correct:

In my experience with sparse disk images, they start out very small, then grow to the max size you set at the start. Convenient, but the problem is that when you delete all of the contents inside the sparse image, they never shrink back down in size.

So, effectively, after you have filled your USB drive once, you will have a disk image which is permanently the full size of your USB drive. This still works, but I'd be more inclined to start out with a fixed-size disk image to begin with, if that's where I'm going to end up anyway. I'd guess the sparse format would be less efficient, but I don't know.



[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: BrentT on Aug 07, '06 05:21:28AM
You're right. Perhaps a simpler method for this hint is to:
#1. In Disk Utility, choose File -> New -> Blank Disk Image.
#2. Select a size that is less than the flash drive's maximum size, then select Encryption -> AES-128, then select Format -> read/write disk image. Select Create, you will then be asked for a password. Provide the password and save the image to your hard drive.
#3. Copy the file secure-disk-name.dmg to the USB drive.

[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: kevin@mac.com on Aug 08, '06 12:11:25AM

I had the same experience with a sparse image growing even after deleting files.

Even though Mac OS X has this feature which is used with File Vault, Disk Utility doesn't have an option to compact a sparse image so I wrote the following script that when saved as an applicaton works great to compact a sparse image. Just drag and drop a closed sparseimage over the application.

==========================

set |warning| to display dialog
"To use this script, drag a Sparse Image over it." buttons {"OK"} default button 1

on open this_item
try
set this_item to quoted form of POSIX path of this_item
set Question to display dialog
"Would you like to compact this Sparse Image?" buttons {"Cancel", "Compact"} default button 1
if button returned of Question is "Compact" then
do shell script "hdiutil compact " & this_item
set dialog to display dialog
"Your Sparse Image has successfully been compacted." buttons {"OK"} default button 1
end if
on error the errMsg number the errNmb
if the errNmb is not 0 then

display dialog
"Please unmount the Sparse Image before compacting." buttons {"Cancel"} default button 1
end if

end try
end open



[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: kevin@mac.com on Aug 08, '06 12:36:53AM
To make it easier I put the script here http://homepage.mac.com/kevin/compact_sparse_image

[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: themacthinker on Oct 23, '06 12:21:52PM
Here is a very simple and visual VIDEO tutorial the walk you through how to create a secure disk image for any purpose, wether it be to keep in your usb drive or to mail files securely to someone or even to just keep those files encrypted in your computer. http://www.mostofmymac.com/articles/how-to-encrypt-important-files-on-mac-os-x

[ Reply to This | # ]
Store files securely on a USB flash drive
Authored by: wiangube on Nov 15, '07 04:48:49AM
Hi BrentT,

Some USB flash drives come with their own software to save data with an enhanced security. When I bought my Kingston 2GB USB 2.0 Grey DataTraveler in here:

[link:]http://www.compuplus.com/ps-products-comboid-417~.html

it came with that kind of software.

[ Reply to This | # ]