[Vuejs]-How to de-crypt password that i've hashed with Bcrypt (for display purposes)?

3👍

bcrypt is hashing algorithm, and not a encryption one. Meaning it is not reversible.

Bcrypt like any other salted hash method use the salt to avoid that the same password hashes to the same string. It is doing that by initially generating the salt randomly and then hashing password and salt. This can only be verified if the same salt is used when verifying. This is why the salt is saved together with the hash.

Bcrypt like any other iterated hash method can not directly be inverted, but you can try all possible passwords to see if they hash to the same result. In case of salted methods you cannot precompute this, because you have to try with the actual salt (as described above).

If you seek to have password that can be de-encrypted, you might want to consider an encryption algorithm rather than a hashing one, or you could take a look at Laravel’s own method encrypt(), although this would require you to rewrite the authentification methods on your application, and might be considered less secure.

More here : https://laravel.com/docs/5.8/encryption

1👍

You cannot.

Hashing is a one-way mathematical operation and it cannot be un-done. You can only create a new hash and compare the two.

Leave a comment