Cat Overlord
Cat Overlord

Reputation: 173

What should I do if password_hash isn't supported

I have a web server that runs PHP 5.4.x, which means it doesn't support the password_hash function, so I can't hash passwords. I cannot upgrade the PHP version.

How can I protect passwords without the password_hash function ?

Upvotes: 1

Views: 57

Answers (2)

MohitC
MohitC

Reputation: 4791

Have a look at crypt function

You can also use password_compat. It's a backward compatible library to emulate password_hash() in older versions of PHP (5.3.7+).

Upvotes: 1

jpaljasma
jpaljasma

Reputation: 1612

You should take a look at https://github.com/ircmaxell/password_compat

This library is intended to provide forward compatibility with the password_* functions that ship with PHP 5.5.

Upvotes: 1

Related Questions