Adding and Removing Encryption to OS X Sparse Bundles

Adding and Removing Encryption to OS X Sparse Bundles

For one or two sparse bundles removing encryption is easy:

  • Mount the sparse bundle
  • Open Disk Utility
  • Select the mounted drive
  • Click the File menu
  • Select "Turn off Encryption"

Encrypting is not so easy if the sparse bundle wasn't created with encryption. Adding or removing encryption for multiple files is best handled from the command line.

Adding and Removing from the Command Line

First thing to note is you don't really add encryption. What you do is convert a sparse bundle. The upside to converting is you don't destroy your original. The downside is you need enough disk space to hold the encrypted copy.

Adding encryption

To add encryption use hdiutil convert with the -encryption flag:

Note: Be sure to eject the disk before running the command.

hdiutil convert SRC_FILE -format UDSB -encryption -o TGT_FILE

Removing encryption

To remove encryption use hdiutil convert:

hdiutil convert SRC_FILE -format UDSB -o TGT_FILE

You'll be prompted for the password if it's not already in your keychain. If it's in your keychain you may have to grant access to the password by clicking "Allow" or "Always Allow" when in the dialog that appears.

Conclusion

hdiutil has numerous other options. Read the man page for more details.