I can"t decrypt in esp8266 nodemcu the string encrypted in PHP -
i trying sent encrypted info server esp8266 wis nodemcu firmware. can't decode it. result wrong. tested same string-key-metod encryption in php , nodemcu. result different. ??? here test scripts. php:
$data = "abc"; $key = "1234567812345678"; $b64enc = base64_encode(openssl_encrypt($data, 'aes-128-cbc', $key)); echo $b64enc;
the result dwnttdvsl2prawdrmwr4ennxatjrzz09
in nodemcu esp8266:
key = "1234567812345678" data = "abc" b64enc = crypto.tobase64(crypto.encrypt("aes-cbc", key, data)) print(b64enc)
node mcu result 2q7hfgajdch6ia5s7ypyww==
????????????????????????????
it looks different. tested different options - same. it's interesting if make double encoding in nodemcu:
print(crypto.tobase64(b64enc))
the result in php: mne3agznywpkq2g2swe1uzdzcfl3dz09 , same different.
any suggestion??
Comments
Post a Comment