So my web host only supports SHA-1 and MD5, which are both pretty broken and out-dated. What can I do in this situation. Will I have to use an external site to hash my password (using POST
requests), or would it be safe to do it through JavaScript. I'm not too keen on hashing passwords on the client's side though.
Is there any way I can get a SHA-2, SHA-3 or MD6 algorithm for PHP and use that as a custom method? If not, what would you suggest is the best way to overcome this problem?
Thanks in advance, DibDibs
EDIT
Here are the errors I am receiving when using different methods of hashing...
When I call hash("sha-256", $str)
, I get this error: PHP Warning: hash(): Unknown hashing algorithm: sha-256
And when I call any algorithm directly, for example sha2($str)
, I get this error: PHP Fatal error: Uncaught Error: Call to undefined function sha2()
I don't know how the host has disabled them, to me it looks like the functions (hashing algorithms) just aren't there to begin with.
hash("sha256", "asdf")
or similar and it doesn't work? And no, don't use an outside service for hashing your passwords. – Sami Kuhmonensha256
without the dash php.net/manual/en/function.hash.php – Sami Kuhmonenprint_r(hash_algos());
to find out what algorithms are supported, and how they are called/spelled. – Siguzasha224
,sha256
,sha384
, andsha512
. – Scott Arciszewski