expensive key setup algorithm //P: array of 18 subkeys (UInt32[18]) //S: Four substitution boxes (S-boxes 有了3个输入,我们会调用EksBlowfishSetup函数去初始化18个subkeys和4个1K大小的S-boxes,从而达到最终的P和S。 block P2n+1 <- block[32..63] //upper 32-bits block //Mix encrypted state into the internal S-boxes
expensive key setup algorithm //P: array of 18 subkeys (UInt32[18]) //S: Four substitution boxes (S-boxes 有了3个输入,我们会调用EksBlowfishSetup函数去初始化18个subkeys和4个1K大小的S-boxes,从而达到最终的P和S。 block P2n+1 <- block[32..63] //upper 32-bits block //Mix encrypted state into the internal S-boxes
使用IDA Pro加载固件,通过寻找一些加密常用的常量: S-Boxes, Forward和Reverse Tables和Initialization Constants,分析出LIFX采用了AES进行加密
. // initializing the P-array and S-boxes with values derived from pi; omitted in the example //
. // initializing the P-array and S-boxes with values derived from pi; omitted in the example //
is composed of 4 S-boxes in parallel. Suppose ? = (? ,? ,? ,? ) ∈ (?M)C is input to 0234 3 * ?
(x) >> (32 - n))) #define SWAP(a,b) { unsigned long t = a; a = b; b = t; t = 0; } /* * Expanded SM4 S-boxes