Follow-up to this question: Strong PHP hashing without salt.
Without entering into the details, using bcrypt without salt/pepper is a bit complex for my case, so I'm staying on a "plain loop" implementation.
In the "version 1" below, I'm simply hashing the sha512 repeatedly, whereas in "version 2" I include the input data in each iteration:
$data = $websiteDomain . $myChildSchool . $myPetName . $etc;
// version 1
$result = $data;
for ($i = 0; $i < 1000000; ++$i) {
$result = hash('sha512', $result, true);
}
// version 2
$result = '';
for ($i = 0; $i < 1000000; ++$i) {
$result = hash('sha512', $data . $result, true);
}
$result = str_replace(['/', '+', '='], '', base64_encode($result));
$result = substr($result, 0, $passwordLength);
Is "version 2" more secure?
I'm thinking about stuff like parallelization for "version 1", where the first hash would be normally computed, then the 999,999 remaining hashes of each candidate would be computed using some parallelized processing.