Brute force knowing a part of the password So here is the problem, my brother forgot about the eight digit numeric part of his password, he is using Ubuntu 15.04 default whole disk encryption

To make it clear, this was his password (example)


  thiswashispassword12345678


He completely forgot about the 12345678 part, to make things worse it was his working laptop with lot of important documents in it, for "backup" he was using raid 1 so same problem, his boss gave him a month top to recover the data or he is fired, is he screwed?
We solved this problem in just 9 hours 37 minutes.

Here is how to do it.

Tools you need:

sudo apt-get install cryptsetup
sudo apt-get install dh-autoreconf
sudo apt-get install libcryptsetup-dev


1 - Dump the encryption header of your device using cryptsetup toolset, here /dev/sda1 was our device yours could change:

sudo cryptsetup luksHeaderBackup --header-backup-file headerOutput /dev/sda1


2 - Generate a dictionary with all the possible combinations of the part of the passphrase you forgot; We paid a professional solution for this but there are tons of tools and programming language to accomplish this task for free.

3 - Download and compile this free project (https://github.com/glv2/bruteforce-luks)

wget https://github.com//glv2/bruteforce-luks/archive/master.zip
unzip master.zip
cd bruteforce-luks
sh autogen.sh
./configure
./make


4 - Recover your password

./bruteforce-luks -t 6 -f dictionaryYouGenerated yourLUKSHeaderFile


Notice the step "4" will be extremely slow since it utilizes the CPU and the software is not optimized at all, that's why we bought a similar software made for GPU's and we also hired a powerful cloud distributed computing solution (I can't put names here)

In our case the cost of everything was exactly 4400 USD (developer + software + cloud service) 
Lesson learned from now on we are storing the passphrase printed in a safe so this never happens again. Thank you and I hope this help someone in the same desperate situation.