Subscribe to MacYourself via RSSSubscribe to MacYourself via EmailFollow MacYourself on Twitter
Mini Displayport to HDMI adapter from Amazon.com

How to password protect & encrypt a USB flash drive for Macs

How to password protect & encrypt a USB flash drive for Macs

We all carry around USB flash drives in our pockets or on our keychains. What if it got lost or stolen and somebody suddenly had access to all of your personal files? Password protect your flash drive to avoid taking that chance.

Some of us keep very important and sensitive information on our USB flash drives. And yet we walk around with them all day risking that they might somehow fall into the wrong hands. How foolish! Let’s find out how to lock down the files on these drives to keep them from prying eyes.

If you only use your USB flash drive on Macs and not Windows-based PCs, there is a very easy way to password protect your data. It involves creating an encrypted disk image, which is basically a storage container for your files. Everything inside the disk image is accessible only to users who know the password that unlocks it. Don’t be frightened by the number of steps listed below – I chose to be overly thorough in some of my explanations to avoid confusion. The actual work that needs to be done by you will only take a couple minutes.

  1. The first step is to attach a USB flash drive to your Mac. This tutorial assumes there are not currently any files on the drive. If there are, temporarily copy and paste them all in a folder on your Desktop. Then copy and paste them back to the flash drive once the following steps are completed.
  2. Launch Disk Utility (Applications > Utilities).
  3. Find your USB flash drive in the list of devices on the left. Select it and then click on the Erase tab.
  4. Choose “Mac OS Extended (Journaled)” from the Format menu and type something of your choice in the Name field.
  5. Click the Erase button towards the bottom. Please note this will permanently delete any data on the drive. Make sure you’ve made a copy of important documents before doing this.
  6. Once the drive has finished reformatting, go to File > New > Blank Disk Image in the menu bar.
  7. In the window that comes up, enter a file name next to Save As. For example, I typed “Files”.
  8. Choose your USB flash drive from the Where drop-down menu.
  9. Re-type your file name in the Name field.
  10. The Size field requires some thought. To take advantage of all your USB drive’s storage space, enter a custom size that is slightly smaller than its full capacity. Of course, you can make the disk image any size you want – as long as it is smaller than the drive’s maximum capacity. Just remember that a 500MB disk image on a 2GB USB drive, for example, will only hold 500MB of password protected files before it gets full. The other 1.5GB will be usable, but files placed there will not be encrypted.
  11. Select “Mac OS Extended (Journaled) from the Format menu.
  12. Be sure to pick either 128-bit or 256-bit AES encryption from the Encryption menu. This is required to protect your files.
  13. Choose “Single Partition – Apple Partition Map” from the Partitions menu.
  14. Select “Read/write disk image” under Image Format, then click the Create button.
    Encrypt USB flash drive for Mac
  15. A new window will be displayed where you must enter a password for the disk image. Make it difficult for other people to guess, but easy enough for you to remember. All of your files will be lost if you ever forget this password in the future.
    Encrypt USB flash drive for Mac
  16. After the encrypted disk image has been created, it is ready for use!

Now when you connect your USB flash drive to a Mac and view its contents in Finder, you will see a DMG disk image file. Double-click this DMG file, enter the password, and it will be mounted for use. Copy, paste, save, and delete files here like you would anywhere else. The one important thing to remember is to eject the disk image first, then the flash drive, before disconnecting it from the computer. This will prevent data corruption and loss. With that said, you’ve got a fully-functioning USB flash drive with data that is encrypted and password protected for your access only.

Share/Save It
Digg ThisStumbleUponDel.icio.usTwitterFacebook

12 Comments Have Been Posted (Leave Your Response)

I don’t understand the need to format the pendrive as HFS+, except if your dmg is greater than 4gb.

Ricardo,
The idea behind formatting the drive as HFS+ is that the encrypted DMG is generally not compatible with Windows. So leaving the partition as FAT has no real benefit, unless you’re only encrypting part of your partition and using the other data on Windows machines. Otherwise using HFS+ might be faster or more reliable – at least in my experience. Thanks for commenting!

Ant,
I have followed your instructions to the letter here and I’m afraid it isn’t working for me.
Although every step seems ok, it’s only when I attemp to open the USB, having done all the erasing and formatting, etc as per your steps 1-10, that it’s obvious something’s not right.
I click on the dmg and it doesn’t open. It doesn’t ask me for a password, even though I successfully set one.
Any ideas?
Thanks
Stuart

This doesn’t work for me. I get an input/output error message when trying to create the disk image.

Very usefull thank you!

Thanks for the clear instructions – worked fine except that when i put my flash drive back in my computer, it doesn’t ask for the password…

This didn’t work for me. I have a 3.77 Gigabyte usb drive, and did everything you did the way you said to. I even named the thing Files as well. I made the “Files” file 3 Gigabytes. I set the password and everything. Now, when I try to open it, it doesn’t do anything. It just opens up a window that says “Warning The following disk images failed to mount. Image: Files.dmg Reason: no mountable file systems”. I couldn’t delete “Files.dmg” for a while, or erase my usb again to get rid of it. I finally got to delete “Files.dmg” but it still says that there’s 0.77 Gigabytes of Storage left. I really don’t know what to do can anyone help me?!?!

How can I encript my usb drive if it is used betweem both a mac and windows operating system.

Password never worked.

I thought dmg lost the password protection as well because the computer didn’t ask for it when I opened it up. However, it did work when I moved the thumb drive to another computer without the password saved in the keychain. Try that, and also maybe try not saving password in keychain (but what’s the point of that on your own computer?).

Sebastian–Did you try wiping the whole thing (“erase volume”) using Disk Utility?

ali did you put it the key chain if you did the computer will atomically reconse it since that’s what a key keychain

Have Something To Say? Join The Discussion!

  (required)
  (required; will be kept private)
  (optional)