LMSouq
php-dev Open

How do you use bcrypt for hashing passwords in PHP?

VI
Vilx-
1 month ago
3 views
Problem Description
Every now and then I hear the advice "Use bcrypt for storing passwords in PHP, bcrypt rules". But what is `bcrypt`? PHP doesn't offer any such functions, Wikipedia babbles about a file-encryption utility and Web searches just reveal a few implementations of [Blowfish][1] in different languages. Now Blowfish is also available in PHP via `mcrypt`, but how does that help with storing passwords? Blowfish is a general purpose cipher, it works two ways. If it could be encrypted, it can be decrypted. Passwords need a one-way hashing function. What is the explanation? [1]: http://en.wikipedia.org/wiki/Blowfish_%28cipher%29

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base