I already have a web application where i have encrypted all my password using
Hash::make($string);
What is the equivalent of that in core php , that would help my android developers in syncing with my app. I tried with hash and crypt, it wasn't same. Help me with it, so that it would be easier for my developers to write backend.
The Laravel Hash facade provides secure Bcrypt and Argon2 hashing for storing user passwords. If you are using one of the Laravel application starter kits, Bcrypt will be used for registration and authentication by default.
In PHP, there are various cryptographic algorithms that are commonly used like md5, crypt, sha1, and bcrypt. And the most commonly used nowadays is bcrypt hashing method.
The hash() function returns a hash value for the given data based on the algorithm like (md5, sha256). The return value is a string with hexits (hexadecimal values).
From Laravel 5 onward, you can use the bcrypt() function to hash a plaintext. So, you can save that hashed password in DB and then, compare the hashed password again to match. $save_password = bcrypt('plain_text_password'); $check_password = bcrypt('provided_password_while_login_request'); And then, compare these two.
Try using
password_hash($string);
you can verify it by using
password_verify($string,$hash);
Hope that helps!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With