PHP 7 >= 7.2.0, PHP 8
sodium_crypto_kx_keypair - Creates a new sodium keypair
Code Examples

sodium_crypto_kx_keypair( ): string

Create a new sodium keypair consisting of the secret key (32 bytes) followed by the public key (32 bytes). The keys can be retrieved by calling sodium_crypto_kx_secretkey and sodium_crypto_kx_publickey, respectively.


This function has no parameters.

Return Values

Returns the new keypair on success; throws an exception otherwise.

Example of sodium_crypto_kx_keypair

Show all examples for sodium_crypto_kx_keypair

PHP Version:

Function sodium_crypto_kx_keypair:

Sodium Functions

Most used PHP functions