ESP32 & ESP8266 - AES encryption and decryption

preview_player
Показать описание
In this episode of ESP32 & ESP8266 programming, we are going to talk about AES(advance encryption algorithm) encryption and decryption.
Рекомендации по теме
Комментарии
Автор

I changed key content, length, message contents and yet my is the same (Cypher text: Not sure if the program works !.

experimental
Автор

is the CyrptoAES_CBS a library
because i couldn't find it on the library manager

jerome
Автор

Is it better on esp32 or esp82? Or it doesn’t matter?

aemerth
Автор

Followed your tutorial, was a great help from the start as i had no idea how to do AES encryption before, and cloudnt find any other tutorial as simple as yours. HOWEVER, your code as is is flawed. The password is incorrect, it must be in a specific format for it to work. This is an functioning example for AES128:

// Define a 16-byte key (AES-128 requires 16 bytes)
byte key[16] = {'1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'};

And here is one for AES-256:

AES256 aes; // Use AES256 for 256-bit key support
// Define a 32-byte key (AES-256 requires 32 bytes)
byte key[32] = {
'1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1',
'2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2'
};


Also, it is worth noting that the encrypted message can be only of a certain length, meaning that long texts have to be cut and encrypted individually, and later it has to be decrypted from the same cutted parts

janpospisil
visit shbcf.ru