suculent / thinx-aes-lib

AES wrapper for ESP8266/ESP32/Arduino/nRF5x
Other
117 stars 38 forks source link

"Simple" example fails - abandonned? #63

Closed Smashcat closed 2 years ago

Smashcat commented 2 years ago

The example code fails with decryption failure error messages. I've noticed this never worked in the code this was forked from. Is there a library that can also decrypt AES packets?

suculent commented 2 years ago

The original low-level AES code used to encrypt/decrypt did always worked as it is covered with tests.

Examples may fail from time to time, I have not much of chance to test/fix them these days.

This project will expectedly deprecate in favour of Arduino Crypto

Smashcat commented 2 years ago

Ok thanks. It's the simple.ino example that fails decryption. The medium example works - seems like the decrypt() method does not actually decrypt properly. The decrypt64() method does though.

suculent commented 2 years ago

Interesting. 64 methods are kind of deprecated because it limits user options (if you expect to have b64 on the output, it’s actually b64zed twice).

Anyway, what’s your device? There are issues regarding ESP32 here and i’ll need to look into portability first.

Cheers, Matej

10. 2. 2022 v 12:26, SCOTT PORTER @.***>:

 Ok thanks. It's the simple.ino example that fails decryption. The medium example works - seems like the decrypt() method does not actually decrypt properly. The decrypt64() method does though.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

hansliss commented 2 years ago

The version that gets installed by the Arduino library manager is not the same as here, even though the version number is the same. It does an added Base64 encode even in the encrypt() function, where this shouldn't be done. You will need to manually correct the bug in AESLib.cpp by removing the base64 code and changing the return statement.

suculent commented 2 years ago

The library manager issue has been resolved now.

adriancs2 commented 1 year ago

Actually, this library: https://rweather.github.io/arduinolibs/crypto.html is my early attempt to implement the AES encryption. The problem is I have a hard time to run a successful working example with that library, and therefore, I end up using this library (AESLib) in my production.

for anyone that is interested, I shared my code at my github: https://github.com/adriancs2/arduino.aes.asp.net