How do I tell if a disk image (.sparseimage) is encrypted?
Solution 1:
Here's a few ways to check. The last one only works in Lion. The third one is probably the easiest if you're comfortable using Terminal.
Lock All Keychains
A quick way to check is to open Keychain Access (found in /Applications/Utilities/), choose File > Lock All Keychains, then try to mount the disk image.
If it's encrypted, you should get a message like
diskimages-helper wants to use the "login" keychain
and be prompted for the keychain password (same as your OS X login password). If it's not encrypted, it will simply mount.
Search login Keychain
Instead of locking all keychains, you could instead search for your disk image in the login keychain: Select the login keychain, then type the name of the .sparseimage file in the search field.
However, if the .sparseimage name has been changed since it was created, it won't show up in the login keychain with the new name.
If you don't find your disk image you can try the Lock All Keychains method above or the Terminal method below to be certain.
Terminal Command
You can enter the following command to check if the disk image is encrypted:
hdiutil imageinfo /path/to/image | grep Encryption
Replace the /path/to/image
with the path to the disk image. If the disk image is encrypted, the command will return something like:
Encryption: AES-128
If it's not encrypted, it won't show anything at all.
Use Disk Utility in Lion
New in Lion, Disk Utility now shows if a disk image is encrypted.
Unmount the disk image if it's mounted.
Open Disk Utility and drag the .sparseimage file to the device list on the left side of the Disk Utility window.
Select the .sparseimage in the device list and look at the information area at the bottom of the window. If the disk is encrypted, then that will be indicated under "Disk Write Status".
Solution 2:
from the command line you can use 'hdiutil isencrypted {image-name}
'.
bash-3.2$ hdiutil isencrypted unencrypted.sparseimage
encrypted: NO
bash-3.2$ hdiutil isencrypted encrypted.sparseimage
encrypted: YES
blocksize: 512
uuid: FC3C26ED-3056-4F98-8248-DD2F16B39357
private-key-count: 0
passphrase-count: 1
max-key-count: 1
version: 2
bash-3.2$
Solution 3:
hdiutil isencrypted <image-name>
will do the trick.
From the hdiutil(1) man page :
isencrypted image: print a line indicating whether image is encrypted. If it is, additional details are printed.