public function encrypt(string $message, string $key = null): string
    {
        $key = $key ?? $this->getKey();

        $nonce = random_bytes(
            SODIUM_CRYPTO_SECRETBOX_NONCEBYTES
        );

        $cipher = base64_encode(
            $nonce .
            sodium_crypto_secretbox(
                $message,
                $nonce,
                $key
            )
        );

        sodium_memzero($message);
        sodium_memzero($key);

        return $cipher;
    }