-
Notifications
You must be signed in to change notification settings - Fork 10
Password
Stefano Azzolini edited this page Feb 26, 2016
·
2 revisions
The Password module allow you securely hash/verify password.
$hashed_passwd = Password::make('my_secret_password');
echo $hashed_passwd;$2y$12$s88T0ByrVDPEILP2GfJUWeSqHUCFMWGFwx1XmyCguHmO2L20XuR3W
var_dump(
Password::verify('my_secret_password','$2y$12$s88T0ByrVDPEILP2GfJUWeSqHUCFMWGFwx1XmyCguHmO2L20XuR3W')
);bool(true)
In order to prevent a Timing Attack, you can use the compare method for comparing string equality in a time-constant way.
var_dump(
Password::compare('my_secret_password','this-is-a-test')
);bool(false)
Core is maintained by using the Semantic Versioning Specification (SemVer).
Copyright 2014-2016 Caffeina srl under the MIT license.
http://caffeina.com