BoxSeal
in package
Uses
BoxTrait
Class BoxSeal.
Table of Contents
- decrypt() : false|string
- Decrypts a message ciphertext.
- encrypt() : string
- Encrypts a message with an anonymous public key.
- makeKeyPair() : string
- Makes a keypair.
- makeNonce() : string
- Makes a box nonce with the correct length.
- makePublicKey() : string
- Makes the public key from a keypair.
- makeSecretKey() : string
- Makes the secret key from a keypair.
Methods
decrypt()
Decrypts a message ciphertext.
public
static decrypt(string $ciphertext, string $keyPair) : false|string
Parameters
- $ciphertext : string
- $keyPair : string
Tags
Return values
false|string —The message or false if the ciphertext could not be decrypted
encrypt()
Encrypts a message with an anonymous public key.
public
static encrypt(string $message, string $publicKey) : string
Parameters
- $message : string
- $publicKey : string
Tags
Return values
string —makeKeyPair()
Makes a keypair.
public
static makeKeyPair() : string
Tags
Return values
string —makeNonce()
Makes a box nonce with the correct length.
public
static makeNonce() : string
Tags
Return values
string —makePublicKey()
Makes the public key from a keypair.
public
static makePublicKey(string $keyPair) : string
Parameters
- $keyPair : string
Tags
Return values
string —makeSecretKey()
Makes the secret key from a keypair.
public
static makeSecretKey(string $keyPair) : string
Parameters
- $keyPair : string