Note: This is all for fun and learning. None of this will go into production code.
I'm studying something (sponge functions, specifically) that benefit from large block sizes. AES has a (comparatively) small block size of only 128 bits. Is this a safe construction for increasing the block size?
$E(x)$ and $D(x)$ are encryption and decryption in ECB mode respectively. The size of the input $b_0$ is a multiple of the cipher's block size. The encryption proceeds as follows.
$$c_n = E(b_{n-1})$$ $$b_n = shift(c_n)$$
This is repeated once for every blocksize chunk in the input. For example, encrypting a 512-bit block with AES (a 128-bit block cipher) will take 4 rounds, so the output will be $b_4$.
Decryption is a simple reverse of the above algorithm.
$$c_{n} = shift^{-1}(b_n)$$ $$b_{n-1} = D(c_{n})$$
$shift(x)$ is defined as lining up the blocks vertically and shifting each row by an amount corresponding to it's row. All operations are done on the byte level. It is similar to ShiftRows in AES.
For example, with a block size of 8 (bytes) and an input of aaaaaaaabbbbbbbb12345678
, $shift$ would proceed like this.
ab1 <-- shift by 0 = ab1
ab2 <-- shift by 1 = b2a
ab3 <-- shift by 2 = 3ab
ab4 <-- shift by 3 (equiv. 0) = ab4
ab5 <-- shift by 4 (equiv. 1) = b5a
ab6 <-- shift by 5 (equiv. 2) = 6ab
ab7 <-- shift by 6 (equiv. 0) = ab7
ab8 <-- shift by 7 (equiv. 1) = b8a
The resulting output would be ab3ab6abb2ab5ab81ab4ab7a
.
The intention is to diffuse it enough to make sure every plaintext bit has an effect on every ciphertext bit.
Are there any major flaws I'm missing here?