1. Go to this page and download the library: Download jnativel/sentinel-vault library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jnativel / sentinel-vault example snippets
use SentinelVault\SentinelVault;
// Initialize the vault
$vault = (new SentinelVault())
->setMasterKeyB64($_ENV['MASTER_KEY_B64']);
// Generate a DEX key for a user
$dex = $vault->createDexKey(
'dex:user:123:key:main',
'user:123:scope:profile',
['exp' => '2026-01-01T00:00:00Z', 'status' => 'ACTIVE']
);
// Encrypt and decrypt user data
$cipher = $vault->encryptWithDex($dex['dex_blob'], 'dex:user:123:key:main', 'Sensitive Data');
$plain = $vault->decryptWithDex($dex['dex_blob'], 'dex:user:123:key:main', $cipher);