lundi 20 février 2017

Dynamic C code randomization

I developed an algorithm that maps a two dimensional array A into an other 2D array B.

The algorithm consists in applying a function f on each column c_0, c_1, .... For the sake of ease, let's say f is composed of n boolean operations where execution order matters.

I would like to randomize the algorithm execution in the following way: f(c_0) executes i_0 operations (0 < i_0 < n), then f(c_1) executes i_1 operations (0 < i_1 < n), then either f(c_0) executes the remaining i_0' operations (i_0 < i_0' < n) or f(c_1) executes the remaining i_1' operations or f(c_2) executes i_2 operations etc...

In that way, even if execution order matters in f, there are a lot of chances to get the same result in a different order at each execution.

Is it possible to implement a such randomization in C language? If yes could someone detail me how to?




Aucun commentaire:

Enregistrer un commentaire