php8.5
Home/ Manual/ sodium / functions/ sodium_crypto_box_keypair_from_secretkey_and_publickey

sodium_crypto_box_keypair_from_secretkey_and_publickey

PHP function Edit on GitHub ✎

(PHP 7 >= 7.2.0, PHP 8)

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

Description

sodium_crypto_box_keypair_from_secretkey_and_publickey(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.

Source: reference/sodium/functions/sodium-crypto-box-keypair-from-secretkey-and-publickey.xml · from the official PHP manual (php/doc-en)