sodium_crypto_secretbox_keygen

PHP 7 >= 7.2.0, PHP 8
sodium_crypto_secretbox_keygen - Generate random key for sodium_crypto_secretbox
Manual
Code Examples

Example #1 sodium_crypto_secretbox_keygen example

Result: string(64) "88bd1dc51ec81984f3ddc5a8f59a3d95b647e2da3e879f1b9ceb0abd89e7286c"
PHP Version:

Example #2 Comparing sodium_crypto_secretbox_keygen with random_bytes

Result: bool(true)
PHP Version:


Function sodium_crypto_secretbox_keygen:

Sodium Functions

Most used PHP functions