Decrypt (crack) Encrypted disk image (dmg) files
Wednesday, December 13th, 2006I set myself up with encrypted sparseimage file a few weeks ago (as an alternative to filevault). Because this was supposed to be super-secure, I created a brand new password based marginally upon my standard password. I subsequently forgot this new password.
I was lucky, though, because I remembered what I would have done to this password (preface, postfix, letters -> numbers, etc). It ended up being few enough permutations to be reasonable but too many to try manually.
Basically, I just set up some arrays for the positions which may differ. I loop through these arrays, concatenate together a password, and try it. Everything is written to the terminal, so you just look for the entry with the very obvious success message.
If you’re in a similar situation, you can modify the following script to crack your dmg file.