문제

I'm moving to a other shopping cart and want to import the customers. However the new shopping cart uses a other password system. I would like to convert the old passwords + salt to a single md5.

This is the code for the old shopping cart:

if (md5(md5($password) . md5($salt)) == $hash) {}

This is the code for the new shopping cart:

password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape($password) . "'

Is it possible to convert it into a single md5 string?

도움이 되었습니까?

해결책

No. You would need the original value (the password) to recreate the hash using a different algorithm. Since you don't have the password and a hash is purposefully not reversible, you cannot get the "single MD5" value.

You'll have to adapt the code in your new system to work with the old hash values.
And you should use something better than MD5 while you're at it, it's entirely inadequate for secure password hashing. password_hash is the PHP state-of-the-art.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top