You are here

public static function ParagonIE_Sodium_Crypto32::box_secretkey in Automatic Updates 8

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

@internal Do not use this directly. Use ParagonIE_Sodium_Compat.

Parameters

string $keypair:

Return value

string

Throws

RangeException

TypeError

7 calls to ParagonIE_Sodium_Crypto32::box_secretkey()
ParagonIE_Sodium_Compat::crypto_box_secretkey in vendor/paragonie/sodium_compat/src/Compat.php
Extract the secret key from a crypto_box keypair.
ParagonIE_Sodium_Crypto32::box in vendor/paragonie/sodium_compat/src/Crypto32.php
X25519 key exchange followed by XSalsa20Poly1305 symmetric encryption
ParagonIE_Sodium_Crypto32::box_open in vendor/paragonie/sodium_compat/src/Crypto32.php
Decrypt a message encrypted with box().
ParagonIE_Sodium_Crypto32::box_seal in vendor/paragonie/sodium_compat/src/Crypto32.php
X25519-XSalsa20-Poly1305 with one ephemeral X25519 keypair.
ParagonIE_Sodium_Crypto32::box_seal_open in vendor/paragonie/sodium_compat/src/Crypto32.php
Opens a message encrypted via box_seal().

... See full list

File

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

Class

ParagonIE_Sodium_Crypto32
Class ParagonIE_Sodium_Crypto

Code

public static function box_secretkey($keypair) {
  if (ParagonIE_Sodium_Core32_Util::strlen($keypair) !== 64) {
    throw new RangeException('Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.');
  }
  return ParagonIE_Sodium_Core32_Util::substr($keypair, 0, 32);
}