glv2 / bruteforce-luks

Try to find the password of a LUKS encrypted volume.
GNU General Public License v3.0
238 stars 35 forks source link

Increasing amount of threads actually slows down the cracking process #34

Open mrDoctorWho opened 2 years ago

mrDoctorWho commented 2 years ago

Hello,

I'm trying to find a password for my dump of the LUKS2 header from a device. The header and dictionary are located in tmpfs.

Here is how I run the cracker:

$ bruteforce-luks -t 4 -f dict.dict -v 30 sda3-dump

And here is the speed of cracking compared having the different amount of threads.

Threads Passwords/sec
1 0.933333
2 1.400000
3 1.500000
4 1.466667
10 1.379310
24 0.800000

As you can see, when the thread amount gets higher than 3 the program starts to slow down.

I'm running the tool on Ubuntu 20.04, on a 12-core AMD Ryzen 5900X with 32 GB of RAM.

glv2 commented 2 years ago

This is probably caused by some lock contention in the read_dictionary_line or generate_next_password functions.

The program could be improved by generating/reading the next passwords to try in a dedicated thread...