You are here

public static function ParagonIE_Sodium_Crypto32::box in Automatic Updates 7

Same name and namespace in other branches
  1. 8 vendor/paragonie/sodium_compat/src/Crypto32.php \ParagonIE_Sodium_Crypto32::box()

X25519 key exchange followed by XSalsa20Poly1305 symmetric encryption

@internal Do not use this directly. Use ParagonIE_Sodium_Compat.

Parameters

string $plaintext:

string $nonce:

string $keypair:

Return value

string

Throws

SodiumException

TypeError

2 calls to ParagonIE_Sodium_Crypto32::box()
ParagonIE_Sodium_Compat::crypto_box in vendor/paragonie/sodium_compat/src/Compat.php
Authenticated asymmetric-key encryption. Both the sender and recipient may decrypt messages.
ParagonIE_Sodium_Crypto32::box_seal in vendor/paragonie/sodium_compat/src/Crypto32.php
X25519-XSalsa20-Poly1305 with one ephemeral X25519 keypair.

File

vendor/paragonie/sodium_compat/src/Crypto32.php, line 425

Class

ParagonIE_Sodium_Crypto32
Class ParagonIE_Sodium_Crypto

Code

public static function box($plaintext, $nonce, $keypair) {
  return self::secretbox($plaintext, $nonce, self::box_beforenm(self::box_secretkey($keypair), self::box_publickey($keypair)));
}