What are the ways that you can hide files and folders from prying eyes? Â But first, ask yourself, are you trying to prevent people from noticing them, or are you trying to prevent people from reading, and accessing the content…
If your goal is to protect the content from unauthorized access, there are at least three methods:
- Encrypted Disk Images
- File Vault
- Whole Disk Encryption (eg. Pointsec, PGP Whole Disk Encryption, etc)
A disk image is a file that appears to be a mounted hard drive, thumb drive, or other type of removable media to the computer. Â The most common place to encounter a disk image, is when downloading software for the Macintosh. Â The Macintosh DMG is one standard for software distribution. Â Encrypted Disk images require a password or token to allow access to the contents of the image.
File Vault is a Encrypted Disk Image on steroids. Â It takes the users home directory, packages it on a Disk Image, and then only mounts it when the user logs in. Â Usually overkill if you want to prevent someone from examining your pictures, ebooks, etc… Â But if you work with confidential data, it could be useful.
Follow these steps to create an encrypted disk image:
- Open Disk Utility (/Applications/Utilities/).
- Mac OS X 10.4, 10.5 or later: Click the New Image button, or choose New > Blank Disk Image from the Disk Utility File menu.  Mac OS X 10.3 through 10.3.9: Choose New from the Disk Utility Image menu.
- Enter a name in the Save As field. This name is used for the disk image (.dmg) file.
- Change the save destination if you wish to.
- Select a size for the image file from the Volume Size pop-up menu (Size in Mac OS X 10.3) .
- Choose a volume format if you don’t want to use the default Mac OS X Extended (Journaled).
- Choose an image format. You can use “sparse disk image” for a disk image that only uses as much space as it needs, rather than a set amount of space. If you’re not sure, use “read/write disk image” choice.
- Choose 128-bit AES (and/or 256-bit AES in Mac OS X 10.5 or later) from the Encryption pop-up menu to encrypt the image’s contents with a password. If you don’t choose an encryption, your new image won’t be encrypted.
- Click the Create button.
- Enter and verify a good password in the dialog window that appears. This password will be saved in your keychain by default, or you can deselect “Remember password (add to keychain)” if you don’t want that. You can store the password in the keychain both for convenience and for reducing risk of password loss.
- Click OK.
Important: If you forget the password, data stored in the encrypted disk image cannot be retrieved. If you have saved the password in the keychain file, the password will be available to you there.
- Choose Apple menu > System Preferences, click Security, and then click FileVault.
- If the Security preferences pane is locked, click the lock icon, and then type an administrator name and password.
- If the Security preferences pane shows that a master password hasn’t been set, click Set Master Password, and then type a password in the Master Password box.  Please remember to set a Master Password.  This will allow you to recover your data if you forget your normal login password.  Especially useful for IT deptartments.
- Type the password again in the Verify box.
- Type a hint in the Hint box to help you remember the password.
- Click OK.
- Click “Turn on FileVault.†If you want to be sure your deleted files can never be recovered, click “Use secure erase.â€
- Click “Turn on FileVault.â€
Alternatively, if you are just concerned about hiding the files, and their contents… Â There are a few ways to do this as well… Â Some extremely simple, since Mac OS X is a version of Unix.
- Place a period (.) as the first character in the file or folder name, and watch it instantly disappear.
The following bit of Applescript will allow you to turn on or off the displaying of hidden files in the Finder.
tell application "Finder" to quit
display dialog "Show Hidden Files..." buttons {"ON", "OFF"} ¬
default button 3
copy the result as list to {buttonpressed}
try
if the buttonpressed is "OFF" then do shell script ¬
"defaults write com.apple.finder AppleShowAllFiles OFF"
if the buttonpressed is "ON" then do shell script ¬
"defaults write com.apple.finder AppleShowAllFiles ON"
end try
tell application "Finder" to launch
Feel free to suggest alternatives in the comments section…