**AES Key Expansion**

AES Key Expansion is the important topic of the Subject Information and Network Security.

- AES takes 16-byte key as input.
- As shown in the figure below key expansion process is straight-forward.

##### Overall Key expansion algorithm: AES Key Expansion

- First of all, a key stored in the 4X4 matrix in column major matrix as shown in the figure.
- Each column combines to form 32 bit word.
- Then we apply function g to every fourth word that is w3, w7, w11 etc.
- Than X-OR operation performed as shown in the figure to obtain next four words. And this process continues till generation of all words.
- As shown in figure (b) internal structure of function g.
- First, we convert word to 4 bytes.
- Then apply circular left shift operation.
- Moreover, Then apply substitute byte operation using S-box which is same as S-box of AES encryption process.
- Then we apply X-OR operation with round constant which has least significant 3 bytes as zero and most significant byte depends on round number which is shown in the table below.

- And the output of this function is used for X-OR operation as shown in figure (a).

**AES Example [ ****AES Key Expansion ****]**

Let see an example of AES and consider some of its implications.

Although you not expected to duplicate the example by hand, you will find it informative to study the hex patterns that occur from one step to the next.

**Result: **Above table shows plain text, key, and ciphertext when we apply all the steps of AES we will get cipher text as shown.

**The Avalanche Effect: **A desirable property of any encryption algorithm is that a small change in either the plaintext or the key should produce a significant change in the ciphertext.

In particular, a change in one bit of plaintext or one bit of the key should produce a change in many bits of the ciphertext. This referred to as the avalanche effect.

In AES 1 bit change in input will affect nearly all bit of output after all rounds.

**Related Terms**

Information and Network Security, AES Implementation, Block Cipher Principles, Public Key Cryptography

## Leave a Reply