Hmm, gotta check this out later.
Using the example command given in the article, here's a simple way to wrap it in AppleScript:
set newDiskName to "SecureSparse"
set newDiskSize to "1g"
set shellCommand to "cd ~/Desktop; hdiutil create "& newDiskName &" -size "& newDiskSize &" -encryption -type SPARSE -fs HFS+ -volname "& newDiskName
do shell script shellCommand
Note: The example creates a 1GB disk image on the desktop.
Thanks to [AppleScript Info]