Function __global->sodium_crypto_secretbox_open

Definitions

sources_custom/phpstub.php

  • Decrypt an encrypted message with a symmetric (shared) key.This should be used to decrypt text from sodium_crypto_secretbox().
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$ciphertext string No No required parameter N/A N/A The encrypted text
$nonce string No No required parameter N/A N/A The nonce which was used
$key string No No required parameter N/A N/A The 256-bit encryption key used

Returns

  • The decrypted message (false: error)
  • Type: ~string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Decrypt an encrypted message with a symmetric (shared) key.This should be used to decrypt text from sodium_crypto_secretbox().
 *
 * @param  string $ciphertext The encrypted text
 * @param  string $nonce The nonce which was used
 * @param  string $key The 256-bit encryption key used
 * @return ~string The decrypted message (false: error)
 */

function sodium_crypto_secretbox_open(string $ciphertext, string $nonce, string $key)