To use this code on crackstation.net it needs to support partial (prefix) matches. Add a new constant, which is the number of leading bytes to compare. Only compare that many bytes in hashcmp. Then, make $results no longer an array, but an array of pairs ($word, parial/full).
So the overall process for cracking a hash is:
For each supported hash type:
$results = CrackForThatType($target_hash)
foreach ($results as $result) {
output a result $result.word with $results.partial status
}
This will actually be an improvement over the current crackstation.net code since it'll support returning multiple full and partial matches for a single hash (not just the first one according to index order).
To use this code on
crackstation.net
it needs to support partial (prefix) matches. Add a new constant, which is the number of leading bytes to compare. Only compare that many bytes in hashcmp. Then, make$results
no longer an array, but an array of pairs($word, parial/full)
.So the overall process for cracking a hash is: