Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<sodium_crypto_box_keypairsodium_crypto_box_open>
^Sodium FunctionsLast updated: Mon, 26 Oct 2026

sodium_crypto_box_keypair_from_secretkey_and_publickey

(PHP 7 >= 7.2.0, PHP 8)

sodium_crypto_box_keypair_from_secretkey_and_publickey — Create a unified keypair string from a secret key and public key

Description

function sodium_crypto_box_keypair_from_secretkey_and_publickey(#[\SensitiveParameter] string $secret_key, string $public_key): string

This function exists to satisfy the API requirements of e.g. crypto_box(). Pass in one party's secret key and the other's public key, and you will obtain a "keypair" for your conversation.

Parameters

secret_key

Secret key.

public_key

Public key.

Return Values

X25519 Keypair.


<sodium_crypto_box_keypairsodium_crypto_box_open>
^Sodium FunctionsLast updated: Mon, 26 Oct 2026