Summery Summery

Authenticated Encryption with Associated Data

Syntax Syntax

ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt( string $plaintext = '', string $assocData = '', string $nonce = '', string $key = '', bool $dontFallback = false )

Description Description

Algorithm: XChaCha20-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.

Parameters Parameters


(string) (Optional) Message to be encrypted

Default value: ''


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

Default value: ''


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

Default value: ''


(string) (Optional) Encryption key

Default value: ''


(bool) (Optional) Don't fallback to ext/sodium

Default value: false

Return Return

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

Source Source

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




Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.