public static function decrypt($message, $sender_public, $receiver_private)
    {
        # Test to make sure all the required variables are strings.
        Helpers::isString($message, 'PublicKeyEncryption', 'decrypt');
        Helpers::isString($sender_public, 'PublicKeyEncryption', 'decrypt');
        Helpers::isString($receiver_private, 'PublicKeyEncryption', 'decrypt');

        # Generate a keypair for the message to be received.
        $messageKeyPair = \Sodium\crypto_box_keypair_from_secretkey_and_publickey(
            Helpers::hex2bin($receiver_private),
            Helpers::hex2bin($sender_public)
        );

        # Deconstruct the message from JSON.
        $message = base64_decode(json_decode($message, true));

        # Attempt to decrypt the message.
        $plaintext = \Sodium\crypto_box_open(
            Helpers::hex2bin($message['msg']),
            Helpers::hex2bin($message['nonce']),
            $messageKeyPair
        );

        # Test if the message was able to be decrypted.
        if ($plaintext === false) {
            throw new DecryptionException('Failed to decrypt message using key');
        }

        return $plaintext;
    }