I saw the AES algorithm that at the end of algorithm the buffer that stored in the beginning of algorithm the encrypt/decrypt key. now is store the last subkey.

What is the last subkey? Why do I need to know it?

  • $\begingroup$ Have you ever look at the AES algorithm and its key schedule? At the end of the last round, there is an AddRoundKey, that is the last sub-key generated by the key schedule! Why do you need to know it??? $\endgroup$
    – kelalaka
    Dec 15, 2019 at 16:59
  • $\begingroup$ @kelalaka I sorry friend ,maybe I don't understand , the last sub-key is the encrypted) decrypted data? $\endgroup$
    – Algo aes
    Dec 15, 2019 at 17:03
  • $\begingroup$ In AES, or similarly in almost all block ciphers, all subkeys are x-ored with the current registers that store the stage of the encryption. Sorry, but this question is not well prepared! $\endgroup$
    – kelalaka
    Dec 15, 2019 at 17:05

1 Answer 1


In AES, a certain amount of rounds of encryption are performed. The amount of rounds depends on the length of the key (128/192/256 bits). The key is expanded through the key schedule function, and at each round, the sub key is the next 16 bytes of the expanded key. Each round, the sub key is XORed against the current state. So the sub key has to be known in order to perform the encryption.


Not the answer you're looking for? Browse other questions tagged or ask your own question.