View Single Post
Old 10th January 2007, 00:02   #516  |  Link
honai
Guest
 
Posts: n/a
Yes, I pointed that out previously, but didn't think that anyone actually noticed.

Basically, you'll only need to hook into the key schedule function since that one is being fed the raw decryption key. The AES-128 decryption function itself uses that computed key schedule later on, so hooking into that would be too late already.

Pseudo-code for the key schedule looks something like this:

Quote:
for i from 0 to Nk-1 {
w[i] = word (key[4*i], key[4*i+1], key[4*i+2], key[4*i+3])
}

for i from Nk to Nb(Nr+1) -1 {
if (i is multiple of Nk) then {
w[i] = SubstituteBytes( PermuteWord(w[i-1]) ) XOR RoundConstant[i/Nk]
} else if (Nk = 8 and i - 4 is multiple of Nk) then {
w[i] = SubstituteBytes( w[i-1] )
}
w[i] = w[i] XOR w[i-Nk]
}

Last edited by honai; 10th January 2007 at 00:06. Reason: added pseudo-code
  Reply With Quote