ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt

SummerySummery

Authenticated Encryption with Associated Data

Syntax

ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt( string $plaintext = '', string $assocData = '', string $nonce = '', string $key = '' )

DescriptionDescription

Algorithm: ChaCha20-Poly1305

This mode uses a 64-bit random nonce with a 64-bit counter. IETF mode uses a 96-bit random nonce with a 32-bit counter.

ParametersParameters

$plaintext

(string) (Optional) Message to be encrypted

Default value: ''

$assocData

(string) (Optional) Authenticated Associated Data (unencrypted)

Default value: ''

$nonce

(string) (Optional) Number to be used only Once; must be 8 bytes

Default value: ''

$key

(string) (Optional) Encryption key

Default value: ''

ReturnReturn

(string) Ciphertext with a 16-byte Poly1305 message authentication code appended

SourceSource

File: wp-includes/sodium_compat/src/Compat.php


			
Scroll to Top