<?php
$key = random_bytes(SODIUM_CRYPTO_SECRETBOX_KEYBYTES);
$message = "Customer financial data";
$nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
$ciphertext = sodium_crypto_secretbox($message, $nonce, $key);
// Key no longer needed
sodium_memzero($key);
var_dump($key); // Usually becomes an empty string