Warning. This exercise is probably
very hard even prohibitive
for those who don't know primitive polynomials over finite fields!
In this case please prefer
Decrypt which is mathematically much more rudimentary.

Graphical decrypt is an exercise on the algebraic cryptology based on
pseudo-random sequences generated by primitive polynomials over a finite field
_{q}.
You will be presented a picture composed of n×n pixels, crypted
by such a sequence. This picture has q colors, each color representing an
element of _{q}.

And your goal is to decrypt this crypted picture, by finding back the
primitive polynomial as well as the starting terms which determine the
pseudo-random sequence.