Arguments of encryption tool used in SW12604

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Arguments of encryption tool used in SW12604

271 Views
martinzhang
Contributor III

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

martinzhang_0-1675324899904.png

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

martinzhang_1-1675324916090.png

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.

 martinzhang_2-1675324941907.png

 My question is:

The arguments of tool image_generate.exe in AN12604 like below:

 martinzhang_3-1675324952820.png

  1. Is region_key used for encoding?
  2. In the example, I cannot find the kib_key and kib_iv is set, is there any default value for these?
  3. In the example, I cannot find the region_iv, is there any default value for this?

 

 

Any suggestion is appreciated.

 

Best Regards,

Martin

0 Kudos
1 Reply

243 Views
jingpan
NXP TechSupport
NXP TechSupport

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

0 Kudos