I have the following code: (just a test file for encryption/hashing)
<!doctype html>
<html>
<head></head>
<body>
<?php
error_reporting('off');
if (isset($_POST['submit'])) {
$salt = "2bZ@<^$";
$hash = hash("sha512", $_POST['hash']);
$hash = $salt . $hash;
$hash = md5($hash);
echo $hash;
$hashLen = strlen($hash);
echo "<br>The length of the hashed word is " . $hashLen . " characters long!";
}
?>
<form action="hashed.php" method="post">
<input type="text" name="hash">
<input type="submit" value="Hash" name="submit">
</form>
</body>
</html>
How safe is this? I know this most probably can be hacked, but how long would it take? I am currently making a php/mysqli registration form and want to make the user's passwords as secure as I can, so that it would take a hacker a very long time to crack one of the user's passwords. To encrypt it even more I can use this for example:
Hashing it with sha512, md5(md5), adding a different salt, two more sha512, another md5 and another different salt!
How secure does that sound? How long would it take a hacker to crack that password? Please could you advise me with using a very, very secure encryption method. Also, I want to keep a user logged in with a cookie: need a secure way to store their information in a cookie!
Thanks in advance :)