sodium_crypto_kx_server_session_keys

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_kx_server_session_keysCalculate the server-side session keys.

Опис

sodium_crypto_kx_server_session_keys(#[\SensitiveParameter] string $server_key_pair, string $client_key): array

Calculate the server-side session keys, using the X25519 + BLAKE2b key-exchange method.

Параметри

server_key_pair

A crypto_kx keypair, such as one generated by sodium_crypto_kx_keypair().

client_key

A crypto_kx public key.

Значення, що повертаються

An array consisting of two strings. The first should be used for receiving data from the client. The second should be used for sending data to the client.

add a note

User Contributed Notes 1 note

up
0
watung at gmail dot com
1 hour ago
I propose adding optional hash algorithm selection to sodium_crypto_kx_* functions, allowing developers to choose between BLAKE2b (current default), SHA-256, or other standardized KDFs. This would improve interoperability with systems like Web Crypto API that use different key derivation approaches, while maintaining backward compatibility. A parameter like $options['hash'] could specify the algorithm, making Libsodium more flexible for cross-platform cryptography without sacrificing security.
To Top