Skip to content

Instantly share code, notes, and snippets.

@jerrythomas
Created August 4, 2021 16:19
Show Gist options
  • Save jerrythomas/19907f98bc2bdf0840bc4068fea437ca to your computer and use it in GitHub Desktop.
Save jerrythomas/19907f98bc2bdf0840bc4068fea437ca to your computer and use it in GitHub Desktop.
Create and attach encrypted dmg
echo test1234 | hdiutil create -stdinpass -size 16m -encryption AES-128 encryptedimage.dmg
echo test1234 | hdiutil create -stdinpass -srcfolder testfiles -encryption AES-128 encryptedimage.dmg
echo -n test1234 | hdiutil attach -stdinpass encryptedimage.dmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment