I'm studying password encryption algorythms. I know the existence of bcrypt, scrypt, and varients, but I want to chanllenge myself on this question and that's why I came up with this algorythm in PHP:
$secret = md5( uniqid( mt_rand(), true ) ); // Length is 32
$passwd = 'qwert123';
$hash = $secret . hash( 'sha256', $secret + $passwd );
Since secret is randomly determined and added at the front of the password hash, I could verify the password input like this:
$secret = substr( $hash_from_db, 0, 32 );
$hash_from_db === $secret . hash( 'sha256', $secret + $input_from_user );
What do you think about this implementation? I would do like to receive some feedback about it. Thank you.