ParagonIE_Sodium_Compat::crypto_box

SummerySummery

Authenticated asymmetric-key encryption. Both the sender and recipient may decrypt messages.

Syntax

ParagonIE_Sodium_Compat::crypto_box( string $plaintext, string $nonce, string $keypair )

DescriptionDescription

Algorithm: X25519-XSalsa20-Poly1305. X25519: Elliptic-Curve Diffie Hellman over Curve25519. XSalsa20: Extended-nonce variant of salsa20. Poyl1305: Polynomial MAC for one-time message authentication.

ParametersParameters

$plaintext

(string) (Required) The message to be encrypted

$nonce

(string) (Required) A Number to only be used Once; must be 24 bytes

$keypair

(string) (Required) Your secret key and your recipient's public key

ReturnReturn

(string) Ciphertext with 16-byte Poly1305 MAC

SourceSource

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


			
Scroll to Top