PicoMite V6.00.01 release candidates - please test thoroughly


Author Message
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 559
Posted: 10:29pm 20 Dec 2024      

  matherp said  
  Quote  Why is iv supposedly optional if it is required? Is there a default value that might be missing?

iv is optional because the firmware has a value built in but it isn't all zeroes as that website assumes. To match the website you have to specify it as all zeroes to override the internal default. Dimming an array iv% sets it to zeroes



> list
'TEST aes128 cbc
'
Dim integer out2(15)
key$ = "1234567812345678"
in$  = "1234567890123456"
'iv$  = "1234567812345678"
iv$  = String$( 16, 0 ) 'nbr, ascii
'
Math aes128 encrypt cbc key$,in$,out2(),iv$
Math v_print out2(), hex
> run
74, 74, A4, 9E, 44, 98, B2, 49, D8, F6, 2E, F4, CF, 55, 41, A9
>

Yes, then it is a match :-)

Is this IV defined in the firmware? Or is it generated as a hash from the KEY? For transparency and security reasons, I would be interested to know how the default value is generated. Thank you very much!