Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

teguh_rijanandi's avatar

Decrypt Password

Hi guys, i want ask to you. I'm want to decrypt a laravel account password. but i'm find this problem. How to fix that? i'm followed this tutorial but failed https://laravel.com/docs/5.8/encryption#using-the-encrypter

My code is

php use Illuminate\Support\Facades\Crypt; use Illuminate\Contracts\Encryption\DecryptException; ?>

php $unhash = Crypt::decrypt(Auth::user()->password); ?>

php echo $unhash; ?>

And then the error code is :

The payload is invalid. (View: C:\xampp\htdocs\pandawa\resources\views\admin\myprofil\update.blade.php)

0 likes
4 replies
ftiersch's avatar

You cannot decrypt a password. A password is hashed, not encrypted. You can only compare if two hashed passwords are the same thing but you cannot get the original value from the hash.

That's for security :)

3 likes
jlrdw's avatar

Why would anyone even think of such a thing. If you could un-hash a hashed password, the World better stop using computers now.

Cronix's avatar

You explained what you're trying to do, but not why. I'm sure there is a better way to accomplish whatever it is that you're actually trying to do than needing to decrypt a password. As mentioned, Laravel doesn't use encryption for user passwords, so you can't decrypt it anyway. So, what's the purpose of wanting to do this? Why do you think you need the plaintext password? For what?

1 like
teguh_rijanandi's avatar

@CRONIX - No. I'm want make a list of user (using table). Then in the table showing all users password. But when i'm heard can't decrypt password using laravel. I'm cancled to make a list of user.

Thanks Cronix and thanks all :)

Please or to participate in this conversation.