From 21fedb3af692b12c1f0aa266bbf788b01f2cbe4c Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Sun, 26 Mar 2023 04:50:46 +0300 Subject: auth tests --- tests/auth.php | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/register.php | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 tests/auth.php create mode 100644 tests/register.php (limited to 'tests') diff --git a/tests/auth.php b/tests/auth.php new file mode 100644 index 0000000..26c057a --- /dev/null +++ b/tests/auth.php @@ -0,0 +1,58 @@ +cryptPassword($val); + $hash[] = $x; +} +?> + + + Dev Tools + + +

crypt passwords; then...

+

check password validation

+
+ ". $password[$i] ." -> ". $hash[$i]. "\n";
+    $verify[$i] = ($pass->isTextPasswordValid($password[$i], $hash[$i])) ? 'valid' : 'not-match';
+}
+
+?>
+
+ + + + + + \ No newline at end of file diff --git a/tests/register.php b/tests/register.php new file mode 100644 index 0000000..7f778af --- /dev/null +++ b/tests/register.php @@ -0,0 +1,43 @@ +cryptPassword('102030!!!'); + +$user = (new User()) + ->setUserName('geo@roptron.gr') + ->setPassword($password) + ->setRoles([1]); + +$userManager->createUserToken($user); + + +$algos = [ + password_hash('root1234', PASSWORD_DEFAULT, ['cost' => 10 ]), + password_hash('root1234', PASSWORD_ARGON2I, ['cost' => 10 ]), + password_hash('root1234', CRYPT_BLOWFISH, ['cost' => 10 ]), + password_hash('root1234', PASSWORD_DEFAULT, ['cost' => 9 ]), + password_hash('root1234', PASSWORD_ARGON2I, ['cost' => 9 ]), + password_hash('root1234', CRYPT_BLOWFISH, ['cost' => 9 ]), + password_hash('root1234', PASSWORD_DEFAULT, ['cost' => 11 ]), + password_hash('root1234', PASSWORD_ARGON2I, ['cost' => 11 ]), + password_hash('root1234', CRYPT_BLOWFISH, ['cost' => 11 ]), + password_hash('root1234', PASSWORD_DEFAULT, ['cost' => 12 ]), + password_hash('root1234', PASSWORD_ARGON2I, ['cost' => 12 ]), + password_hash('root1234', CRYPT_BLOWFISH, ['cost' => 12 ]), + password_hash('root1234', PASSWORD_DEFAULT, ['cost' => 8 ]), + password_hash('root1234', PASSWORD_ARGON2I, ['cost' => 8 ]), + password_hash('root1234', CRYPT_BLOWFISH, ['cost' => 8 ]), + password_hash('root1234', PASSWORD_DEFAULT, ['cost' => 7 ]), + password_hash('root1234', PASSWORD_ARGON2I, ['cost' => 7 ]), + password_hash('root1234', CRYPT_BLOWFISH, ['cost' => 7 ]) + +] +?>
\ No newline at end of file -- cgit v1.2.3