davy_yg's avatar
Level 27

decrypting bcrypt password

Hello,

I have been looking for away to decrypt bcrypt password online but I cannot understand why they keep asking for a string to check against?

When encrypting it as simple as this:

$user->password = bcrypt($request->password); $user->save();

What am I missing?

0 likes
1 reply
tykus's avatar
tykus
Best Answer
Level 104

You're missing the fact that bcrypt is a one-way hash, i.e. not intended for decryption

You can check if a given string (password) satisfies the hash using Hash::check($password, $hash)

2 likes

Please or to participate in this conversation.