Secure Hash PHP

Secure Hash

This Is The Most Secure Way To Hash Your Data .
It Is Almost Impossible To Retrieve Your Data .

Create Two Random Keys And Save Them In Your Configuration File

// Create A Random Key
echo base64_encode(openssl_random_pseudo_bytes(64));

// Save The Keys In Your Configuration File

function secured_hash($data)
$first_key = base64_decode(FIRSTKEY);
$second_key = base64_decode(SECONDKEY);

$first_hashed = hash_hmac('sha3-512', $data, $first_key, TRUE);
$second_hashed = hash_hmac('sha3-512', $first_hashed, $second_key);

return $second_hashed;