Geffe pseudo-random key generator

Geffe generator based on LFSR implemented in other posts.

The algorithm was designed in 1973 . By P.R. Geffe. It is based on interconnected nonlinear three registers LFSR. This generator is also cryptographically weak. It turns out that the sequence of the output is 75 % of the time equal to the output string LFSR 1 and 25 % of the time string to the output LFSR. Such a correlation is very dangerous and can easily be broken. Geffe generator can be expanded in such a way that in place of the generator LFSR 1 , LFSR 2 , LFSR 3 will be inserted three generators of Geffe. The resulting generator is characterized by a high modulus of complexity.

int geffe() {
    int lf1 = lfsr_1();
    int lf2 = lfsr_2();
    int lf3 = lfsr_3();
    int and1 = lf1 & lf2;
    int and2;
    if (lf2 == 1) and2 = 0 & lf3;
    else and2 = 1 & lf3;
    return and1 ^ and2;
}
Source code: https://github.com/khipis/c-unix-sandbox/blob/master/shift-registers/geffe.c

Popularne posty