Subscribe to MacYourself via RSSSubscribe to MacYourself via EmailFollow MacYourself on Twitter
Apple Products and Accessories from

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.

50 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.

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!

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?

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

When opening the .dmg file it never opens and never asks for a password. Obviously I’m not the only one this is happening to, which makes me believe something in your tutorial is flawed..

What if I forget my password? Can I still access it, or can I hack into it?

i forget my hfs encrypted drive password key then what to do?
can i decrypt using third party tool if yes then give me idea which task perform to decrypt the disk otherwise no then give me other idea to decrypt my drive.
Note: my data more important for me therefor i want my data recovery from my encrypted drive.

Give me better idea to recover my data………….

Do you have any video we can follow because the step by step is really hard

I am just wondering if this will work with big hard drives? I have a MY BOOK STUDIO EDITION. THANKS

Any idea on how to change the password once its setup?

A tip about why your computer doesn’t ask for a password: it’s because “Remember password in my keychain” was selected in the last step. This means that your computer remembers the password and doesn’t ask for it, but other computers should. This option is best for a computer that is password protected because you won’t have to type in the password on your computer. I selected this option for my drive, but not for the folders with financial information on my computer (because I want it typed in each time).

Works just like you said it would. Thank you for the detailed explanation. I am using a 24″ iMac running Snow Leopard.

So I did everything above and it worked – only problem is the person using my flash drive doesn’t have a MAC any more – they are using a pc… They said it’s not opening – is there a way to fix this?

Went all the way thru but now pen drive does not work.
Can’t re-format, can’t transfer files and dmg does not open.
Any ideas ? Hate to loose a 16Gb unit.

I was encrypting my USB Drive under journaled and while I was doing it it “failed” now I can’t seem to modify it or re-format it and my computer wont mount the USB. Can someone help?

It wont let me select Erase under disk utility and it says that it’s locked


1. Go to Disk Utility. Click on the USB.

2. Under “ERASE,” click on “FORMAT” and select Mac OS Extended (Journaled, Encrypted)

3. Click “ERASE.”
*WARNING: This will delete all content on the USB. Back up info first*

4. Fill in password and hint.

5. Click “ERASE.” This should take about 1-5 minutes, depending on size.

6. Safely eject USB flash drive.

7. Re-insert USB flash drive, if everything worked correctly, you should be prompted to enter a password.

And Voila! You have a secure flash drive!

I’m pretty sure this works on pc as well, even though people should not be using those lousy excuses of computers.

I used the method posted by
November 12th, 2012, 1:30 PM
and it worked for me.

i cant find the erase tab!!!!!!!!!!!

i got it!!!! the only thing is that i don’t get the
DMG thing…

Test the password on several computers before you comment whether it works or doesn’t work… Retards…

Works great here! Thanks for tuto

Thank you very much!!!

Followed all the steps and it works on one of my flash drives. However, the other one does not allow me to enter the password when I click on the .dmg icon. It’s totally locked now. What to do?

Both 16GB flash drives are now locked with tons of info. When I click on the .dmg, it does not give me the option of typing in the password. Any ideas?

@Zander i’ve been tryna figure out how to do this for weeks!!!! salutes to you sir!

Zander; I have Snow Leopard and there is no Mac OS Extended (Journaled, Encrypted) option under Format.

There is (Journaled) and (Case-sensitive, Journaled) but neither ask for a password before I erase the USB stick.

Any ideas?

Brilliant thank you very much Ant it worked a treat and nice simple to follow instructions. btw I am on OXS 10.8.2 and it is fine. Remember though once done eject both disk images off your desktop.

Thanks again

So how would this affect use with a Windows computer? I have a custom built PC at home along with a MacBook and iMac. At school, though, we use Macs. I don’t have an real reason to do this, but I’d like to have my flash drive encrypted anyway. If I encrypted it on one of my Macs, would I still be able to access it on my PC? Also, I do not know how the school manages the computers, but there is a list type thing the school uses that only allows us to use the applications they have allow–Terminal, for example, is not on this list and I cannot open it without the computer telling me I can’t. Just curious as to if this would work or not . :)

This is great. Use Zanders method though

I have protected my pen drive on the mac, and now when I connected it to my HP, it doesn’t read it, and it only shows the option to format it. What should I do? Is it like if you encrypt the drive on a mac, it cannot be accessed on Windows computers?

Stupidity Exterminator
October 10th, 2013, 12:36 PM

You people are so daft. It works like a charm. To all lame people:
STEP 10: If you get any error it means that you want to create a bigger size protected .dmg than your driver, dummy! If your disc is 1G and you create a 1G password protected file, it ain’t gonna WERK WERK WERK! Use 980 M instead! Duh…

EARE TAB is on the main window on the right!! DUH

So this worked like a charm for us but the problem is it will be used on some PC computers. Do you know how to remove what was done?

Some of you guys are real knobs. Read the title of this article again “How to password protect & encrypt a USB flash drive for Macs” I don’t see where it says for Macs AND PC’s . Step 10 is very important, and I believe “Zanders” method will only work with 10.7.X and on. GUYS READ THE DAMN ARTICLE BEFORE HAND.

This works perfectly and the instructions are really clear and easy to understand.

Thank you so much.

Your instructions appear to have worked perfectly for me. Really clear and easy to follow. Thanks so much.

Worked fine for me. Thanx

Uncheck the box when setting it up if it doesn’t ask you for a password. Don’t let it remember it in your keychain.

Can this work on a 1 Terabyte drive? If I password protect it, does that mean I can no longer play movies inside on my AC Ryan media player?

worked without any issues. I’m a paramedic and have to occasionally save patient care reports. this is perfect. thanks.

(running 10.10.2 on 13″ MacBook Pro)

Hey Ant,

So I used your method and it worked for me, however my one concern is that I cannot connect my flash drive to a scanner and get documents scanned onto the USB because it says the USB is read-only compatible?
This is mainly why I wanted to encrypt my USB because I have so many important documents accumulated over the years and was wanted to de-clutter my house by safely storing it all on a few USB.

Also I have tried Zanders method by using the “Disk Utility” route, the problem I encounter there is under format I do not have an encrypted option, it just says Mac Os extended, and Mac OS journal….. none of the options include encrypted for some reason.

I have a Mac OS x 10.5.8 ( I know ancient), so not sure if having an older Mac prevents me from having that option.

If anyone can help I would greatly appreciate it!

Hey everyone,
Like anything..before you transfer any files to the pw protected USB, eject the disk image and then the usb itself. then plug back in to make sure there are no issues prior to copying all your files to it..Lesson learned….always safe than to be sorry!

Perfect worked great..Checked before I copied info and work great after the copy..Thanks Atom “ANT”

last 2 posts were mine….lol

Have Something To Say? Join The Discussion!

  (required; will be kept private)