mysql - php converting all passwords in DBGet the solution ↓↓↓
I recommend you read more about salts and how to use them. They should not be a constant string, but something unique to each user. For example username. Or my personal favorite: registration date (with the precision of 1 second, of course).
Also, if you store the passwords in your DB as MD5 hashes, there's no way to convert the passwords. MD5 is one way hashing, you can't obtain the original passwords in order to apply the salt and rehash. If you absolutely want to apply this, then the only way you can do this is force each user to change his password and apply the new algorithm when they do. There are 2 problems with this:
- most users are not going to like this
- you must keep track of which user made the change and which didn't. This is to prevent problems when logging in.
just like this, but you have to change your login, so you dont check for their password but for md5($salt.$password);
but as my forposters said, its not much securer and if the password isnt already plain in your database you probably wont get it as plain text if it has been hashed
Share solution ↓
Link To Answer People are also looking for solutions of the problem: integrity constraint violation: 1452 cannot add or update a child row: a foreign key constraint fails
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.