Add encryption handling and session flags management.
This commit is contained in:
parent
1d452bc71b
commit
86435a3d0b
13 changed files with 857 additions and 134 deletions
24
tests/test.php
Normal file
24
tests/test.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
use Socialbox\Classes\SecuredPassword;
|
||||
use Socialbox\Managers\EncryptionRecordsManager;
|
||||
|
||||
require 'ncc';
|
||||
import('net.nosial.socialbox');
|
||||
|
||||
print("Getting random encryption record\n");
|
||||
$encryptionRecord = EncryptionRecordsManager::getRandomRecord();
|
||||
var_dump($encryptionRecord);
|
||||
|
||||
print("Securing password\n");
|
||||
$securedPassword = SecuredPassword::securePassword('123-123-123', 'password!', $encryptionRecord);
|
||||
|
||||
print("Verifying password\n");
|
||||
if(SecuredPassword::verifyPassword('password!', $securedPassword, EncryptionRecordsManager::getAllRecords()))
|
||||
{
|
||||
print("Password verified\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
print("Password not verified\n");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue