[PHP-NOTES] note 130808 added to function.sodium-memzero
[email protected] ("Anonymous") Fri, 05 Jun 2026 08:11:59 +0000
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
<?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 ---- Server IP: 206.189.2.9 (proxied: BunnyCDN) Probable Submitter: 2405:201:2014:30d9:a0da:23d9:8940:b166 ---- Manual Page -- https://php.net/manual/en/function.sodium-memzero.php Edit -- https://main.php.net/note/edit/130808 Del: integrated -- https://main.php.net/note/delete/130808/integrated Del: useless -- https://main.php.net/note/delete/130808/useless Del: bad code -- https://main.php.net/note/delete/130808/bad+code Del: spam -- https://main.php.net/note/delete/130808/spam Del: non-english -- https://main.php.net/note/delete/130808/non-english Del: in docs -- https://main.php.net/note/delete/130808/in+docs Del: other reasons-- https://main.php.net/note/delete/130808 Reject -- https://main.php.net/note/reject/130808 Search -- https://main.php.net/manage/user-notes.php