array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.sodium-crypto-box-open.php', 1 => 'sodium_crypto_box_open', ), 'up' => array ( 0 => 'ref.sodium.php', 1 => 'Funções da Sodium', ), 'prev' => array ( 0 => 'function.sodium-crypto-box-keypair.php', 1 => 'sodium_crypto_box_keypair', ), 'next' => array ( 0 => 'function.sodium-crypto-box-publickey-from-secretkey.php', 1 => 'sodium_crypto_box_publickey_from_secretkey', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/sodium/functions/sodium-crypto-box-open.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 7 >= 7.2.0, PHP 8)
sodium_crypto_box_open — Authenticated public-key decryption
Decrypt a message using asymmetric (public key) cryptography.
ciphertext
The encrypted message to attempt to decrypt.
nonce
A number that must be only used once, per message. 24 bytes long. This is a large enough bound to generate randomly (i.e. random_bytes()).
key_pair
See sodium_crypto_box_keypair_from_secretkey_and_publickey(). This should include the sender's public key and the recipient's secret key.
Returns the plaintext message on success, ou false
em caso de falha.