Hi and thanks for your help. I have managed to upgrade my website from mysql to PDO. However, I am still using old functions like md5(). I have to continue to use this as my host provider is still on PHP4.5. I need a better equivalent. This is not necessarily for passwords but to post data to another page and to store in database tables. Any help on this?

Also as I ham using PDO, I want to make the website available to PHP8. I assume nd5() will be gone but what other functions will not be supported if upgrading from PHP7 to PHP8

As an example...
I love dogs
After md5() bcomes a7f6bde30206ba75668000f56f0fea9a. So if md5() is not supported in PHP8 what can I do here. YThis is not a securety issue.

The best answer might depend on why you are using it, but I guess the default answer would be to use hash() with whichever hashing algorithm you prefer?

otuatail This is not a securety issue.

Which increases my curiosity as to why you would want to hash it.

otuatail So if md5() is not supported in PHP8

PS: As far as I can tell, md5() is not deprecated in PHP8, so not sure what your issue is with it? (It's not recommended for password hashing, but it seems the function is still available.)

    md5 is still there (it helps to look at the manual now and then). It is obsolete in its designed role (generating a message digest to detect if a document has been tampered with). It has also never been suitable for hashing passwords for the reason given on its manual page (namely, it's too fast).

    otuatail This is not necessarily for passwords but to post data to another page and to store in database tables. Any help on this?

    Again, it depends on what you're actually doing (e.g. the above tamper detection), but as NogDog suggests, there is hash (which can use any of the algorithms listed by https://www.php.net/hash-algos).

    The other thing you need to do if you're migrating from one version of PHP to another is to read the Migration sections of the manual, which will list what's been added, removed, and deprecated since each previous version. It will save a lot of guesswork and thrashing around.

      Write a Reply...