Allowing Login to WordPress with SHA1 (salted)
-
Hi everyone,
I am looking at migrating an ecommerce store from OpenCart to WordPress/WooCommerce. With testing, I’ve been able to see that I can transfer nearly everything across from OpenCart, however, the one issue I am struggling to solve is the existing user’s login – specifically the passwords. I would prefer not to have to reset all the password.
My approach is preferably to get WordPress to accept OpenCart’s authentication method and then convert the password to a WP password once the user logs in.
I’ve found a piece of code that seems to do most of this, but doesn’t take into account the fact that the passwords are salted as well. Could someone please assist me with altering this code to allow salted SHA1 passwords or point me in the right direction as I can’t seem to figure it out.
This is the existing code: https://maxrice.com/allow-wordpress-login-with-sha1-password-hash/ and OpenCart’s password authentication is as follows:
password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1(‘” . $this->db->escape($password) . “‘)))))
Your help will be greatly appreciated.
- The topic ‘Allowing Login to WordPress with SHA1 (salted)’ is closed to new replies.