You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You will have to update the data in blocks of 128 bits.
Try something like this:
// data[32]aes256_encrypt_ecb(&ctxt, data); // encrypt first block of 128 bits in placeaes256_encrypt_ecb(&ctxt, data+16); // encrypt second block of 128 bits in placeDUMP("Encrypted data: ", i, data, sizeof(data));
aes256_decrypt_ecb(&ctxt, data); // decrypt first block of 128 bits in placeaes256_decrypt_ecb(&ctxt, data+16); // decrypt second block of 128 bits in placeDUMP("Back decrypted data: ", i, data, sizeof(data));
If I change the
data
in the examples to 32 bytes, for instance:the output on the serial monitor is:
As you can see, only the first 16 bytes are being encrypted (
7EE7EF984D51B1E3E1A31F8559988CF2
); the rest is still cleartext. Why is that?The text was updated successfully, but these errors were encountered: