BoxSeal class
Framework\Crypto\BoxSeal
Class BoxSeal.
Defined in libraries/crypto/src/BoxSeal.php
Methods #
- decrypt()
- Decrypts a message ciphertext.
- encrypt()
- Encrypts a message with an anonymous public key.
- makeKeyPair()
- Makes a keypair.
- makeNonce()
- Makes a box nonce with the correct length.
- makePublicKey()
- Makes the public key from a keypair.
- makeSecretKey()
- Makes the secret key from a keypair.
decrypt()
public static function decrypt(string $ciphertext, string $keyPair): string|false
Decrypts a message ciphertext.
Parameters
- string $ciphertext
- string $keyPair
Returns
string|false
- The message or false if the ciphertext could not be decrypted
encrypt()
public static function encrypt(string $message, string $publicKey): string
Encrypts a message with an anonymous public key.
Parameters
- string $message
- string $publicKey
Returns
string
makeKeyPair()
public static function makeKeyPair(): string
Makes a keypair.
Returns
string
makeNonce()
public static function makeNonce(): string
Makes a box nonce with the correct length.
Returns
string
makePublicKey()
public static function makePublicKey(string $keyPair): string
Makes the public key from a keypair.
Parameters
- string $keyPair
Returns
string
makeSecretKey()
public static function makeSecretKey(string $keyPair): string
Makes the secret key from a keypair.
Parameters
- string $keyPair
Returns
string