My script, which I have used for a long while, creates a new encrypted sparse bundle disk image with this ...
if encrypt then "hdiutil create -type SPARSEBUNDLE -megabytes " & imageSize & " -fs HFS+J -layout NONE " & imagePath & ¬ " -volname " & (quoted form of imageName) & " -attach -encryption" ... do shell script the result
I have encountered a situation where I want to add encryption to an existing disk image file. One way to do this would be to: create a new, encrypted disk image, then copy the data from the old to the new, then replace the old file with the new one.
I have reviewed the 'hdiutil' man page for something simpler and more direct, but can't find anything that looks workable. Many of the verbs claim to be able to use the '-encryption' option, but error if you actually try to use it.
Does anyone with some experience with 'hdiutil' know another way to do this?
|