# When confusion is applied during encryption?

I know confusion is used in cryptography to make it more difficult to identify any relationship between the ciphertext and the symmetric key. I want to know when the confusion is applied during encryption, for example:

1. Confusion applied on the symmetric key K1 to form the modified symmetric key K2, and then K2 is used in the encryption: enc(Plain_text,K2).
2. K1 is used in encryption: Cipher_text = enc(Plain_text,K1), and then a confusion function is applied on Cipher_text.

Is it one of these two methods, or something else? An example would be appreciated.

-

Neither of those really represent how confusion might get introduced into an encryption function. Confusion typically gets introduced during the computation of the ciphertext, not before or after.

As an example, we can look at AES. AES is a substitution-permutation network. This means the encryption is done by doing several rounds of substitutions and then permutations. In the case of AES, there are 10-14 rounds of substitutions and permutations.

The way confusion gets introduced into AES is through propagation of bits through the rounds. Imagine if you flip one bit in K. In the first round, this might only effect the one bit of input. Once it passes through the substitution step in the AES S-box, all of the output bits of that S-box will be different. These "changed" bits then get distributed to several other S-boxes in the next round through the permutation step. This continues for all the rounds.

So a single bit change in the key started by only changing one bit in the intermediate computation, but then "spread out" through the encryption process to effect many ciphertext bits.

-
thank you for the explanation. – Cyril Mar 16 '13 at 6:18