Hi,
I want to understand the arguments of encryption tool attached in SW12604, and I did test like this:
Pick up 16 bytes in iled_blinky_rt1020.bin
00 00 01 20 0D 26 01 60 33 10 01 60 0F 1A 01 60
The corresponding encryption in iled_blinky_rt1020_encrypt.bin is:
3D 9D 05 8C 92 2C FEA7 95 72 F9 3E 14 4B 1B E9
Pick the region key from image_generate_rt1020.cmd
image_generate.exe ifile=iled_blinky_rt1020.bin ofile=iled_blinky_rt1020_encrypt.bin base_addr=0x60010000 region_key=00112233445566778899aabbccddeeff region_arg=1,[0x60010000,0xF000,0]
region_key: 00112233445566778899aabbccddeeff
Verify the encryption via an online tool: https://cryptii.com/pipes/aes-encryption
The AES-128 mode is CTR,
KEY is: 00112233445566778899aabbccddeeff
IV: 0000000000000000000000000000000
And the encrypted code is:
fd e4 fa 8e 47 2f e1 40 dc e7 23 f6 90 99 82 4b
this is different with:
3D 9D 05 8C 92 2C FEA7 95 72 F9 3E 14 4B 1B E9
in iled_blinky_rt1020_encrypt.bin.
My question is:
The arguments of tool image_generate.exe in AN12604 like below:
Any suggestion is appreciated.
Best Regards,
Martin
Hi @martinzhang ,
region_key is 00112233445566778899aabbccddeeff and it should be fuse into SW_GP2. kib_key and kib_iv is generated randomly by default (same as use_zero_key=0). You needn't know them because they have been protected by region_key.
The kib_key and kib_iv is used to encrypt plain text, not region_key.
Regards,
Jing