PHP Classes

File: tests/password_test.php

Recommend this page to a friend!
  Classes of Marco Cesarato   PHP AIO Security Class   tests/password_test.php   Download  
File: tests/password_test.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP AIO Security Class
Filter untrusted data to prevent security issues
Author: By
Last change: Update of tests/password_test.php
Date: 4 years ago
Size: 1,021 bytes
 

Contents

Class file image Download
<?php

require_once '../src/Security.php';
use
marcocesarato\security\Security;

$password = Security::generatePassword(15);
$guid = Security::generateGUID();
$uf_password = Security::generateFriendlyPassword('Marco Cesarato 2019', 1);
$enc_password = Security::passwordHash($password);
$check = Security::passwordVerify($password, $enc_password);
$wrong_password = Security::generatePassword(15);
$check_false = Security::passwordVerify($wrong_password, $enc_password);

echo <<<HTML
<h1>Password Tests</h1>
<h2>GUID Generation</h2>
<pre>
$guid</pre>
<h2>Password Generation</h2>
<pre>Security::generatePassword(15) = "
$password"</pre>
<h2>Password Friendly Generation</h2>
<pre>Security::generateFriendlyPassword('Marco Cesarato 2019', 1) = "
$uf_password"</pre>
<h2>Password Encryption</h2>
<pre>Security::passwordHash("
$password") = "$enc_password"</pre>
<h2>Password Verify</h2>
<pre>
HTML;
var_dump($check);
echo <<<HTML
</pre>
<h2>Password Verify (Miss Match)</h2>
<pre>
HTML;
var_dump($check_false);
echo
'</pre>';