0

I'm currently studying AES encryption and I'm quite confused on how do we use a 256-bit key in AES?

Becuase in my understanding, AES no matter what the key size is, it still operates and encrypt a 128-bit block of message only in the whole cycle/rounds until it reaches the end.

well for AES-128 we use a 128-bit key that is total of 16 byte char, and that can be represented by a 4x4 matrix, and most AES operations and steps works on 4x4 matrix right?

Then how do we use a 256 bit key?, that is a 32 byte char and that is not even a perfect square right?

Will that 256-bit key result into the same size of 128-bit key version of AES when expanded by key expansion? and just use 16 bytes each when encrypting to match the 4x4 state array?

0xdeadbeef
  • 105
  • 5

2 Answers2

3

Even for AES128 we don't use the key directly. Each round gets its own key in the process called key expansion. Those round keys are used to transmute a matrix. The original key is never applied directly.

AES256 adds more rounds. Each round stays the same, only the key derivation for them changes slightly. This allows for less dependant round keys, which hopefully adds to the cipher strength. However, there is some deficiency in the key expansion algorithm which makes the 192 and 256-bit variants more susceptible to related key attacks.

1

If you're wondering why a 256-bit key offers any greater security, you need to realize that a 128-bit block cipher is essentially a way of mapping $2^{128}$ input values to $2^{128}$ output values. That means the set of all possible 128-bit block ciphers has a size of $2^{128}!$, which is about $10^{10^{40}}$.

A 128-bit key allows you to choose one of $2^{128}$ possible mappings. Although this is a huge number, it's a vanishingly small fraction of the set of all ciphers. The same could be said for any practical key size, but with a 256-bit key, you get to choose from a far larger set of possible input-output mappings, making the encryption that much harder to crack.

r3mainer
  • 2,073
  • 15
  • 17