If the permutation in AES (or other ciphers) were randomly generated or dependent on the key, would it not be stronger against differential attacks?
If this is so, then might we need fewer rounds for the same level of security?
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It only takes a minute to sign up.
Sign up to join this communityIf the permutation in AES (or other ciphers) were randomly generated or dependent on the key, would it not be stronger against differential attacks?
If this is so, then might we need fewer rounds for the same level of security?
You have clarified the question as asking about whether replacing ShiftRows with a random byte permutation would strengthen AES against differential attacks. It would not.
ShiftRows and MixColumns were carefully selected to work in tandem, such that every byte affects every other byte in the state within just two rounds. MixColumns ensures that every column of four bytes has a minimum of five differentially active bytes before and after that step (i.e. if you add the differentially active bytes in the column before MixColumns to the active bytes in the column after MixColumns, the number is at least 5). ShiftRows ensures that every column after the step includes a byte from every column before the step.
Together, the two steps operate to put a high lower bound on the number of differentially active s-boxes over 4 rounds: the AES creators proved that a minimum of 25 s-boxes are active over 4 rounds, minimizing the probability of any differential characteristic/trail.
There are alternatives to ShiftRows that do the same thing (see e.g. the cipher SQUARE which swaps columns and rows). But a random byte permutation would likely not ensure such a high minimum number of active s-boxes over as few rounds as ShiftRows.
I assume that you mean the S-box. The answer is NO! Randomly chosen S-boxes are not good choices for differential and linear cryptanalysis. When Biham and Shamir presented differential attacks on DES, one of the things that they showed was that if you replace the S-boxes in DES with randomly chosen ones, then the differential attack becomes much more devastating. You have to plan your S-box so that it's resilient to these attacks.
I made a toy cipher that functioned in this manner. It had a bytewise transposition step that was performed by an invertible randomized permutation, similar to the Fisher-Yates shuffle, but easily invertible. Key material was used to select the next "random" index to shuffle, so as to enable decryption. At first, I really liked the idea, figuring that cracking the cipher would be much more complex if the order bytes are encrypted in is secret and changes regularly.
The biggest problem with this approach, in my opinion, isn't really related to resistance against standard cryptanalysis. A far bigger, more fundamental problem is that shuffling an array based on secret data appears to be weak against timing attacks. I qualify this as a larger problem because, even if the cipher algorithm were secure, implementations of it probably won't be.
The bottom line for me was to remember that tables and secret data do not mix. While shiftRows is what it is in AES for specific reasons (synergy with mixColumns), I would not recommend randomized byte transposition be employed in any new ciphers, even those which have adequate diffusion otherwise. Primitive designers should attempt to use only components which function in constant time and expose a minimum of side channels.
One point which was not yet mentioned is the easiness of analysis. Making parts of the cipher (the S-box or the linear layer) key-dependent might increase the security -- but we do not know how to prove this. It actually makes the analysis of the design, and thus our primary resource of building trust in the design, much harder.
For the ease of analysis, a very simple, yet secure, design is much more preferable then some obscure, hard to understand, design. Thus, one primary goal of the design should be to be as simple as possible, to allow a thorough analysis and understanding the behaviour of the design as much as possible.
In this regard, the AES is actually a very good design, because we know some very nice (and quite simple) arguments, to reason about its security (e.g. properties of its S-box, the wide-trail strategy and the superbox argument to prove resistance against differential and linear cryptanalysis).