Is there any security issues if you wrap your cryptographic hash with MD5 for storage purposes?
For example:
$hash = md5(hash($password,$salt,$rounds));
Note: hash()
uses scrypt
or bcrypt
or pbkdf2
internally.
The only purpose of md5 is for storage since it only uses 32 bytes vs storing very long raw hash.
EDIT: Judging from the comments below I agree MD5 is not a good idea as it is collision prone but what if I use a better hashing function like SHA512? Still, comments below argue it may actually weaken it but can somebody please explain how?
How can this:
$hash = SHA512(bcrypt($password,$salt,$rounds));
be weaker than this:
$hash = bcrypt($password,$salt,$rounds);
?
It appears to me the former is stronger since you have to "crack" SHA512 first before you can even begin working on cracking bcrypt. Why others says otherwise?