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

sodium_crypto_secretbox_keygen( ): string

Generate a key for use with sodium_crypto_secretbox and sodium_crypto_secretbox_open.

Parameters

This function has no parameters.

Return Values

Returns the generated string of cryptographically secure random bytes.

Related Functions

Example of sodium_crypto_secretbox_keygen

Show all examples for sodium_crypto_secretbox_keygen

PHP Version:


Function sodium_crypto_secretbox_keygen:

Sodium Functions

Most used PHP functions