You are here

public static function ParagonIE_Sodium_Crypto::box in Automatic Updates 7

Same name and namespace in other branches
  1. 8 vendor/paragonie/sodium_compat/src/Crypto.php \ParagonIE_Sodium_Crypto::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_Crypto::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_Crypto::box_seal in vendor/paragonie/sodium_compat/src/Crypto.php
X25519-XSalsa20-Poly1305 with one ephemeral X25519 keypair.

File

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

Class

ParagonIE_Sodium_Crypto
Class ParagonIE_Sodium_Crypto

Code

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