Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with Arduino XXTEA #7

Open
pedros89 opened this issue Sep 29, 2021 · 4 comments
Open

Incompatibility with Arduino XXTEA #7

pedros89 opened this issue Sep 29, 2021 · 4 comments

Comments

@pedros89
Copy link

This library seems incompatible with Arduino XXTEA.
The application was to send an encrypted data from Arduino via POST request and decrypt it in PHP.
Arduino XXTEA used

The two libraries decode in different ways it seems.

Look at the picture below, you see how the ecrypted string in Arduino is
d49baa5e4b9b6ee6c8cf5ab0a61baa7a
But the encrypted string in PHP xxtea is a bounch of awful stuff:
�,�„'—ÍÌIˆ(¦HL�ìF0do
Look at the screenshot, on the right there is the Arduino serial monitor encrypting with its XXTEA and on the left PHP encrypting with your XXTEA
image

Maybe converting those buch of waful stuff from HEX to string I can have a result.

@andot
Copy link
Member

andot commented Sep 29, 2021

try to use this one: https://github.com/xxtea/xxtea-c

@pedros89
Copy link
Author

pedros89 commented Sep 29, 2021

Thank you,
I tried it but I have conversions errors. (see image)
Never mind. I think I'll leave XXTEA
image

I have decide to move to RC4 encryption and I hope I will be luckier.

RC4 encryption between Arduino and PHP

@andot
Copy link
Member

andot commented Sep 30, 2021

You can cast the char * type to void * using (const void*)text

@pedros89
Copy link
Author

Thank you for your help, I would then need the data to be stored in a string to use it.
I have not clear what I have to cast as void*. If you could write the line of code it would help. Also for then converting it to char array and then to string.
Anyway, I will give it a try in the future, but for now I made everything with RC4 algo as explained here below.
https://stackoverflow.com/a/69390303/13795525

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants