What are equivalents of losetup and cryptsetup for Mac OS X?

I use losetup and cryptsetup to create a loopback encrypted file system. Is it possible to do the same on Mac OS X? If so, how?


I had to Google what a loop device was before I understood the concept…

Would .dmg (Apple Disk Image) files not be an adequate substitute? They can be expandable & encrypted, using FileVault. Once mounted they behave like any other mounted volume.

From Wikipedia - Loop Device

Mac OS X implements a native image mounting mechanism as part of its random access disk device abstraction. The devices appear in /dev as regular disk devices; reads from and writes to those devices are sent to a user-mode helper process, which reads the data from the file or writes it to the file. In the user interface it is automatically activated by opening the disk image. Mac OS X can handle disk (.dmg or .iso), CD-ROM or DVD images in various formats.