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 55use \BNETDocs \Libraries \User ;
66use \BNETDocs \Models \User \CreatePassword as UserCreatePasswordModel ;
77
8+ use \CarlBennett \MVC \Libraries \Common ;
89use \CarlBennett \MVC \Libraries \Controller ;
910use \CarlBennett \MVC \Libraries \Router ;
1011use \CarlBennett \MVC \Libraries \View ;
@@ -31,7 +32,14 @@ private static function transform($input) {
3132 $ hash = null ;
3233 $ salt = null ;
3334
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 ));
3543
3644 return [ $ hash , $ salt ];
3745 }
You can’t perform that action at this time.
0 commit comments