Can I decrypt a dm-crypt filesystem on OS X?

I've been an Ubuntu user for years, and I just got my first Mac. One thing I haven't yet figured out is how to decrypt my encrypted filesystem on which I store my SSH and GPG keys on my flash drive. I used this guide in the past to set it up, and have just been running the shell script to decrypt and mount it since then.

However, I cannot figure out how to decrypt it on OS X. Running brew install cryptsetup doesn't work.


You may try OSXCrypt which is a kernel extension and a command line utility that allows the creation, manipulation and attaching of a TrueCrypt-compatible volumes.

See also ext4fuse or fuse4x (via brew).

Or try to install a tiny linux distro (e.g. Ubuntu) in a virtual machine (e.g. VirtualBox) and then install/configure cryptsetup.

I don't know if hdiutil can handle it, but here is an example:

sudo hdiutil attach -stdinpass -encryption AES-256 /dev/disk1s1 

To check how your hardrive is encrypted, try the following command:

sudo cat /dev/disk1s1 | strings -3 | head

See also:

  • Password Cracking AES-256 DMGs and Epic Self-Pwnage