密码哈希加密后解密密码

Red*_*tif -4 php encryption hash

这是我的密码加密代码:

// Create a 256 bit (64 characters) long random salt
// Let's add 'something random' and the username
// to the salt as well for added security
$salt = hash('sha256', uniqid(mt_rand(), true) . 'something random' . strtolower($username));

// Prefix the password with the salt
$hash = $salt . $password;

// Hash the salted password a bunch of times
for ( $i = 0; $i < 100000; $i ++ )
{
    $hash = hash('sha256', $hash);
}

// Prefix the hash with the salt so we can find it back later
$hash = $salt . $hash;
Run Code Online (Sandbox Code Playgroud)

我丢失了教程网站.有谁知道如何解密这种加密.非常感谢你.感谢您的帮助

dec*_*eze 9

没有*de*cryption算法,因为没有*en*cryption算法.你正在做的是一个哈希,这是一个不可逆的操作.而这正是重点,你不想存储甚至让你有机会知道真正的密码是什么的东西.