shakti's avatar

How to decrypt Hash Password in Laravel

Hello Guys

I m new in laravel

And i m working on existing project, So can anyone tell me how can we decrypt password(bcrypt)

0 likes
20 replies
topvillas's avatar

You can't. You can only do a comparison.

4 likes
shakti's avatar

so it is not possible for us to display pass which user has set during the signup to admin method

Can you please list out all the challenges which we can face while using other methods like encrypt, decrypt

martinbean's avatar
Level 80

@ershakti Passwords are hashed, not encrypted. That means they can’t be reversed into their plain text form. This is for security reasons.

If someone downloads your database, they shouldn’t be able to reverse each of your users’ passwords. It’s also a security issue to simply display a password back to the user in case they’re on an insecure network and someone is eavesdropping on the connection.

If you need to display a password, then you’re doing something wrong.

15 likes
shakti's avatar

@martinbean actually as per application requirement whenever users try forget password then we have to email them there password ,not reset password link

mikevrind's avatar

That is a really, really, really bad system requirement @ershakti. You should really change that. It's irresponsible to store passwords like that.

6 likes
Snapey's avatar

check the owasp website for best practice and never be so unprofessional as to send the user their password.

Don't just say that's what the client wants because it is your job to advise against bad practice.

Passwords should always be hashed, which as has been said is a one-way process

3 likes
shakti's avatar

okay i will keep in mind for this

martinbean's avatar

@ershakti If a user forgets their password they should reset it, not have their current one emailed to them. As mentioned, this is a really bad practice from a security point of view, as if someone gets access to one of your website users’ inbox, they can just request their password.

Lots of people use the same password for multiple services, so if they have a password for the user’s account on your website, then they may have used the same password for their online banking account or other sensitive services. So you can see why sending passwords in plain text is a bad idea.

2 likes
shakti's avatar

@martinbean okay from now onward i will keep this thing in mind. thanks guys for correcting me it help me alot

kosar's avatar

So how we can check if a user is exist or not?

Snapey's avatar

@kosar you look in the User table and see if they have a record - doh.

azimidev's avatar

It's one way algorithm and can't be decrypted.

Snapey's avatar

@amirhazz only the password is hashed. You don't search for the user by their password.

erdemirr's avatar

Short answer is that you don't 'decrypt' the password (because it's not encrypted - it's hashed).

shailenderahuja's avatar

I have some different requirement, i don't want to decode the password, but i am building some other app based on SAME DATABASE for LOGIN so what i can do to "encrypt the password value so that it matches the backend password encrypted code".

Please help...

Snapey's avatar

@shailenderahuja different situation, needs a different question.

Also, this question is 2 years old and solved. Yours is not going to get attention here

shez1983's avatar

if you have seen the thread then you wouldnt have asked this q. if you really must do encrypt/decrypt then create your own login/reset which does what you want but it will be insecure

Please or to participate in this conversation.