You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-5
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,15 @@ Only users with accounts in our application can be authenticated.
12
12
13
13
## Working with Passwords
14
14
15
-
### Hashing Passwords
15
+
### Hashing and Validating Passwords
16
16
17
17
Passwords can be hashed using one of the three mechanisms:
18
18
19
19
1. PHP's built in `password_*` functions. This is default and recommended method
20
20
1. Using PBKDF2
21
21
1. Using SHA1
22
22
23
-
Later two are there for compatibility resons only, so you can transition your hashed passwords to PHP's password management system if you have not done that already. Password manager's `needsRehash()` method will always recommend rehashing for PBKDF2 and SHA1 hashed passwords.
23
+
Later two are there for compatibility reasons only, so you can transition your hashed passwords to PHP's password management system if you have not done that already. Password manager's `needsRehash()` method will always recommend rehashing for PBKDF2 and SHA1 hashed passwords.
24
24
25
25
Example:
26
26
@@ -41,8 +41,6 @@ Library offers a way to check if password needs to be rehashed, usually after yo
41
41
```php
42
42
$manager = new PasswordManager('global salt, if needed');
43
43
44
-
$hash = $manager->hash('easy to remember, hard to guess');
45
-
46
44
if ($manager->verify($user_provided_password, $hash_from_storage, PasswordManagerInterface::HASHED_WITH_PHP)) {
47
45
if ($manager->needsRehash($hash_from_storage, PasswordManagerInterface::HASHED_WITH_PHP)) {
48
46
// Update hash in our data storage
@@ -79,7 +77,7 @@ Here's an example where all rules are enforced:
79
77
(new PasswordStrengthValidator())->isPasswordValid('BhkXuemYY#WMdU;QQd4QpXpcEjbw2XHP', new PasswordPolicy(32, true, true, true));
80
78
```
81
79
82
-
## Generating Passwords
80
+
###Generating Random Passwords
83
81
84
82
Password strength validator can also be used to prepare new passwords that meed the requirements of provided policies:
0 commit comments