Encryption xtea加密arduino到Web服务器

Encryption xtea加密arduino到Web服务器,encryption,arduino,webserver,Encryption,Arduino,Webserver,嗨,我正在arduino上使用xtea加密库。我的代码(部分代码)如下: XXTEA xxtea("0123456789012345"); dtostrf(celsius, 4, 3, temperature); xxtea.encrypt(temperature); ... ... client.print("?temp="); client.print(temperature); client.print("&fahrenheit="); client.print(fahre

嗨,我正在arduino上使用xtea加密库。我的代码(部分代码)如下:

XXTEA xxtea("0123456789012345");    
dtostrf(celsius, 4, 3, temperature);
xxtea.encrypt(temperature);
...
...
client.print("?temp=");
client.print(temperature);
client.print("&fahrenheit=");
client.print(fahrenheit);
client.print("&key=");
client.print("123456789012345");
发送到Web服务器的url如下所示:

add.php?temp=\xcb\x17\x0fMQ\xc2\xb6?4\x06\xd1c&fahrenhei=72.27&key=0123456789012345

我的PHP代码如下所示:

include("xtea.class.php");
echo $temp1=  rtrim($_GET["temp"]);
echo $key=$_GET["key"];
echo"<br><br>";
$xtea = new XTEA($key);
echo $ausgabe =$xtea->Decrypt($temp1);
include(“xtea.class.php”);
echo$temp1=rtrim($_GET[“temp”]);
echo$key=$\u GET[“key”];
回声“

”; $xtea=新的xtea($key); echo$ausgabe=$xtea->Decrypt($temp1);
对于ausgaben,我得到了“¥K^4”。怎么了


php的xtea.class从这里获得:

是您的
客户机.print(“123456789012345”)缺少前导零?ups..我将其更改为0123456789012345,但仍然没有得到合理的值。您可以在同一个函数中加密和解密吗?不使用URL-仅用于测试…serial.println提供类似于;'根据我对xtea的了解,您需要知道它处理数据块…但这不是这里的问题,在将其扩展到internet URL之前,您需要一个接一个地进行加密和解密