I'm in a really bad situation. Basically, I've lost my passphrase, and I'm trying to find a way to recover it. I know what the passphrase should be (it's a really good 20 character passphrase), but I must have mistyped it when configuring cryptsetup or added some complexity which I failed to write down. I've tried about every combination of all the passwords and passphrases that I use, and I can't come up with anymore, so I'm going to try to build a cracker. I'd like to get some feedback before I put a lot of time into writing the code.
I'm going to build a brute-force cracker using libcryptsetup.
I'd like it to go fast, so I plan to use posix threads to create four threads (I have a non-HT quad-core) that will:
1) increment the current passphrase
2) use crypt_activate_by_passphrase() to try to open the volume.
I don't think that the the passphrase could be longer than 75 characters, which is still very long, so I understand how horribly long this will take.
My original question was posted to the cryptsetup "issues" page about thread safeness. Would this pesudo-code be safe or do I need to fork()?
crypt_init(&cd, "/dev/md1");
crypt_load(cd, NULL, NULL);
pthread_create(...);
generate_passphrase(); //Does #1 from above
crack(); //Does #2 from above
Will doing crypt_init and crypt_load before creating threads cause problems? struct crypt_device* cd is global.
Would I be better off forking to avoid race conditions?
Is this approach my best chance to recover my data? Should I be trying to attack the master key instead?
_______________________________________________ dm-crypt mailing list dm-crypt@xxxxxxxx http://www.saout.de/mailman/listinfo/dm-crypt