Add encryption handling and session flags management.

This commit is contained in:
netkas 2024-12-10 22:14:43 -05:00
parent 1d452bc71b
commit 86435a3d0b
13 changed files with 857 additions and 134 deletions

24
tests/test.php Normal file
View 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");
}