Brissouille / Lagrange

Cryptanalysis on differents algorithms with z3 solver sat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Management of Mode for the AES (ECB, CBC, ....)

Brissouille opened this issue · comments

Will the class Aes be a class inheritance or a class attribute ?

To my mind, the best solution is to create a class for each mode. For example, a class AES_CBC mode will have "n" attributes of type aes. Then we combine the output of one aes to the input of the next aes.

I'm beginning by the CBC, because the ECB is a joke.

CBC mode is in progress. Nevertheless, I may change my conception of the integration of the mode. Indeed I think that the code can be factorized with the other mode of the AES.

The Aes_Cbc class is implemented but not completly tested. The factorization of the code is not taken in account in the commit c6e384a

During the test, I found a bug with the key. Indeed the zero key works but not the FF key.
The encryption of a message works with key zero keys.
The xor with the iv works.

I found the bug with the key. It is just a forget to add the equations into my solver. The Aes_Cbc class is pushed on master and the branches are merged.

I will created a new branch for the other mode

The other mode will be implemented with the factorization of the code.
I must implement the decryption function in the aes_mode class and transform the init_mode function to an abstract method.

The mode CBC has a problem about the second block. The plaintext of second block looks like to zero block.
EDIT: I found the problem, fix it in master branch without verify.
EDIT2: I verify a little, it works

Problem with Aes_Ctr mode.
The indexes of the iv must be mastered.
EDIT: The indexes is mastered but the equation in the solver is no taken account.

I resolve the problem with AES ctr. I delete the reset of aes block and it s work.
I stop the development of the different mode of the AES.