K
K
Konstantin B.2015-09-18 07:33:58
Hashing
Konstantin B., 2015-09-18 07:33:58

How does Lavarel encrypt a user's password and verify it?

There was a need to use the site database, and actually you need to understand how Laravel generates a password hash and check it

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
ajaxtelamonid, 2015-09-18
@Kostik_1993

password_hash($password , PASSWORD_BCRYPT)
and
password_verify ($password , $hash )

M
msk01, 2017-10-19
@msk01

What nonsense. Instead of a normal answer, they send a person to read footcloths on Habré.
This is how he encrypts it:
$hash = password_hash($value, PASSWORD_BCRYPT, array('cost' => 10));
And this is how it checks:
password_verify($value, $hashedValue);
where the password is in the $value variable

P
pherum, 2015-09-18
@pherum

read the article on habré, many questions will disappear immediately)
habrahabr.ru/post/194972

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question