Is there a [better] way to password protect files on a mac?

I have a MacBook pro running OSX 10.8.3.

I used the disk utility method, but what a PITA, and once I open the file with my password, it creates a disk image on my desktop that I can open without my password. Maybe I did something wrong, but I have to delete that disk every time I access it.

But even without that “feature”, isn’t there an easier way to password protect files or folders? I don’t want to create a virtual disk, I just want some of my files to be password protected.

There are a LOT of inexpensive utilities that do this, but I couldn’t find any free ones.
You can use this technique to do what you want with the Terminal, using zip archiving.

It might be pretty easy to create an Automator workflow to make this process easier.

Oh, and the reason the encrypted archive opens without asking for a password is: you are telling the Mac to remember the password (at least, that’s the only reason I can think of).

I don’t think I did, because it does ask me for the password if I delete the drive icon and try to open the folder up afterwards.

The essential issue is that file systems don’t typically have a “password protect this one file” function. They usually tie permissions to specific users or groups, not passwords.

So you can tell the Mac “Don’t let any other user but me access this file”, but not “I want to give this file a password”. To do that you’ll have to use third party programs that encrypt (or at least obscure) the file to shield it from prying eyes, otherwise anybody who can look at the file directly (say, with a text or hex editor) can still see all the contents even without your password. That’s why it’s necessary for the disk utility to do it that way; without first encrypting the actual file, the password protection is just for show.

That said, there are other applications (MS Office, Adobe Acrobat, most compression utilities) that also let you do similar things with different levels of protection depending on the encryption used (or not). They don’t usually use a virtual disk (you just type in the password and the file opens as normal), but this relies on support from the application in question.

For day to day usage, using your computer’s built-in mechanisms (per-user permissions and/or FileVault) would make it easier for you. The former locks down the file to your user account so that nobody else on the computer can see it (though somebody who takes your hard drive out still can). The latter makes it so that everything’s encrypted and your password unlocks everything in one fell swoop, so you don’t have to worry about individual files. If you want some blend of that not tied into user accounts, you can try something like TrueCrypt (which encrypts a partition but lets you use it as a normal drive once you enter your credentials).

There are easier ways to password protect your files, but they also involve disk images. Have you discarded that possibility because you’ve found them hard to create, or for some other reason? I don’t want to waste your time describing a better solution you don’t want to use.

It asks you for the password when you mount the .dmg file (opening the “disk”). Not when you open individual files within that disk.

Think of the .dmg file as a USB flash drive that is password protected. You need the password when you connect the drive.

What are you trying to protect against? If it’s laptop theft, the easiest and most secure way is to use Filevault. It transparently encrypts your entire drive, you enter the password when you log in.