Search found 8 matches

by esp_Hemal
Sat May 25, 2019 5:17 pm
Forum: ESP-IDF
Topic: Recover key from flash encryption
Replies: 6
Views: 7269

Re: Recover key from flash encryption

Hi, When you say you are having trouble with re-flashing with flash encryption enabled does that mean that the first plaintext flashed got encrypted properly after flash encryption was enabled with pre-generated key and ESP32 boots correctly? Could you provide details of all the steps you followed? ...
by esp_Hemal
Sat Apr 27, 2019 9:54 am
Forum: ESP-IDF
Topic: Problem in Computing AES 256 CBC
Replies: 19
Views: 24908

Re: Problem in Computing AES 256 CBC

chegewara,

Thanks for your comment.

This is not a bug. As you have already noticed IV gets updated after AES-CBC operation. This is due to the nature of CBC algorithm. So you need to ensure same IV value is used for encryption and decryption
by esp_Hemal
Fri Apr 26, 2019 6:53 pm
Forum: ESP-IDF
Topic: Problem in Computing AES 256 CBC
Replies: 19
Views: 24908

Re: Problem in Computing AES 256 CBC

Your plaintext is 13 bytes which is less than block size (=16 bytes) and AES-CBC only works on input whose length is multiple of block size. If not multiple of block size it needs to be padded. So the encryption output would be different for different padding. In your case during encryption out of 3...
by esp_Hemal
Tue Apr 23, 2019 9:43 am
Forum: ESP-IDF
Topic: Read registers using C code?
Replies: 6
Views: 9340

Re: mbedtls_aes_crypt_ecb VS mbed_internal_aes_encrypt ESP32

Hi SK,

It's a documentation error. The AES_KEY registers are WRITE ONLY and hence will always return 0 when read

As suggested on other thread in general the dport registers should be read with DPORT_REG_READ()
by esp_Hemal
Sun Apr 21, 2019 2:42 pm
Forum: ESP-IDF 中文讨论版
Topic: 关于ESP32 flash加密 和secrue boot 的咨询
Replies: 5
Views: 8637

Re: 关于ESP32 flash加密 和secrue boot 的咨询

Hi Xjjiang, Thanks for providing the efuse dump and other information. Unfortunately once the efuses are programmed you can not revert the values. So FLASH_CRYPT_CNT can not be set to zero now, not even with JTAG. It is permanently set to 0xFF As mentioned before you need to reprogram the bootloader...
by esp_Hemal
Thu Apr 18, 2019 12:00 pm
Forum: ESP-IDF 中文讨论版
Topic: 关于ESP32 flash加密 和secrue boot 的咨询
Replies: 5
Views: 8637

Re: 关于ESP32 flash加密 和secrue boot 的咨询

Hi xjjiang, Have you enabled FLASH ENCRYPTION and SECURE BOOT both or only SECURE BOOT? From the boot up log it looks like the FLASH_CRYPT_CNT is set to indicate the flash contains encrypted image however you seem to have programmed plaintext image. Perhaps you have programmed the plaintext image af...
by esp_Hemal
Thu Apr 18, 2019 10:18 am
Forum: ESP-IDF
Topic: mbedtls_aes_crypt_ecb VS mbed_internal_aes_encrypt ESP32
Replies: 2
Views: 3802

Re: mbedtls_aes_crypt_ecb VS mbed_internal_aes_encrypt ESP32

Hi sk, mbedtls_aes_crypt_ecb() function accepts mode (encrypt/decrypt) as one of the arguments so it can do both. Whereas mbedtls_internal_aes_encrypt() performs only encryption. Later one gets called from previous if the mode is selected as 'encrypt'. If AES HW acceleration is enabled (through menu...
by esp_Hemal
Thu Feb 14, 2019 10:01 am
Forum: ESP-IDF
Topic: AES Enceyprion/Decryption using key in efuse block
Replies: 1
Views: 3530

Re: AES Enceyprion/Decryption using key in efuse block

Hi, You are right. The encryption key can be internally generated within ESP32 or could be generated externally and programmed in efuse There are two APIs for encrypted flash write & read namely esp_partition_write() and esp_partition_read() Please refer this link for more information: https://docs....