Years ago, I downloaded a php based forum and later did a db dump of the members, data etc and let the forum lapse. I no longer have the php.
I’m now trying to resurrect the data from the dump, but can’t work out how the passwords were hashed. My guess was md5 (the only one I’ve used under php) but that doesn’t work on the only pw that I know.
testPw is stored as v41nfXS65PI2w
But the md5 hash of testPw is a8b6d2a13adfc99d86dc11ac5c507692
I also tried sha1(testPw) which gave me: 7d84db30b30c1bf3b947e8c78e79821342d81ee9
Can anyone suggest what was used to get v41nfXS65PI2w from testPw ?
I only want to go from the pw to the hash, so I can check login credentials, I’m not trying to go from hash to pw!
If it is using a salt and only saving the first 13 characters then either MD5 or SHA1 could be being used to create that hash.
If it is using a salt then you are not going to get anywhere with the hashes unless you know what the salt is as without it there will be no way to match the password to the hash.
Was it an open source script or was it one that you had customised specifically for your use? If the former then looking at what options the current version of the script has may provide clues since it would probably still support the option you used. If it was a custom script then you might try contacting whoever wrote it for you.
Did you try MD4 - I think it produces a shorter hash than MD5.
Thanks Steven, for taking the time, I’ve noticed over the years that you are consistently helpful!
Well, if I try
echo "<br>The MD4 hash is: ".$MD4hash;
I’m told: Fatal error: Call to undefined function md4() in /media/sharedNTFS/htdocs/testHash.php on line 9
but if I do: print_r(hash_algos()); I’m told:
Array (  => md2  => md4  => md5  => sha1  => sha256  => sha384  => sha512  => ripemd128  => ripemd160  => ripemd256  => ripemd320  => whirlpool  => tiger128,3  => tiger160,3  => tiger192,3  => tiger128,4  => tiger160,4  => tiger192,4  => snefru  => gost  => adler32  => crc32  => crc32b  => haval128,3  => haval160,3  => haval192,3  => haval224,3  => haval256,3  => haval128,4  => haval160,4  => haval192,4  => haval224,4  => haval256,4  => haval128,5  => haval160,5  => haval192,5  => haval224,5  => haval256,5 )
So md4() should be available… Why not is more of a PHP question than a web security question though…
I suspect that there probably was a salt used, I don’t even recall what forum it was, might actually have been perl based back then…:mad:
That list is supposed to work with the hash() function: PHP: hash - Manual
So, you use something like:
But… sha1() and md5() don’t…?
They are the most commonly used ones so a shorter way to access them is provided.