Function __global->sodium_crypto_box_seal
Definitions
sources_custom/phpstub.php
- Encrypt a message such that only the recipient can decrypt it.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $message | string | No | No | required parameter | N/A | N/A | The message to encrypt |
| $public_key | string | No | No | required parameter | N/A | N/A | The public key that corresponds to the only key that can decrypt the message |
Returns
- A ciphertext string in the format of (one-time public key, encrypted message, authentication tag)
- Type: string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Encrypt a message such that only the recipient can decrypt it.
*
* @param string $message The message to encrypt
* @param string $public_key The public key that corresponds to the only key that can decrypt the message
* @return string A ciphertext string in the format of (one-time public key, encrypted message, authentication tag)
*/
function sodium_crypto_box_seal(string $message, string $public_key) : string
* Encrypt a message such that only the recipient can decrypt it.
*
* @param string $message The message to encrypt
* @param string $public_key The public key that corresponds to the only key that can decrypt the message
* @return string A ciphertext string in the format of (one-time public key, encrypted message, authentication tag)
*/
function sodium_crypto_box_seal(string $message, string $public_key) : string
