Implemented the standard AES encryption algorithm, the block size is 128 bits, the key is 128 bits, for example, the line consists of 31 bytes: "Two One Nine Two One Three four" = 31 bytes (zero is added to 32 bytes) Key: Thats my Kung Fu = 16 bytes At the moment, from the source text, select the first 16 bytes and do all the transformations with this key (Add Roundkey, Mixcolumns ...), then the next 16 bytes of the source text with the same key. Question: what if the key will be for example 32 byte or 48, i.e. it is clear that everything is divided into blocks of 16 bytes and conversions are performed, but in what sequence? Is this the correct picture? If the source text = 16 bytes and the key = 48 bytes, then the key is divided into 3 blocks and encryption is performed sequentially 3 times with each block, is that correct? http://imgur.com/rt0f6dQ

    1 answer 1

    AES can only work with 128/192/256-bit (16/24/32 byte) keys. If you have a key of a different length, you will have to increase / decrease it.

    • I know this information! but I have a question, if the key is 48 bytes (please see the picture) and the source text is only 16 bytes, can this source text be encrypted 3 times, i.e. pass through all methods but with different keys (1st time 1st key block 16 bytes, etc.) ??? - Dmitry
    • You can, but why? - Vladimir Martyanov
    • First of all, you do not need to write your implementation without very good reasons. In the second place, you should look at the known working implementation, for example in OpenSSL. - Vladimir Martyanov
    • I have already written my implementation, it just needs to be added a little to work with 192 and 256 bit keys - Dmitry
    • tell me, how to perform the Add Roundkey operation when using the 192-bit key, if we have the source text contains a 4x4 matrix and the round key is a 4x6 matrix? or I do not understand how to make a matrix of round keys? - Dmitry