ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt

Advertisement

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

$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: ''

$dontFallback

(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


			

Advertisement

Advertisement

Leave a Reply

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