cr-marcstevens / hashclash

Project HashClash - MD5 & SHA-1 cryptanalysis
Other
742 stars 87 forks source link

Update cpc.sh for automatic backtracking #4

Closed enricobacis closed 4 years ago

enricobacis commented 4 years ago

The cpc.sh script normally needs supervision as it might stall and require backtracking.

This PR introduces automatic backtracking in the script by spawning a subshell that checks if the process terminates before a time threshold. If it doesn't, it interrupts the current computation and goes back to the previous step.

Each step in cpc.sh (when using 9 collision blocks) is supposed to complete in 8 core hours. By dividing this by the number of available cores, we can determine the expected block time. We double this figure to obtain the time threshold.

This PR also makes use of the notify-send program (if available on the system) to inform the user about step completions and backtrackings.