Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Hash equivalent in core php

Tags:

php

laravel

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.

like image 771
Tendulraj Avatar asked Jul 19 '14 07:07

Tendulraj


People also ask

What hashing does laravel use?

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.

What hash does PHP use?

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.

How do you hash something in PHP?

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).

How does laravel match hashed password?

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.


1 Answers

Try using

password_hash($string);

you can verify it by using

password_verify($string,$hash);

Hope that helps!!

like image 157
Ajay Kumar Ganesh Avatar answered Oct 26 '22 06:10

Ajay Kumar Ganesh