public static function verifyMessage($message, $key, $hashKey = '')
    {
        # Test the message and key for string validity.
        Helpers::isString($message, 'Encryption', 'verifyMessage');
        Helpers::isString($key, 'Encryption', 'verifyMessage');
        Helpers::isString($hashKey, 'Encryption', 'verifyMessage');

        # Create a special hashed key for encryption.
        $key = Hash::hash($key, $hashKey, Constants::AUTH_KEYBYTES);

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

        if (\Sodium\crypto_auth_verify(Helpers::hex2bin($message['mac']), $message['msg'], $key)) {
            \Sodium\memzero($key);

            return $message['msg'];
        } else {
            \Sodium\memzero($key);
            throw new Exceptions\SignatureException('Signature for message invalid.');
        }
    }