File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 5
5
use \BNETDocs \Libraries \User ;
6
6
use \BNETDocs \Models \User \CreatePassword as UserCreatePasswordModel ;
7
7
8
+ use \CarlBennett \MVC \Libraries \Common ;
8
9
use \CarlBennett \MVC \Libraries \Controller ;
9
10
use \CarlBennett \MVC \Libraries \Router ;
10
11
use \CarlBennett \MVC \Libraries \View ;
@@ -31,7 +32,14 @@ private static function transform($input) {
31
32
$ hash = null ;
32
33
$ salt = null ;
33
34
34
- User::createPassword ( $ input , $ hash , $ salt );
35
+ $ pepper = Common::$ config ->bnetdocs ->user_password_pepper ;
36
+
37
+ $ gmp = gmp_init (time ());
38
+ $ gmp = gmp_mul ($ gmp , mt_rand ());
39
+ $ gmp = gmp_mul ($ gmp , gmp_random_bits (64 ));
40
+ $ salt = strtoupper (gmp_strval ($ gmp , 36 ));
41
+
42
+ $ hash = strtoupper (hash ('sha256 ' , $ input .$ salt .$ pepper ));
35
43
36
44
return [ $ hash , $ salt ];
37
45
}
You can’t perform that action at this time.
0 commit comments